P43 takes the working P42 demo and turns it into a real chip. It also fixes the halt convention P42 had to work around.
Status: hardened. Directed sim PASSES at 5.10M clocks (clean halt via MMIO_HALT with
halt_code = 1, exact UART sequenceS a b c d e f g h D). LibreLane harden run also PASSES with0errors across DRC/LVS/antenna/routing/XOR,0setup/hold violations, slack6.568 ns. Halt-port logic added +66 cells.
What’s new in the RTL
P43 is the first rung past P09’s halt convention. The directed
runtimes for P09-P42 ended a test with jal x0, 0 (machine code
0x0000006f); the chip’s is_halt_loop decoder caught that
encoding and stopped fetching. P42 found the bug: gcc -O2 emits
the same encoding as the safety-net epilogue of for (;;)
functions. FreeRTOS’s prvIdleTask has one. Our chip would halt
itself the moment all real tasks went idle.
P43 replaces the convention with an MMIO halt port:
- New address
MMIO_HALT = 0x10001ff8in the platform module. - A write captures
wdatainto a 32-bithalt_coderegister and pulseshalt_strobefor one cycle. - The CPU core has a new
external_haltinput that latches the request and transitionsS_WB -> S_HALTat the next retire boundary. is_halt_loopis gone.jal x0, 0is just a normal infinite loop again.
Three small surgical edits in src/top.sv. All the surrounding
machinery - trap path, MMIO router, scheduler, FreeRTOS port -
stayed the same.
Why MMIO halt is what other people do
Other RISC-V simulation conventions:
| convention | who | shape |
|---|---|---|
tohost polling (HTIF) | Spike, Sail, riscv-arch-test | software writes to a named memory location, simulator polls |
| MMIO halt port | QEMU virt (sifive_test), most embedded sim rigs | software writes a halt code to a fixed MMIO address |
ebreak from M-mode | bare-metal sim without an RTOS | trap handler interprets ebreak as exit |
wfi with interrupts masked | low-power sim environments | idle pattern overloaded as halt |
P43 picks the MMIO halt port option for two reasons:
- The toolchain never accidentally emits a write to
0x10001ff8.jal x0, 0does not have that property. - The RTL change is small: ~10 lines of platform module and a single latched input on the CPU core.
What this validates
P43 is the first hardened ladder rung that has actually run a real RTOS image:
- FreeRTOS V11.1.0, unmodified, in 30 KiB total image
- Three application tasks plus idle
- 1 kHz tick from MMIO mtime/mtimecmp at 25 MHz core clock
- Queue-based message passing
- Clean halt via deliberate software write
P42 proved scheduler functionality on the same RTL with a software-only workaround. P43 fixes the underlying RTL issue and hardens the result.
Harden result
LibreLane flow: PASS.
| metric | P37 | P39 | P43 |
|---|---|---|---|
| Worst setup slack | 8.742 ns | 6.983 ns | 6.568 ns |
| Setup violations | 0 | 0 | 0 |
| Hold violations | 0 | 0 | 0 |
| Magic / KLayout DRC | 0 | 0 | 0 |
| LVS / antenna / routing / XOR | 0 | 0 | 0 |
max_ss_100C_1v60 slew vio | 83 | 20 | 17 |
max_ss_100C_1v60 cap vio | 8 | 3 | 2 |
| Stdcell count | 27157 | 28013 | 28079 |
| Stdcell area | 191927 um^2 | 201236 um^2 | 202500 um^2 |
| Power total | unrec | 5.00 mW | 5.35 mW |
The halt-port logic added 66 cells / 1264 um^2 over P39. Slow-corner DRV continued to improve - the new halt-port flops shifted placement enough to relax two more slew offenders relative to P39.
What just happened?
The FreeRTOS arc closes here. We have a hardened RV32IM + Zicsr + Zifencei + Zicntr core with a working MMIO halt port and a real RTOS demo running on it - all on sky130A.
P43 is also the first rung where we changed RTL because real software found a real bug. The P42 idle-hook workaround was the symptom; the halt sentinel collision was the disease. The journal records both.
What’s next is open. The roadmap had P43 as the end of the FreeRTOS arc; beyond it the options diverge:
- broaden ISA (atomics, compressed)
- pipeline the core for real speed (the speed-push experiment named the divider OR-tree as the bottleneck)
- build out a richer FreeRTOS-on-this-chip software story (more demos, real peripherals, a SPI-flash boot path)
All real options. None inside P43.