Elixir HLS makes FPGA circuits from functions written in Elixir: high-level synthesis (HLS).

FPGA circuits are usually written in a hardware description language such as Verilog or VHDL, register by register: which value goes into which register at which clock. This is called RTL (register transfer level). High-level synthesis generates that RTL from code in a software language: the author indicates what to compute, and the tool decides the clocks and the registers. (Related: Latest Update: How to train a newly introduced language...)

In a recent development, in Elixir HLS that language is Elixir. A function defined with defhls stays an ordinary Elixir function that runs on the CPU, and also becomes an FPGA circuit. Each circuit is simulated against its Elixir function and used only if the results match, so the Elixir function is the circuit's specification. Why it is built this way: vision. (Related: How to generate text: using different decoding methods ...)

Industry observers note that elixir HLS 0.1.0 is its first release, an early one: it synthesizes integer functions, with state, tables, memories and fixed loops, and instances joining them with streams, levels and events, in the FPGA or on the CPU; its first target is the Sipeed Tang Primer 25K with AtomVM, and its working example the FM radio (atomvm-fm-radio), whose whole demodulator runs in the FPGA. Not there yet, among others: division, floats, recursion, and of Elixir's streams what needs the whole collection.

Sources indicate that stream_kernel takes a 32-bit value, compares its low and high 16 bits as signed numbers and computes its result depending on which is larger. Given an integer, it computes on the CPU, as an Elixir function. How the same function runs as a circuit in the FPGA: On a board.

According to recent reports, A type such as u32 (unsigned, 32 bits) is the circuit's bit width. A circuit spends wiring and logic on every bit, so narrower widths make it smaller and faster. On the CPU the values are cut to the same widths, so the CPU and the circuit compute the same results.

mix ehls.compile turns each defhls function of the files into a SystemVerilog circuit and then simulates every circuit against its function; it stops at a circuit that does not match.

In a recent development, what can be written with defhls (a function, which runs both on the CPU and as a circuit) and definstance (an instance: functions placed as circuits), beside Elixir. ✗: not in Elixir HLS. Details: How Elixir HLS works, EHLS.defhls/2, EHLS.Pipeline, EHLS.Stream.

Shared state and events (definstance).

definstance places functions as circuits (or, without an FPGA, as processes on the CPU), and gives an application new things to call:.

A defhls function runs in the FPGA where a definstance places it. The simplest instance takes a value and gives a value, called like a function from the CPU; an instance can also take a stream, values one after another, and run on its own, with the data flowing from devices through the kernels without the CPU.

What comes next (what needs no board, the steps on a board): Getting started.

mix docs builds these documents and the modules' documentation (the modules above, the backends and the mix tasks) as HTML in doc/, as on HexDocs.

→ Read original article