
TTGF0P2 compiles the one-line Faust soft clipper softclip(x) = tanh(3x) / tanh(3) into silicon.
The flow snapshots every MLIR stage in src/20251113-120748-faust-tanh-softclip-switchcase/stages, which mirrors the pipeline below:
faust.graph ops.--faust-to-core-real-arith --configure-faust-real-arith="config=hls-driver/pipelines/tanh-softclip-8bit-config.json" tags the input domain [-1, 1] and keeps the DSP in symbolic real form.--realarith-to-fixed_pt_arith subdivides the domain into eight regions, emits Horner coefficients per region, and keeps all truncations explicit.--fixed_pt_arith-to-arith rewrites everything into arith + scf so the datapath is purely integer.--switch-to-if, --convert-scf-to-cf, and --strip-real-arith-arg-attrs sanitize control flow before Dynamatic lowers the result to handshake/RTL.The resulting RTL lives in src/faust_core.v and is wrapped by tt_um_gf0p2_faust_top, which multiplexes between an internal ramp and the external sample bus. ui_in[0] selects the source (0 = internal ramp, 1 = external data on ui_in[7:1]), and the 8-bit result appears on uo_out, ready to drive an R-2R ladder.
pip install -r test/requirements.txt).make -C test for the full Cocotb suite or make -C test sim for the Icarus-only path.test/results.xml or test/tb.vcd for pass/fail information and waveforms.The regression toggles between the internal ramp and external stimulus to ensure the Horner pipeline matches the saved MLIR snapshots.
uo[7:0] for line-level audio.ui[7:1] (MSB on ui[7]) and raise ui[0] to route it through the Faust core.uio pin unconnected; they remain inputs inside the design.The Pmod R-2R documentation: https://digilent.com/reference/pmod/pmodr2r/start
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | src_sel (0=ramp,1=external) | dac_out[0] | nc (input only) |
| 1 | ext_sample[0] | dac_out[1] | nc (input only) |
| 2 | ext_sample[1] | dac_out[2] | nc (input only) |
| 3 | ext_sample[2] | dac_out[3] | nc (input only) |
| 4 | ext_sample[3] | dac_out[4] | nc (input only) |
| 5 | ext_sample[4] | dac_out[5] | nc (input only) |
| 6 | ext_sample[5] | dac_out[6] | nc (input only) |
| 7 | ext_sample[6] (MSB) | dac_out[7] (MSB) | nc (input only) |