hn.today

Elixir HLS makes FPGA circuits from functions written in Elixir

github.com3 points0 comments
Screenshot of Elixir HLS makes FPGA circuits from functions written in Elixir

Elixir HLS is a high-level synthesis tool that turns functions written in Elixir into FPGA circuits, generating SystemVerilog rather than requiring developers to specify registers and clock-by-clock behavior in Verilog or VHDL. A function declared with `defhls` remains executable on the CPU and serves as the circuit’s specification: compilation simulates each generated circuit against that function and stops if their results differ. Developers declare integer widths and signedness explicitly; values wrap at those widths, so CPU and FPGA calculations agree while narrower circuits can use less hardware. The first release, version 0.1.0, supports integer functions with state, tables, memories, fixed loops, and stream-based composition. It does not support features such as floating-point values, division, recursion, or operations requiring an entire collection.

With `definstance`, functions can be placed as circuits or run as CPU processes when no FPGA is available. Instances accept individual values or streams, coordinate shared state and events, and connect computations directly to device interfaces such as pins, sound, and USB. This enables data to flow from sensors or other devices through FPGA kernels without continual CPU involvement, while applications can still call instances, send values, and read results from Elixir. The initial hardware target is the Sipeed Tang Primer 25K, used with AtomVM; a working FM-radio example runs its complete demodulator on the FPGA. Using the tool requires Elixir 1.18 or later, CIRCT compiler binaries, Python, and Icarus Verilog for circuit simulation.

Read on github.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.