No. 130 / project of 147 on the ladder

Ready/valid contract extraction

introduces — plain RTL valid/ready/fire helper; frontend/backend contract audit; top.sv refactor scaffold

harden statelast run2026-05-06
signoff
  • DRCNOT RUN
  • LVSNOT RUN
  • antennaNOT RUN

P130 starts the top.sv cleanup in the least dramatic way: it extracts the scheduler boundary into an explicit plain-RTL valid / ready / fire helper while keeping architectural execution unchanged.

checkresult
Verilator buildPASS
BusyBox shell workload reaches P130-FILE-OKPASS
Ready/valid contract counters emittedPASS
Hardened layoutNOT RUN
contract countervalue
samples64,743,639
arrival-fire cycles22,652,878
service-fire cycles22,652,811
backpressure cycles0
dual-ready cycles0
triple-ready cycles0
per-class fire counterintegermemorycontrol
arrival fires13,095,2013,246,4566,311,221
service fires13,095,2013,246,3896,311,221
metricP129P130
post-load cycles218,413,661218,446,005
shell window cycles64,498,97664,551,556
retired instructions86,239,29686,248,132
CPI2.53262.5328
S_FETCH cycles7,622,4657,620,558
S_MEM cycles27,700,81727,709,660

This is not a speedup rung. The useful part is that the new helper’s per-class fire counts agree with the older scheduler arrival/service audit and report zero backpressure. The bad news is familiar: every class still maxes at occupancy 1 and there are still zero dual-ready cycles.

That makes P130 a good first refactor boundary rather than a performance win. The next rung should move from a combinational contract helper to a small state-owning dispatch queue module, still using plain wires: *_valid, *_ready, *_fire, payload fields, and counters attached to actual handshakes.

shell phases label P130 shell workload cycles 218,446,005 cpi 2.53
  1. kernel banner to /init 116,717,215 53.6%
  2. /init to shell banner 1,089,840 0.5%
  3. shell banner to first command 35,459,327 16.3%
  4. echo command 1,649 0%
  5. uname -a 2,388,465 1.1%
  6. ls /bin /usr/share 31,839,549 14.6%
  7. cat sample file 2,664,239 1.2%
  8. touch/write/cat/rm /tmp file 11,648,215 5.4%
  9. 8x ash loop with file I/O 16,008,759 7.4%
  10. final marker 680 0%
state breakdown label P130 ready/valid workload cycles 218,446,005 cpi 2.53
  1. fetch 3.5% 7,620,558
  2. execute 39.5% 86,272,798
  3. mem 12.8% 27,988,640
  4. walker 1.2% 2,681,256
  5. writeback 39.5% 86,248,132
  6. mul/div 3.5% 7,632,905