168 Kraken IO Subprocessor

168 : Kraken IO Subprocessor

Design render

How it works

Kraken IO Subprocessor (mini) is a two-tile, RP2040-PIO-compatible programmable I/O block for Tiny Tapeout. It runs short programs compiled with pioasm and is meant for bit-banged protocols (UART, SPI, WS2812, and similar) without tying up a host CPU.

The design contains:

  • One PIO state machine with an 8-word instruction memory (IMEM), 2-bit GPIO (uo[1:0]), TX/RX shift registers, and depth-2 TX/RX FIFOs.
  • A pin loader for programming IMEM and SM configuration without a system bus. Set uio[7]=1 to enter config mode; set uio[7]=0 for run mode.
  • A runtime clock divider so the SM can run slower than the chip clock.

Instruction encoding and opcodes match the RP2040 PIO (JMP, WAIT, IN, OUT, PUSH/PULL, MOV, IRQ, SET). The SM fetches from IMEM, executes one instruction per enabled clock (after optional delay cycles), drives the two GPIO outputs, and can shift data to/from the host through the FIFO interface.

Pin loader (config mode, uio[7]=1)

Pulse uio[0] (rising edge) to apply the operation, with payload bytes on ui[7:0]:

Encoding Operation Details
uio[6]=0 IMEM write uio[4:2] = address (8 words), uio[1] = half, uio[0] = strobe. Low byte on first strobe (half=0), high byte on second (half=1). Latch addr/half while strobe=0.
uio[6]=1 Other ops uio[5:3] = op code, uio[0] = strobe
uio[5:3] Operation ui[7:0] meaning
1 EXEC wrap ui[3:0] = wrap bottom, ui[7:4] = wrap top (low 3 bits used)
2 PIN config Set/out/sideset counts, side-set enable, side-set pindir
3 CLKDIV low Low byte of 16-bit divider
4 CLKDIV high High byte of 16-bit divider
5 SHIFT Input/output shift direction, autopush, autopull
6 THRESH Push/pull bit thresholds
7 INPIN Input base pin and jump pin

Run mode (uio[7]=0)

Pin Role
ui[1:0] GPIO inputs to the SM
ui[7:0] TX FIFO data (e.g. UART TX bytes)
uio[0] tx_push — rising edge pushes ui[7:0] when FIFO not full
uio[1] sm_enable (with ena) — SM runs when high
uio[2] sm_restart — rising edge clears SM and FIFOs
uio[3] rx_pop — rising edge pops RX FIFO into a host-visible latch
uio[4] RX hold acknowledge — clears latched RX byte on uo_out
uo[1:0] PIO GPIO outputs
uo[2] tx_full
uo[3] rx_empty
uo[7:4] IRQ flags (when no latched RX byte)
uo[7:0] Latched RX byte (after rx_pop, until uio[4] ack)

How to test

RTL simulation

From the test/ directory (requires pioasm on PATH, or macOS pico-sdk-tools):

make assemble   # hello_world.pio → generated/hello_world.hex
make -B         # cocotb: pin-load IMEM, enable SM, check uo[0] square wave

The default test loads a two-instruction SET-pin square wave through config mode (uio[7]=1), then enables the SM in run mode and checks uo[0] toggles 1,1,0,0,....

On silicon (Tiny Tapeout IHP demo board)

  1. Select this design on the chip multiplexer (reset sel_rst_n, pulse sel_inc to your project address).
  2. Hold reset (rst_n low), then release.
  3. Program the SM in config mode (uio[7]=1): write IMEM words, set wrap/clock divider/shift thresholds, then leave config mode (uio[7]=0).
  4. Run: drive uio[1]=1 (sm_enable). Pulse uio[2] once if you need a clean restart.
  5. UART TX example: load a standard 8N1 UART TX pioasm program with wrap covering your program range, set clkdiv for your baud rate, then for each byte place it on ui[7:0] and pulse uio[0]. Watch uo[2] (tx_full) before pushing; serial data appears on uo[0] (or whichever OUT pin your program uses).
  6. UART RX example: connect the incoming serial line to the GPIO input used by your program (ui[0] or ui[1]). When data arrives, pulse uio[3] to latch a received byte on uo[7:0], read it from the host, then pulse uio[4] to release the latch. Check uo[3] (rx_empty) before popping.

Monitor uo[7:4] for IRQ flags if your program uses irq instructions.

Gate-level simulation (after hardening): copy the generated netlist to test/gate_level_netlist.v and run make -B GATES=yes.

External hardware

  • Tiny Tapeout IHP demo / breakout board and a 3.3 V host microcontroller (RP2040, Arduino, ESP32, etc.) to select the design, bit-bang the config loader, and drive run-mode control pins.
  • For UART: a USB–serial adapter or logic analyzer on the PIO TX output (uo[0] or uo[1], depending on your program). For RX testing, tie the adapter’s TX to the PIO input pin, or loop TX back to RX on the breadboard.
  • Optional: LEDs or a scope on uo[1:0] to visualize bit-banged waveforms (WS2812, SPI, etc.).

