journal 2026-04-28

P08 — macro integration, bringing up a real OpenRAM SRAM

p08

P07’s tiny SoC, with the 16-byte flop RAM swapped for a real sky130 OpenRAM SRAM macro (sky130_sram_1kbyte_1rw1r_8x1024_8, 455 × 446 µm, 1024 × 8 bits). First time the ladder integrates anything that isn’t synthesizable RTL — a hard-IP block the place-and-route flow has to abut against, route power around, and treat as opaque.

What happened

Status: rtl-pass. Three programs verified under iverilog (SRAM round-trip, UART TX of “Hi”, GPIO write/read), demo runs the P07 echo loop unchanged. The harden flow needed several config rounds before it would even start cleanly; landing a clean signoff is still outstanding.

The four delta-from-P07 changes:

  1. RAM module replaced by sram_wrapper that instantiates the macro. Sync-read macro means the CPU FSM gained a new S_MEMWAIT stage between EXECUTE and WB on LD.
  2. Address decoder remapped because the macro is 1 KB not 16 B: 0x00..0x7F RAM, 0x80..0x82 UART, 0xC0..0xC1 GPIO.
  3. Sim/synth model split. OpenRAM ships a .v model but iverilog can’t schedule its dout0 <= #DELAY mem[] read. Synthesis gets the upstream model; sim gets a port-compatible stub at test/sram_model.v. Same fork pattern other sky130 educational projects use (raulbehl’s cocotb harness, Cornell ECE 5745 Tut 8).
  4. librelane config uses the MACROS schema (gds, lef, nl, lib, instances, fixed location) and VDD_NETS=vccd1 to match the macro’s Caravel-style power pins.

The macro-aware flow surfaced things the standard-cell-only ladder never had to think about:

The page got rewritten from a single big RTL block to four focused sections — one per delta — each with a focused <Source> snippet and per-line annotations. It reads much better.

Receipts

Project page: /projects/08_macro_integration/.