A read-after-write hazard: an instruction reads a register the instruction before it writes. gen_hazard decides whether this instruction hazards at all. Given that it does, the hazard lands on src_reg_0, src_reg_1 or both, and real pipelines don’t split that evenly.
A sequence constructs a fresh instr_item per instruction, so “what the previous instruction wrote” can’t live in an ordinary member that new() resets. It has to be shared by every instance.
Fix the class below.
RequirementsAmong instructions with gen_hazard set and a previous instruction
One working answer: brokenbench's own fix for this exercise. Try a few runs first.
What changes, against the code you started with:
docker run --pull always --rm -p 127.0.0.1:8787:8787 ghcr.io/adibis/brokenbench-runnerLooking for a runner on this computer…
The first start downloads about 250 MB; after that it starts in seconds and only downloads again when there's an update. Your code goes to the runner on your computer, not to chipdv.io.