No PMOD or dedicated daughterboard is required; all control and data paths use the standard Tiny Tapeout ui / uo / uio pins.

IO

#InputOutputBidirectional
0gpio_in (also LSBs of TX byte when pushing) / TX byte for UART programsPIO GPIO outtx_push (rising edge)
1gpio_in (also LSBs of TX byte when pushing) / TX byte for UART programsPIO GPIO outsm_enable (level, with ena)
2TX byte for UART programstx_fullsm_restart (rising edge)
3TX byte for UART programsrx_emptyrx_pop (rising edge)
4TX byte for UART programsirq_flags[3:0] (or full uo[7:0]=rx byte when rx_hold_valid)rx_hold ack (clear latched RX byte on uo)
5TX byte for UART programsirq_flags[3:0] (or full uo[7:0]=rx byte when rx_hold_valid)config-mode select
6TX byte for UART programsirq_flags[3:0] (or full uo[7:0]=rx byte when rx_hold_valid)config-mode select
7TX byte for UART programsirq_flags[3:0] (or full uo[7:0]=rx byte when rx_hold_valid)config-mode select

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_ieee_LDO (LDO) tt_um_chip_ieee_analog (IEEE Bandgap Reference) tt_um_snn_voice_calculator_mauro_ciccone (snn-voice-calculator) tt_um_hx2003_delay (4 Channel - 32 Tap Programmable Delay with Delay Locked Loop Calibration) tt_um_adxl362_test (tt_um_adxl362_test) tt_um_larsnit_cfar (1D CA/GO/SO CFAR radar detector) tt_um_abeccari_swsynth (Sine Wave Synthesizer) tt_um_dpi_adexp (AdExp DPI Neuron ) tt_um_140oo041_fpu130 (FPU-130) tt_um_blonghi_uart (uart) tt_um_directsgg_mini_proceo_8bit (Mini 8-bit Processor) tt_um_umaece1982_lfsr (Low-Power LFSR-Based Test Pattern Generator) tt_um_deploy_timer (launch deployment timer) tt_um_urish_simon (Simon Says memory game) tt_um_nimelli_kinematic_wave_engine (Kinematic Wave Engine) tt_um_multi_seg_monitor (Multi Segment Monitor) tt_um_UART_TX (project) tt_um_crc8_lfsr (CRC-8 Serial LFSR) tt_um_tinynpu4 (TinyNPU4) tt_um_alu_bns (6-bit multi function ALU ( eldawly_V2) ) tt_um_echoworld424_tpv (Timing-Prediction Test Vehicle) tt_um_gyro_lockin (Laser Gyro Lock-in Readout Core) tt_um_josue_olivos_sar_adc (4-Bit Charge-Redistribution SAR ADC Controller) tt_um_flower (VGA Flower) tt_um_vperumal_l1_fabric (Scalable Banked L1 Memory Fabric for Edge AI) tt_um_preinception_top (Preinception: Simple Compute Accelerator) tt_um_italu (iTALU: Interactive Testable Arithmetic Logic Unit) tt_um_neuron (4-Input Signed Neuron / Perceptron) tt_um_4tap_mac (4-Tap Signed MAC Unit) tt_um_mac_engine (DSP MAC Engine) tt_um_crypto_led_demo (QAMER CryptoUART: Encrypted UART with LED Status) tt_um_layernorm (LayerNorm) tt_um_ez130_8t_mystery (EZ130 8T Mystery Circuit) tt_um_sent2spi (SENT Receiver with SPI Interface) tt_um_llr_hepiarisc (Hepiarisc with SPI flash) tt_um_rebeccargb_vga_pride (VGA Pride) tt_um_hasi_ising (Oscillator Ising Machine) tt_um_c061618g2 (Circuitli C061618G2) tt_um_tiny_dram_pim (Tiny Dual-Channel DRAM-PIM Controller + PU) tt_um_Tbilisi_CORDIC_Engine (Tbilisi CORDIC Engine) tt_um_rahulmascarenhas_folded_nn (Frozen ternary backbone + loadable head) tt_um_miniMAC (miniMAC_IHP26b) tt_um_rumcajs (IEEE DOORSH) tt_um_sg13g2_mystery (SG13G2 Mystery Circuit) tt_um_ULSR88 (ULSR demo) tt_um_ez130_7t_mystery (EZ130 7T Mystery Circuit) tt_um_tinyopt4 (ieee_tt_tinyopt4) tt_um_vga_example (IEEE VGA Animated Beach) tt_um_hyphen133_drone_detection (IEEE Acoustic Drone Detector) tt_um_nuatlabs_fifo_pwm (Async FIFO with CDC + PWM Peripheral) tt_um_nuatlabs_uart (8N1 UART Transceiver) tt_um_eeg_threshold_detector (IEEE Digital EEG Threshold Event Detector) tt_um_smart_traffic (Smart Traffic Light Controller) tt_um_94442024_mini_cpu (Mini 8-bit Accumulator CPU) tt_um_wokwi_475369131246576641 (IEEE_UPB_TT_1) tt_um_aion (AION) tt_um_rebeccargb_hardware_utf8 (Hardware UTF Encoder/Decoder) tt_um_rebeccargb_universal_decoder (Universal Binary to Segment Decoder) tt_um_rebeccargb_intercal_alu (INTERCAL ALU) tt_um_flappy_bird (IEEE Flappy Bird VGA Game) tt_um_oryan01_alu (ALU CASS PUCV) tt_um_S4xU4 (S4xU4) tt_um_vga_ca (Space CA) tt_um_llr_simplenpu (simple SPI flash streaming NPU) tt_um_pucv_pspwm (3LFCC PS-PWM Modulator) tt_um_yuri_fpga (Tiny FPGA) tt_um_mikailgedik_inverted_inverters (Inverted inverters) tt_um_esauqch_hamming74 (Hamming(7,4) encoder/decoder (IEEE)) tt_um_hackin7_analog_experiments (TinyAnalogExperiments) tt_um_snake (snake game) tt_um_mini_kraken (Kraken IO Subprocessor) tt_um_fabien_pio (AstraPIO) tt_um_chiplab (ChipLab) tt_um_wokwi_475490677474407425 (Tiny_Divider) tt_um_c061618g2tr (Circuitli C061618G2TR) tt_um_catalinlazar_nanopio (nanoPIO) tt_um_catalinlazar_uart_spi_i2c_bridge (UART-SPI-I2C Bridge) tt_um_enzonappi_sent_i2c (SENT to I2C bridge) tt_um_kush1434_proof (Proof) tt_um_schwallsunk_signal_discriminator (Highspeed voltage discriminator) tt_um_tiarinix_ttihp_verilog_template (8-bit educational SAP-style CPU) tt_um_vga_glyph_mode (BOOTCAMP) tt_um_GiulioGirelli_packet_processor (Configurable Low-Latency Match-Action Packet Processor) tt_um_vga_tictactoe (Tic Tac Toe) tt_um_vga_dvd_player (DVD player) tt_um_clea_katseye_rain (KATSEYE) tt_um_romd_uart_hello (UART Hello World) tt_um_vga_snake (CDM PYTHON GAME) tt_um_vga_slot_machine (tt_um_vga_slot_machine) tt_um_jet_seq8b (SEQ8 Programmable Sequencer) tt_um_kibo_leak_inspect (KIBO Leak-Inspection Target Controller (VGA)) tt_um_endless_runner (Endless Runner) tt_um_omega_infinity_kaoru (OMEGA INFINITY KAORU 3D Metal Grid Processor) tt_um_nikleberg_mixer (Mixer) tt_um_lahnb_sgdma (TinyDMA: A Descriptor-Based Dual-PSRAM Memory Mover) tt_um_gstj_lockin (Digital IQ Lock-in (IEEE)) tt_um_benpayne_ps2_decoder (PS/2 Keyboard Decoder for 68k) tt_um_cass_s_ui_neuron_lif (Neurona LIF con Aprendizaje STDP Dinamico (IEEE)) tt_um_vga_glyph_mode_CDM_Matrix (CDM Matrix) tt_um_qd39l_xor_stream (Fixed-ROM XOR Stream Engine) tt_um_conv3x3 (3x3 Clock Rate Streaming Input Convolution Engine) tt_um_mc14500b_soc_extended (MC14500B Extended 1-bit Microcontroller SoC) tt_um_vga_hypno_spiral (tt_um_vga_hypno_spiral) tt_um_mattizen_morse_tree (Morse Tree LED Decoder) tt_um_CDM (Colegio de Muntinlupa DVD-like Display) tt_um_romd_uart_loader (UART SPI RAM Loader) tt_um_TscherterJunior_stapel_geraet (stapel gerät) tt_um_das2225_dna_accel (DNA_Accel) tt_um_tinysoc (TinySoC) tt_um_barrel_shifter (Barrel Shifter) tt_um_approx_mac_coprocessor (Approximate DSP: Time-Multiplexed MAC Coprocessor) tt_um_joesagents_market_split_oracle (Market-split oracle) tt_um_mgpauly1458_ringmeter (Ring oscillator frequency meter) tt_um_pettit_prism_lite (PRISM with Risc-V (TinyQV) SoC) tt_um_workshop_cpu (IEEE Workshop Simple CPU) tt_um_algofoogle_analog_junk (Simple comparator + 2 DACs analog layout in a 1x1 tile) tt_um_lkhanh_cordic (TinyQV SoC (Dual Memory Backend)) tt_um_4x4npu (4x4NPU: Dual-Lane INT4 Neural Accelerator) tt_um_abiaselli_izh_bridge_3x2 (Izhikevich event bridge (4 contexts)) tt_um_fabulous_ihp_26b (Tiny FABulous FPGA) tt_um_zanderivo_voronoi (Four-Metric VGA Nearest-Prototype Visualizer)