P32 adds the RV32M multiply/divide extension.
The implementation is intentionally direct: decode OP with funct7=0000001
and compute the result in the ALU path. That covers MUL, MULH, MULHSU,
MULHU, DIV, DIVU, REM, and REMU.
Commands:
make -C projects/32_rv32im_runtime_probe/test
make -C projects/32_rv32im_runtime_probe/test act4
make -C projects/32_rv32im_runtime_probe/test act4_m
Results:
| check | result |
|---|---|
| Compiled RV32IM runtime | PASS |
Runtime UART sequence MTE | PASS |
ACT4/Sail rv32i/I | PASS=39 FAIL=0 NOT RUN=0 |
ACT4/Sail rv32i/M | PASS=8 FAIL=0 NOT RUN=0 |
| Hardening | PASS with timing cleanup left |
| Full RISC-V compliance | NOT RUN |
The first compile did pass but emitted Icarus sorry: constant selects in always_* warnings from 64-bit product slices. Rewriting those slices as
shift/truncation temporaries made the sim output quiet.
Follow-up fix: the first P32 version used single-cycle combinational divide and remainder. That passed, but it was not a credible backend shape. The divider is now a 32-cycle restoring divider; multiply stays combinational. The runtime and both ACT4 batches still pass with the multi-cycle divider.
Then we hardened that shape:
| harden check | result |
|---|---|
| Run directory | projects/32_rv32im_runtime_probe/librelane/runs/RUN_2026-05-01_12-10-27 |
| Final GDS | projects/32_rv32im_runtime_probe/librelane/runs/RUN_2026-05-01_12-10-27/final/gds/top.gds |
| Metrics | projects/32_rv32im_runtime_probe/librelane/runs/RUN_2026-05-01_12-10-27/final/metrics.json |
| Magic DRC | PASS |
| KLayout DRC | PASS |
| LVS | PASS |
| Antenna | PASS |
| Hold timing | PASS |
| Setup timing | FAIL, worst setup slack -7.798 ns |
| Max slew / max cap | FAIL, 8158 max-slew and 127 max-cap violations |
The useful result is that P32 is physically real: route DRC, Magic DRC, KLayout
DRC, antenna, and LVS all land cleanly. The less convenient result is that
RV32M is exactly where the timing bill shows up. The next cleanup pass should
pipeline or otherwise break up the multiply/high-product path, then rerun the
same ACT4 I and M batches before another harden.