Hardware

Hardware Implementation of the Tagma Primitive

Author
Affiliation

SSCCS Initiative

Published

August, 2026

Other Formats

Abstract

Tagma1 is a 16-bit coordinate primitive: a fixed Unicode block (U+AC00–U+D7A3) with a closed-form composition formula, three independent axes, and zero collision probability. One structural fact carries the hardware side of the series: the code is a monotone packing of the axes, so a range query over them is an addition rather than a tree search. What that buys, what it does not, and what is still missing are the subject of the first section. The primitive is substrate-independent. Its definition is one formula, and its realizations differ only in the material that evaluates it. The software realization is the reference implementation in Rust and C++ 2 3; the hardware realization is the subject of this whitepaper series: a combinational decoder with its inverse (the compose unit) and the field-wise distance unit, a gate-level synthesis flow, FPGA demos on the Upduino 3.1 (iCE40UP5K) and the iCESugar-Pro (ECP5), and a chton SRAM segment store modeled behaviorally pending the macro.

Every statement in this series is either measured or derived from the primitive’s definition, and each one says which. The decoder is verified exhaustively over all 11,172 valid code points in three independent channels (formula, Rust reference, gate netlist), and formal equivalence proves the RTL and the synthesized netlist identical over all 2^16 inputs. The measured gate count is 478 cells in the ev-compatible generic schema and 588 cells in a 2-input gate-level estimate, with 201 LUT4 plus 41 carry cells on iCE40. The demo closes the 12 MHz board clock at 16.79 MHz Fmax (59.55 ns critical path after place and route). A four-stage pipelined decoder emits one code point per clock and closes register to register at 148.77 MHz on the ECP5, and the same build reproduces the tagma_core checksum on the board at every rate up to a measured 140 MHz.

Two findings frame the series. First, the ~300 gate claim of the Tagma whitepaper holds for the naive shift-subtract decoder (206 to 232 cells), but timing closure on a 12 MHz board requires a multiply-shift structure that costs roughly 2.5x more gates. Second, the hardware is not a speedup for the N=1 dense case: the entire 11,172-entry space fits in L1 cache, which the software already exploits at 0.38 ns per access. The hardware value is energy, determinism, and physical embedding, not per-operation speed. The streaming track does not change that ranking. A pipelined decoder produces 140 million code points per second, and a full sweep of the space takes 1.92 us in the software loop against 80 us on the device, so throughput is not a hardware claim either. What the realization does offer is that the arithmetic is cheap enough for the memory to be the only variable.

1 What the hardware is

A range query over the primitive’s axes is an addition, not a tree search. That follows from the composition formula and needs no measurement: the initial axis has stride 588, the medial 28, and the final axis is the remainder. Fixing \(i\) therefore leaves 588 consecutive codes and fixing \(i\) and \(m\) leaves 28, so a prefix range is the interval \([base, base + span)\). An axis neighbourhood is a union of such runs, so it is iterated by adding a stride rather than by descending an index.

Everything else in the hardware is a consequence of that packing.

Unit Function Size
tagma_decoder 16-bit code to the three axes 478 generic cells, 388 Sky130 cells at 2826 um^2, 49 LUT4 plus 16 FF on the ECP5, 255 ICESTORM_LC on the iCE40
tagma_compose axes back to the 16-bit code two constant multiplies and one range check per axis
tagma_dist per-axis distance of two codes two decoders and three subtractors
tagma_decoder_pipe one code point per clock four stages, 148.77 MHz register to register, 3.0 pJ per decode at 12 MHz
tagma_segment_store 11,172 by 16-bit record slots 22 KB, macro pending a PDK

Which of its properties are derived and which are measured:

Property Basis
Code order is the axis order, and a prefix range is contiguous derived from the formula
A range or neighbourhood query is addition over those runs derived from the formula
The axes need not be stored beside the value, because they come back by arithmetic derived from the formula
The decoder has no memory in its path and a latency independent of the input measured: the 388 cells are standard cells with no memory macro among them, and the pipeline’s path is four registers
It runs on a device and reproduces the reference implementation measured, at five clock rates up to 140 MHz

Two claims do not survive, and they come first so that they are not read into the rest. It is not faster, by either measure. The software reference reads a coordinate in 0.38 ns with the whole space in L1 cache against 7.14 ns per coordinate on the device, and a full sweep takes 1.92 us in software against 80 us on the device. Nor is an energy advantage measured: 3.0 pJ is the hardware’s own cost per decode, and this series contains no measurement of the software’s cost per operation, so there is a device figure and no comparison.

What the hardware is for, then, is a record layer addressed by coordinates. With records keyed by code, the key is also the sort order and the range address, so iterating an axis range is an increment and there is no separate index to store or to search. That is a claim about address arithmetic, and it is the reason the store is the interesting unit rather than the decoder.

What is missing is that store. The decoder, the compose unit and the distance unit are realized as RTL and verified end to end, and the segment store is a behavioral model of the address map whose SRAM macro waits for an OpenRAM PDK install. The structural argument above lives in the store, and the store is the part not yet on a device.

2 Scope and relation to the primitive

The hardware track does not redefine Tagma. The composition formula, the axis ranges, and the 11,172-entry space are identical to the software definition; the layer map below names the primitive once, and every other occurrence here would be a copy.

What changes is the substrate. The software realization evaluates the formula with arithmetic in Rust; the hardware realization evaluates it with logic gates. The two must agree on every input, and the verification pipeline in this series enforces exactly that. The layer map is shown in Figure Figure 1.

Figure 1: Tagma scope: one primitive definition, two realization substrates.

One boundary correction is part of this work: the last valid code point is U+D7A3, not U+D7AF. The block contains exactly 11,172 code points and U+AC00 + 11,171 = U+D7A3. Inputs in U+D7A4..U+D7AF decode to an out-of-range initial axis and are structurally invalid; the tagma_core reference documents these as filler positions.

3 Realization status

The claim of this series is bounded by what is realized. The three operations of the primitive are realized as RTL and verified end to end: the decoder, the compose unit (the decoder’s inverse), and the distance unit. The gate-level netlist simulation and the formal-equivalence check cover all three.

A separate realization is on a device rather than in gates: the record layer addressed by coordinates, over a flash partition on an ESP32-S3, with no operating system under the engine. It exercises the software stack and the medium, not the RTL decoder, and it is reported as the minimum-class device run.

The physical demonstration runs on the iCESugar-Pro: the demo builds, the bitstream is written to configuration flash and boots, and the validity output drives the onboard RGB LED. The external switch and LED wiring that turns it into a decoder demonstration is the remaining step. The streaming design is realized further, because it needs no external wiring: its source is an internal counter, and a build accumulates a checksum over the valid range that is compared on the die with a constant derived from tagma_core, with the verdict read back over the programming cable, at every PLL rate that closes timing up to 140 MHz. A third build, tagma_volume_verify_top, answers the question a deployment asks rather than the one the primitive asks: it takes a supplied set rather than sweeping the primitive’s range, one value per valid offset, 11,172 of them, and closes a verdict on the die that turns red on a single value outside the alphabet. That one is published as a recorded run with the console beside the board. Where a result depends on an unrealized item, the document states the dependency in place.

4 Hardware reference

The realization lives under hw/ in the syntagma repository. The toolchain is open source end to end: Verilator for simulation, Yosys for synthesis, nextpnr-ice40 and icepack for the iCE40 target, icetime for its timing analysis, nextpnr-ecp5 and ecppack for the ECP5 target, and OpenRAM for the memory macro. Two boards are supported, each with its own constraint format and clock: the Upduino 3.1 (iCE40UP5K-SG48, PCF, 12 MHz) and the iCESugar-Pro (ECP5 LFE5U-25F-6BG256C, LPF, 25 MHz).

Artifact Purpose Location
tagma_decoder 3-axis combinational decoder hw/rtl/tagma_decoder.v
tagma_decoder_tb exhaustive testbench, formula and golden modes hw/rtl/tagma_decoder_tb.v
tagma_compose axis-to-index compose, the decoder inverse hw/rtl/tagma_compose.v
tagma_dist field-wise distance of two code points hw/rtl/tagma_dist.v
tagma_segment_store segment store behavioral model, 11,172 x 16-bit hw/rtl/tagma_segment_store.v
tagma_demo_top board demo, registered outputs hw/rtl/tagma_demo_top.v
tagma_decoder_pipe four-stage streaming decoder, one code point per clock hw/rtl/tagma_decoder_pipe.v
tagma_pipe_top counter-sourced streaming top, register-to-register timing hw/rtl/tagma_pipe_top.v
tagma_pipe_check_top on-device comparison of the pipeline against the reference hw/rtl/tagma_pipe_check_top.v
tagma_pipe_verify_top on-device checksum verification, verdict on a pin hw/rtl/tagma_pipe_verify_top.v
tagma_checksum.py expected checksum derived from the golden anchors hw/tools/
ecp5_pin_verify.py reads the verdict and two divided clocks over the iCELink hw/tools/
golden_anchors.hex 11,172 vectors from the Rust reference generated by make golden-export
check_golden_anchors.py consistency gate over the anchor file hw/tools/
synthesis flows generic, gate-level, iCE40 hw/synth/yosys/synth_*.ys
PnR flow bitstream and timing report hw/synth/yosys/run_pnr.sh
chton_sram.py OpenRAM configuration hw/openram/

The reference definition is the Rust tagma_core.

5 Measured results summary

The numbers below are the authoritative hardware figures for the Tagma primitive. They replace the approximate “300 gates in 28nm” phrasing in earlier software documents with measured values from the open toolchain (Yosys, nextpnr, icetime). The gate trade-off is shown in Figure Figure 2 and the clock closure in Figure Figure 3.

Metric shift-subtract (naive) multiply-shift (current)
Generic cells (ev schema) 206 478
Gate-level estimate (2-input) 232 588
iCE40 LUT4 + SB_CARRY 95 + 66 201 + 41
PnR ICESTORM_LC (UP5K) 177 255
Logic levels 72 33
Critical path 115.90 ns 59.55 ns
Fmax 8.63 MHz 16.79 MHz
Meets 12 MHz board clock no yes

The same RTL on the ECP5 device measures 49 TRELLIS_COMB and 16 TRELLIS_FF out of 24,288, 33 I/O, and 4 multipliers, with a 22.28 ns worst reported path against a 25 MHz clock. That figure is the worst cross-domain path, input to register; the design has no register-to-register path for nextpnr to constrain, so no Fmax is reported. The 59.55 ns figure above is the whole critical path icetime reports for the placed iCE40 design. The two are device results, not a speedup, and the comparison is stated that way in the FPGA document.

Pipelining changes what the tool can report at all. The streaming top takes its code from a counter, so its paths run register to register, and nextpnr-ecp5 reports a clock for the first time. The self-checking build adds the combinational reference to the same die, which is why its ceiling is lower: the reference is three multipliers deep, and it is the slower of the two.

Metric Pipeline alone Self-check build
Clock 25 MHz board oscillator 40 MHz from the 25 MHz oscillator
Fmax, register to register 148.77 MHz 56.62 MHz
Fmax, reference path not present 51.96 MHz
TRELLIS_COMB 51 187
TRELLIS_FF 72 181
MULT18X18D 2 6
Latency 4 clocks 4 clocks
Throughput 1 code point per clock 1 code point per clock

The self-check clock is 40 MHz rather than the 50 MHz the PLL also produces, because the reference path measures 19.2 ns, which leaves 7.6 percent of margin at 50 and about 30 percent at 40. The binding path in that build is the reference, not the pipeline, so the stages that raised the pipeline to 148.77 MHz did not move it.

Figure 2: Gate count by synthesis flow: shift-subtract (naive) vs multiply-shift. The shaded region is below the ~300 gate claim; the ratios mark the cost of timing closure.
Figure 3: FPGA clock frequency before and after the multiply-shift optimization. The shaded region is above the 12 MHz board clock; the margin is the headroom of the optimized version.

The demo top is also carried to layout: synthesized to SkyWater 130 nm high-density cells and placed and routed by OpenROAD at the 12 MHz constraint. The placed run covers 4,430 µm² at 34% of the core, with +72.77 ns of setup slack and 0.00 total negative slack at the constraint, and draws 36.6 µW at one code point per clock, 57.8 µW at the tool’s default activity. Both figures are the flow’s final GDS with the metal layers kept, met1 through met5 in the first, with the power grid the darkest element, and met1 through met3 in the second. The placed logic occupies part of the die and fill rows span the rest.

Figure 4: The die from above.
Figure 5: The same die without the power straps.

The verification status across all channels:

Check Result
Exhaustive RTL simulation (formula mode) PASS: all 11,172 code points
Golden anchors (Rust reference mode) PASS: all 11,172
Gate-level netlist simulation PASS: all 11,172
Formal equivalence RTL vs netlist proven, 50 cells, all 2^16 inputs
Compose, the decoder inverse (formula + golden) PASS: 32^3 axis combinations and 11,172 anchors
Distance (formula + golden) PASS: 11,172 code points against two references and a varying-operand sweep
Compose and distance equivalence proven over 2^15 axis combinations and 2^32 input pairs
Streaming pipeline PASS: 44,689 emitted triples over 4 full sweeps of the valid space, one code point per clock
On-device checksum (ECP5, 40 to 140 MHz) PASS: the sweep checksum equals the tagma_core constant at every rate that closes timing, and a wrong constant reads as a failure
On-device clock (ECP5 PLL) 40.00, 100.16, 120.10, 124.97 and 139.90 MHz measured from two independent dividers
On-device ceiling a 150 MHz build is rejected by nextpnr at 145.99 MHz, so 140 MHz is the fastest verified point

6 Verification pipeline

Every hardware artifact is checked against the Rust reference, which is the single source of truth for the primitive’s behavior. The golden exporter writes the full coordinate decomposition to a vector file; the RTL simulation and the gate-level simulation both read it; the formal equivalence check closes the loop between the RTL and the synthesized netlist. The pipeline is shown in Figure Figure 6.

Figure 6: Hardware verification pipeline. The Rust reference is the single source of truth; every simulation and the formal equivalence check re-validate against it.

The channels and the commands that produce them:

Channel Command Coverage
Formula simulation make sim all 11,172 code points
Golden anchors make sim-golden all 11,172, against the Rust reference
Gate-level netlist make gatesim all 11,172, against the same anchors
Formal equivalence make equiv all 2^16 inputs, RTL against netlist
Compose make sim-compose, make sim-compose-golden, make gatesim-compose all 32^3 axis combinations, 11,172 anchors
Distance make sim-dist, make sim-dist-golden, make gatesim-dist 11,172 code points against two references and a varying-operand sweep
Streaming make sim-pipe 4 full sweeps, 44,689 emitted triples against the combinational decoder
On-device verdict make board-verify the checksum verdict and two divided clocks, read over the iCELink from a programmed image
Compose and distance equivalence make equiv 2^15 axis combinations, 2^32 input pairs

hw/tools/check_golden_anchors.py gates the regenerated anchor file against the decomposition contract, so a stale or corrupted export fails before any simulation starts.

The pipeline runs in CI through make -C hw check in the syntagma repository, so the numbers in this series are reproducible from a clean checkout when Verilator and Yosys are installed.

7 Documents

Document Description
RTL Decode, compose, and distance: structure and the verification pipeline
Synthesis Gate counts, cell mixes, and the naive vs multiply-shift trade-off
FPGA Upduino 3.1 and iCESugar-Pro demos, place and route, timing reports
Memory chton SRAM segment store and the L1 cache analysis
Tagma whitepaper The summary this series details: the hardware section, and the verification record appendix

License

The hardware design sources documented in this series, the Verilog RTL, the synthesis and place-and-route scripts, the board and timing constraints, and the OpenRAM and OpenROAD flow, are licensed under the CERN-OHL-S v2, the strongly reciprocal variant of the CERN Open Hardware Licence version 2, which each hardware source file states as SPDX-License-Identifier: CERN-OHL-S-2.0. The full text is in hw/LICENSE in the syntagma repository. The software reference implementation under sw/ remains under the Apache License 2.0.

References

Footnotes

  1. Tagma whitepaper: docs.ssccs.org/projects/syntagma/tagma↩︎

  2. synTagma: a spatial coordinate space computing system based on the Tagma primitive. Docs, Repository: Github (Pre-release, Apache 2.0)↩︎

  3. The hardware sources live in the syntagma repository under hw/: github.com/ssccsorg/syntagma/tree/main/hw↩︎