Zen Peripherals · System & Platform Glue · brief · 2026-11-04

The SoC pin controller that handles direction, atomic drive, and per-pin interrupts

The Zen GPIO Controller is the ubiquitous general-purpose I/O block every SoC needs, delivered as a single parameterized core. It gives firmware per-pin direction, race-free atomic output set/clear/toggle, metastability-safe synchronized input, five per-pin interrupt modes, and per-pin open-drain drive — enough to run resets, straps, LEDs, buttons, and bit-banged shared-bus lines without read-modify-write hazards. Product / integrator view; every number is sourced from the as-built RTL or marked TBC with an owner.

1. The controller in one paragraph

The Zen GPIO Controller is a parameterized WIDTH-pin I/O block — 32 pins by default — that a client drops into any SoC as its pin controller. Each pin has a direction bit, a push-pull output value, and a synchronized input read back through a 2-FF synchronizer so the SoC never samples a metastable pad. Output is updated either directly or through three atomic operations — set, clear, and toggle — each landing in one bus write, so multiple agents can share a port with no read-modify-write race. Every pin also carries its own interrupt: pick one of five modes (rising, falling, both-edge, high-level, low-level), enable it, and the block folds all enabled pending pins into a single aggregated interrupt line. Any pin can be switched to open-drain for wired-OR and bit-banged shared-bus signalling. The core attaches over the common Zen peripheral bus and reaches a SoC's APB4 or AXI4-Lite map through the standard bus-fabric frontend.

32 pinsdefault width (parameterized)
SET / CLR / TGLatomic output ops, one bus write
5 modesper-pin edge + level interrupts
APB4 / AXI4-Liteattach via bus-fabric frontend
GPIO controller hostAPB4 / AXI4-Lite 2-FF input syncmetastability-safe edge / level detect5 interrupt modes padsoe / o / i interrupt ctrlirq sink registers oe / o pin in irq_o
Figure 1. The GPIO controller sits between the host bus and the external pads: the host reads and writes its registers; synchronized pad inputs feed an edge/level event detector that raises a single aggregated interrupt line to the SoC's interrupt controller.
Atomic output means no read-modify-write. Set, clear, and toggle each land in a single bus write that touches only the pins you name, so two drivers can own different bits of the same port without a lock or a lost update — the reason open-drain lines and shared status ports stay correct under concurrent firmware.
Inputs and edges carry a two-cycle synchronizer delay. Every pad input passes through a 2-FF synchronizer before it is readable or evaluated for an interrupt, so a pin change appears in the input register, and an edge is detected, two clk_i cycles after it happens at the pad. This is the metastability guard, not a defect — budget it when timing fast handshakes. Per-pin debounce is not built in.

2. What it is, at a glance

ElementDetailDefaultStatus
Pin countparameterized WIDTH32exists
Per-pin direction1 = output, 0 = inputinputexists
Output drivepush-pull output data register—exists
Atomic output opsset (W1S), clear (W1C), toggle — each one bus write—exists
Synchronized input2-FF synchronizer per pin, read-only—exists
Per-pin open-drainrelease on '1', drive low on '0'push-pullexists
Interrupt modesrising / falling / both-edge / high-level / low-level—exists
Per-pin interrupt enablegates each pin into the aggregatedisabledexists
Pending + clearper-pin pending bit, write-1-clears—exists
Aggregated interruptsingle line = OR of (pending AND enable)—exists
Register accesssingle-cycle registered handshake—exists
Host frontendAPB4 / AXI4-Lite via bus-fabric frontend—TBC
Post-synthesis fmax / timingfunctional sign-off shipped; timing closure downstreamTBCTBC

Sources: Zen GPIO product datasheet; as-built RTL.

3. How a client uses it

  1. Instantiate the core at your chosen pin WIDTH and attach it through an APB4 or AXI4-Lite bus-fabric frontend; wire the per-pin output-enable, output-value, and input triples out to your pads.
  2. Drive outputs — set direction to output, then write the output register directly, or use the atomic set / clear / toggle ops to change only the pins you name with no read-modify-write.
  3. Read inputs — leave a pin as input and read its synchronized state from the input register; the value is glitch-safe through the 2-FF synchronizer.
  4. Take interrupts — program each pin's interrupt mode, enable it, route the aggregated interrupt line to your interrupt controller, then on assertion read the pending register, service the pin, and write 1 to clear it.
  5. Share a bus line — set a pin to output with open-drain enabled: drive the output low to pull the line down, release it high for the external pull-up — the pattern for bit-banged I²C-class lines and wired-OR handshakes.

4. Verification & provenance

Sources: Zen GPIO product datasheet; as-built RTL.