A blurry image of a building with a rainbow light

Imagine writing a function in a high-level, friendly language like Elixir and having it instantly transformed into a physical hardware circuit on an FPGA. For years, the world of hardware description languages (HDLs) like Verilog and VHDL has been a walled garden, requiring developers to obsess over clock cycles and registers. But Elixir HLS is changing the game by bringing functional programming to the silicon level.

Hardware Synthesis Without the Headache

Elixir HLS is a high-level synthesis tool that allows developers to define functions using a special defhls macro. Instead of manually mapping out the hardware architecture, the tool compiles these Elixir functions directly into SystemVerilog. This removes the need for developers to specify the minute, clock-by-clock behavior of the circuit, effectively treating hardware as an extension of the software stack.

The Safety Net: Dual Execution

One of the most compelling features of Elixir HLS is its approach to reliability. A function declared with defhls doesn't just exist on the FPGA; it remains executable on the CPU. The system simulates the generated circuit against the original Elixir function to ensure they produce identical results. The hardware acceleration is only utilized if the results match, providing a built-in verification layer that prevents catastrophic hardware bugs from hitting production.

A New Era for Data Flow

This isn't just a novelty; it's the evolution of a concept that has been explored in academic circles for years, particularly regarding the synthesis of data flow hardware from Elixir's Enum and Flow libraries. By leveraging Elixir's functional nature, developers can now move computationally expensive logic from the CPU to the FPGA with unprecedented ease.

Sources

Media