Reusing FPGA designs: How Clash Cores and Clash Protocols speed up development
Reading time: 5 minutes

Every FPGA project shares certain common building blocks. Serial communication interfaces, checksum calculations, data encoding schemes… These components appear in project after project, in slightly different configurations but with fundamentally the same purpose. Building them from scratch each time is not just slow, it’s also a source of bugs.
At QBayLogic, we’ve invested in making these common components reusable, well-tested, and freely available. The result is two open-source projects: Clash Cores and Clash Protocols.
Clash Cores: standard components off the shelf
Clash Cores is a collection of ready-made IP cores written in Clash. It lives on GitHub as an open-source repository and contains components that we, and the wider community, use regularly across different projects.
The current collection includes an SPI master and slave core for serial peripheral communication, a UART component for sending and receiving characters over a serial interface, a CRC module for checksum calculations, an Etherbone implementation, and 8b10b line encoding and decoding. There are also SGMII PCS components for gigabit Ethernet physical layer communication, and various wrappers around AMD FPGA primitives such as block RAM, clock domain crossing FIFOs, and integrated logic analyzers.
An Ethernet stack is also in advanced development, though it has not yet been merged into the main branch.
These are not trivial components. An SPI core, for example, needs to handle multiple clock polarity and phase modes correctly. A CRC implementation must produce bit-exact results for every supported polynomial. Getting this right is well-understood work but getting them right every time you build them from scratch is harder than it sounds. Having a tested, proven implementation to reach for eliminates an entire category of project risk.
Why reuse matters
The benefits of reusable components are straightforward but worth stating explicitly.
- Speed is the most obvious one. Importing a tested UART or SPI core takes minutes. Building one from scratch and then testing it thoroughly enough to trust it takes considerably longer.
- Reliability follows directly from reuse. A component that has been used across multiple projects and tested in multiple contexts contains fewer surprises than one written last week. Bugs in shared components get found and fixed by the entire user base, not just the current project team.
- Readability is a less obvious but equally important benefit. When a project uses standard, well-named components, the design becomes easier to understand for anyone who reads it, whether that’s a colleague reviewing the code, a new team member getting up to speed, or the original engineer returning to the project after six months.

Clash Cores and Clash Protocols at a glance: what is available now, and the one part still in development.
Clash Protocols: making communication rules machine-readable
Beyond reusable hardware components, there is another layer of reuse that is specific to how Clash works: protocols.
Chips communicate using standardized protocols: sets of rules that define which signals go where, in what order, and with what timing. AXI, for example, is a protocol originally developed by ARM that is used on virtually every smartphone chip in the world. Wishbone and Avalon are other common examples.
Traditionally, these protocols are documented in PDF files. An engineer reads the specification, interprets the rules, and implements them in code. This works, but it has a fundamental limitation: a compiler cannot read a PDF. If you make a mistake in your protocol implementation, misinterpret a timing rule or forget a handshake signal, the compiler has no way of telling you.
Clash Protocols takes a different approach. It encodes protocol definitions in Haskell, the language that Clash is built on. This means the compiler can check whether your component conforms to a given protocol. If you claim your component speaks AXI, the compiler verifies that it does.
This has two practical consequences. First, it catches protocol violations at compile time rather than during simulation or hardware testing. Second, it makes the protocol visible in the code itself. When you look at a component’s interface, you can immediately see which protocol it uses. Not because someone wrote a comment, but because the type system enforces it.
From components to composable systems
The combination of Clash Cores and Clash Protocols points toward a larger goal: making FPGA designs composable. Instead of building every project from the ground up, engineers can assemble systems from well-tested building blocks that are guaranteed to communicate correctly with each other.
This is already common practice in the software world, where package managers and standard libraries have been accelerating development for decades. In hardware design, the same idea has been slower to take hold. This is partly because of the complexity involved, and partly because the traditional hardware description languages make reuse more difficult than it needs to be.
Clash, with its roots in functional programming, is well-suited to this kind of composability. Functions that are pure, meaning they have no hidden side effects, are inherently easier to reuse. When you know exactly what a component does based on its type signature and nothing else, you can drop it into a new context with confidence.
Open source, for everyone
Both Clash Cores and Clash Protocols are open source. Anyone can use them, inspect them, and contribute to them. For QBayLogic, they are tools we use every day to deliver projects faster and with fewer defects. For the wider FPGA community, they are a growing library of components and protocol definitions that lower the barrier to working with Clash.
For our clients, the practical effect is simple: projects that use proven components rather than custom-built ones are delivered faster and contain fewer surprises. That’s a straightforward proposition and one that gets stronger with every component we add to the library.

Clash Cores and Clash Protocols: common FPGA building blocks, open source and reusable.
Frequently asked questions
What is in the Clash Cores library?
Clash Cores is an open-source collection of ready-made IP cores written in Clash. The current collection includes an SPI master and slave core, a UART component, a CRC module, an Etherbone implementation, 8b10b line encoding and decoding, SGMII PCS components for gigabit Ethernet, and wrappers around AMD FPGA primitives such as block RAM, clock domain crossing FIFOs and integrated logic analyzers. An Ethernet stack is in advanced development.
What problem do Clash Protocols solve?
Protocols such as AXI, Wishbone and Avalon are traditionally documented in PDF files, which a compiler cannot read. If you misinterpret a timing rule or forget a handshake signal, nothing warns you. Clash Protocols encodes protocol definitions in Haskell, so the compiler can verify that a component conforms to the protocol it claims to speak, catching violations at compile time instead of during simulation or hardware testing.
Why is component reuse harder in hardware than in software?
Package managers and standard libraries have been accelerating software development for decades, but the same idea has been slower to take hold in hardware design. This is partly because of the complexity involved and partly because traditional hardware description languages make reuse more difficult than it needs to be. Clash, with its roots in functional programming, suits composability well, since pure functions with no hidden side effects are inherently easier to reuse.