Skip to content

ebu: reset the IFU's AHB fetch buffer - #1968

Merged
rosethompson merged 1 commit into
openhwfoundation:mainfrom
davidharrishmc:dh/ahb-fetchbuffer-reset
Oct 16, 2026
Merged

rosethompson merged 1 commit into
openhwfoundation:mainfrom
davidharrishmc:dh/ahb-fetchbuffer-reset

Conversation

@davidharrishmc

Copy link
Copy Markdown
Contributor

The IFU's spill logic decodes the fetched instruction's low bits even on a fetch that faults before reaching the bus, taking the data from the AHB fetch buffer. rv32imc fetches everything from the IROM, so that buffer is never written and stays X in 4-state simulation: riscv-arch-test's ExceptionsSm jump to the nonexistent halfword-aligned address 0x2 drove X into SelSpillNextF and the next PC, and Questa and VCS hung where Verilator, which starts flops at 0, took the access fault. Hardware traps correctly whatever the buffer holds, so only the IFU's buffer gets a reset. With #1962 this leaves the nightly regression of #1963 with no known failures.

🤖 Generated with Claude Code

The spill logic decodes the fetched instruction's low bits
(EarlyCompressedF) even on a fetch that faults before reaching the bus,
and then takes its data from the bus fetch buffer.  rv32imc fetches
everything from the IROM, so that buffer is never written and stays X
in 4-state simulation.  A jump to a nonexistent halfword-aligned address
(riscv-arch-test ExceptionsSm cp_misaligned_priority_fetch_misaligned_
nonexistent, jalr to 0x2) then drove X into SelSpillNextF and the next
PC, and Questa and VCS hung where Verilator, which starts flops at 0,
took the access fault.  Hardware traps correctly whatever the buffer
holds, so this resets only the IFU's buffer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: David Harris <David_Harris@hmc.edu>
@davidharrishmc

Copy link
Copy Markdown
Contributor Author

Merge order: merge together with #1982. Both close the X / first-half-fault spill hole on the IFU side. #1982 likely stops the rv32imc hang reproducing on its own, which makes this the defense-in-depth half. Merge both.

🤖 Generated with Claude Code

@rosethompson

Copy link
Copy Markdown
Contributor

Should both the LSU and IFU reset FetchBuffer?

@davidharrishmc

Copy link
Copy Markdown
Contributor Author

Should both the LSU and IFU reset FetchBuffer?

No. The LSU's buffer only carries data: load data, uncached AMO operands, and PTEs in the no-D$ derivatives. Nothing reads it as control before a bus read fills it, and a load that faults before the bus never writes back. In the HPTW, a PTE read that takes an access fault checks HPTWFaultM before it looks at the PTE. So an X can reach the PTE register for one cycle in FAULT, and the walk ends in FAULT whatever the register holds. The IFU is different: its spill logic decodes FetchBuffer[1:0] on every fetch, including one that faulted before the bus, so an X there reaches the next PC. Resetting the LSU copy would add XLEN reset flops to the no-D$ configs and change nothing. The cached interfaces fill their buffer on the first line fill, and no config pairs an IROM with an I$.

@rosethompson
rosethompson merged commit 5ec0a16 into openhwfoundation:main Oct 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants