Expand description
SystemVerilog emitter for SC IR graphs.
Produces synthesizable RTL that instantiates modules from hdl/.
Generated module interface:
- Clock:
clk - Reset:
rst_n(active-low) - One port per
sc.input/sc.outputoperation - Internal wiring for all intermediate values
ConstantsΒ§
- ATTN_
DATA_ πWIDTH - ATTN_
FRACTION π - GRAPH_
DATA_ πWIDTH - GRAPH_
FRACTION π - KURAMOTO_
DATA_ πWIDTH - KURAMOTO_
FRACTION π - KURAMOTO_
LUT_ πSIZE
FunctionsΒ§
- attn_
fixed π - Quantise a real value into the signed Q8.16 attention datapath, rejecting out-of-range constants.
- const_
f64_ πvec - Resolve a constant vector operand to its
f64values, if present. - emit
- Emit a synthesizable SystemVerilog module from an SC graph.
- emit_
concat_ πu32 - emit_
constant π - emit_
dense_ πfold_ plan_ comment - emit_
graph_ πforward - Instantiate the fixed-point
sc_graph_forwardcore for a single graph aggregation. - emit_
kuramoto_ πstep - Instantiate the fixed-point
sc_kuramoto_stepcore for a single Kuramoto IR step. - emit_
ram_ πstyle_ attribute - emit_
softmax_ πattention - Instantiate the fixed-point
sc_softmax_attentioncore for a single attention op. - emit_
systemverilog_ with_ target - Emit a synthesizable SystemVerilog module and a resource estimate for a target.
- emit_
target_ πdsp_ attribute - find_
value_ πwidth - graph_
fixed π - Quantise a real value into the signed Q8.16 graph datapath, rejecting out-of-range constants.
- kuramoto_
fixed π - Quantise a real value into the signed Q8.16 Kuramoto datapath, rejecting out-of-range constants.
- kuramoto_
half_ πphase_ modulus - Q(FRACTION) representation of the
pihalf-phase modulus. - kuramoto_
osc_ πcount - Infer the oscillator count from the phase operandβs vector length.
- kuramoto_
phase_ πmodulus - Q(FRACTION) representation of the
2*piphase modulus. - pack_
q_ πbus - Pack signed Q(FRACTION) words of
widthbits into a Verilog concatenation with element 0 at the LSB. - q_fixed π
- Quantise a finite real into signed Q(
frac) ofwidthbits, orNonewhen the value is non-finite or falls outside the representable twoβs-complement range. - signed_
q_ πliteral - Format a signed fixed-point value as a Verilog literal (sign outside the sized base).
- softmax_
attention_ πshape - Infer the
(q_rows, k_rows, v_cols)attention shape from the constant operand lengths anddim_k, orNonewhen the operands are non-constant or ill-shaped. - type_
to_ πwidth - value_
to_ πwire