`NumConvert`: Type-safe number conversions in Clash 1.10

Starting from Clash 1.10, converting between number types becomes easier and safer. Typically, developers use fromIntegral to convert between number types. This is perfectly fine in pure Haskell, but Clash may silently truncate the intermediate type, Integer, to 64-bits. With the new infrastructure, you can use numConvert and maybeNumConvert which are guaranteed to be lossless.

Clash 1.10 released

Clash 1.10 is the first release since Rowan Goemans joined QBayLogic as the new Clash lead. This post highlights the removal of Clash.Prelude.DataFlow in favor of clash-protocols, introduces NumConvert, and gives porting guidance.

Shockwaves: Typed waveforms for Clash

For years, debugging Clash designs in a waveform viewer has been a massive pain. After all, the waveform viewers we have were not designed with Clash in mind, and glady present us with unintelligible binary values. But those times are now over! I’ve spent the last months working on Shockwaves, a system that lets you show typed waveforms in (Surfer)[https://surfer-project.org/], and after many, many changes, tests, bug fixes and rewrites, we have finally reached the point of an official release!

Introducing checked-literals: compile-time bounds checking for numeric literals

GHC’s builtin overflow warnings are easy to bypass and don’t work for custom numeric types. We wrote a GHC source plugin, checked-literals, that rewrites numeric literals so that out-of-range values are rejected at compile time. It works in monomorphic and polymorphic contexts, supports integer and rational literals, and produces actionable error messages – including suggested type-level constraints.

Tricking Haskell into state: how Clash's Signal type works

I recently came across a question on /r/haskell, where /u/netj_nsh asked whether Clash supports asynchronous circuit designs. They went on to ask whether designing with multiple, synchronous clock domains is possible. While the (very) short answers are no and yes, respectively, I figured I’d write a blog post clarifying these concepts and how they relate to Clash. Mostly though, I just wanted an excuse to write about Clash’s simple yet clever trick that makes it tick: Signal.

Getting started with Clash on the Arrow DECA devkit

Using a stack project template you can easily set up a new project for the Arrow DECA development board which contains an Intel MAX10 FPGA (50K LEs; 1638 Kbit memory) and a lot of peripherals (10/100 Mbps EtherNet; HDMI TX; USB 2.0 PHY; audio CODEC; etc). The project template contains and LED-blinker created in Clash and a Quartus project that automatically loads the Clash generated files.

Clash 1.2.2 and future plans

Last Friday we released Clash 1.2.2 on GitHub. In big part thanks to our lovely community, we’ve found and fixed many bugs. Thanks to some patches, Clash even runs anywhere from 2-20% faster for some common design patterns! With this blogpost I’d like to highlight some of the progress we’ve made since the 1.2 release, and elaborate on our future plans.

Clash 1.2 released

As promised when releasing 1.0, we’ve tried our best to keep the API stable. We think most designs will continue to compile with this new version, although special care needs to be taken when using:

  • ..inline blackboxes. Instead of taking a single HDL, inline primitives now take multiple. For example, InlinePrimitive VHDL ".." must now be written as InlinePrimitive [VHDL] "..".

  • ..the Enum instance for BitVector, Index, Signed, or Unsigned, as they now respect their maxBound. See #1089.