102 Silly-Faust

102 : Silly-Faust

Design render

How it works

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:

  1. Stage 00 – Faust frontend. Capture the canonical Faust AST with faust.graph ops.
  2. Stage 10 – Real arithmetic. --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.
  3. Stage 20 – Uniform piecewise fixed-point. --realarith-to-fixed_pt_arith subdivides the domain into eight regions, emits Horner coefficients per region, and keeps all truncations explicit.
  4. Stage 30 – FixedPointArith to Arith. --fixed_pt_arith-to-arith rewrites everything into arith + scf so the datapath is purely integer.
  5. Stage 40/50/55 – Switch normalization and CF prep. --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.

How to test

  1. Install the Python requirements (pip install -r test/requirements.txt).
  2. Run make -C test for the full Cocotb suite or make -C test sim for the Icarus-only path.
  3. Inspect 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.

External hardware

  • Attach the 8-bit Tiny Tapeout DAC (or Digilent Pmod R-2R) to uo[7:0] for line-level audio.
  • Provide an optional external 7-bit sample stream on ui[7:1] (MSB on ui[7]) and raise ui[0] to route it through the Faust core.
  • Keep every uio pin unconnected; they remain inputs inside the design.

The Pmod R-2R documentation: https://digilent.com/reference/pmod/pmodr2r/start

IO

#InputOutputBidirectional
0src_sel (0=ramp,1=external)dac_out[0]nc (input only)
1ext_sample[0]dac_out[1]nc (input only)
2ext_sample[1]dac_out[2]nc (input only)
3ext_sample[2]dac_out[3]nc (input only)
4ext_sample[3]dac_out[4]nc (input only)
5ext_sample[4]dac_out[5]nc (input only)
6ext_sample[5]dac_out[6]nc (input only)
7ext_sample[6] (MSB)dac_out[7] (MSB)nc (input only)

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_htfab_asicle2 (Asicle v2) tt_um_urish_simon (Simon Says memory game) tt_um_dlmiles_ringosc_5inv (Ring Oscillator (5 inverter)) tt_um_rejunity_vga_logo (VGA Tiny Logo) tt_um_rejunity_sn76489 (Classic 8-bit era Programmable Sound Generator SN76489) tt_um_wokwi_392873974467527681 (PILIPINAS_IC) tt_um_wokwi_442081253563458561 (PRISM 8 with TinySnake) tt_um_waferspace_vga_screensaver (Wafer.space Logo VGA Screensaver) tt_um_rejunity_z80 (Zilog Z80) tt_um_MichaelBell_tinyQV (TinyQV Risc-V SoC) tt_um_calonso88_spi_i2c_reg_bank (Register bank accessible through SPI and I2C) tt_um_htfab_caterpillar (Simon's Caterpillar) tt_um_gf0p2_faust_top (Silly-Faust) tt_um_htfab_cells (Cell mux) tt_um_zedtc1_top (Zedulo TestChip1) tt_um_essen (2x2 MAC Systolic array with DFT) tt_um_BLE_RX (SCµM-BLE-RX) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_schoeberl_wildcat (Wildcat RISC-V) tt_um_vga_clock (VGA clock) tt_um_digital_clock_example (7-Segment Digital Desk Clock) tt_um_rejunity_vga_test01 (VGA Drop (audio/visual demo)) tt_um_a1k0n_nyancat (VGA Nyan Cat) tt_um_proppy_megabytebeat (megabytebeat) tt_um_javibajocero_top (MarcoPolo) tt_um_kercrafter_leds_racer (LEDs Racer) tt_um_noritsuna_CAN_CTRL (CAN Controller for Rocket) tt_um_algofoogle_raybox_zero (raybox-zero TTGF0p2 edition) tt_um_flummer_ltc (Linear Timecode (LTC) generator) tt_um_dlmiles_bad_synchronizer (Example of Bad Synchronizer) tt_um_multi_bit_puf_wrapper (One Bit PUF) tt_um_algofoogle_vgaringosc (Ring osc on VGA) tt_um_lisa (LISA 8-Bit Microcontroller) tt_um_mmorri22_lockpick_game (Notre Dame - Lockpick Game TT Example) tt_um_simple_riscv (Simple RISC-V) tt_um_mmorri22_cse_30342 (Notre Dame - CSE 30342 - DIC - Advanced FSM Final Project Example) tt_um_zacky1972_PVTMonitorSuite (PVTMonitorSuite) tt_um_SophusAndreassen_dogbattle (Dog Battle Game) tt_um_frequency_counter (Frequency Counter SSD1306 OLED) tt_um_wokwi_445338187869298689 (WokwiPWM) tt_um_kbeckmann_flame (Flame demo) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_spi_cpu_top (Super-Simple-SPI-CPU) tt_um_urish_usb_cdc (USB CDC (Serial) Device) tt_um_htfab_vga_tester (Video mode tester) tt_um_dlmiles_ddr_throughput_test (DDR throughput and flop aperature test) tt_um_dlmiles_loopback (GF180MCU loopback tile with input skew measurement) tt_um_thezoq2_quickscope (Quickscope) tt_um_MATTHIAS_M_PAL_TOP_WRAPPER (easy PAL) tt_um_htfab_rotfpga2 (ROTFPGA v2)