S6.6.2 The Jump into Empty Memory

MediumDebug20 minIcarus Verilog · serverReview the topic

An instruction fetch reaches SRAM before its image arrives. Diagnose the boot manager’s handover decision.

Hardware context: Boot ROM and SRAM handover. Cold-start diagnosis

Eight words make one boot image. The copy monitor marks each completed SRAM write in written. Transfers may finish out of order. The bus model offers dispatch whenever it wants the manager to consider a jump.

Find the first wrong fetch_ram sample, choose the cause, and repair the combinational handoff.

Signals in the Timeline

SignalWidthRole
sample10input of each check
Full specification

Dispatch requires flash mode, a successful copy status and every destination word present. flash_mode means ROM set the SPI port to read the image from flash. copy_ok means no error has been reported so far. It can be high before the final write.

Diagnose the Failing Run

The test below runs the buggy design. Read its log, then find where it first goes wrong in the waveform.

Log

Waveform

Click a signal at a cycle to select it. Or focus the waveform and use the arrow keys: Left and Right move one cycle, Up and Down one signal.

Step 1 · The first bad cycle and signal
Step 2 · The cause

Step 3 is optional: fix the code in the editor, then run the tests.

Examples

Example 1

Empty Destination
Input
dispatch=1, mode=1, ok=1, written=8'h00
Output
fetch_ram = 0

Flash is selected but no destination word has arrived.

Example 2

Image Present
Input
dispatch=1, mode=1, ok=1, written=8'hff
Output
fetch_ram = 1

All eight writes and the dispatch conditions are present.

Example 3

Idle
Input
dispatch=0, mode=0, ok=0, written=8'h00
Output
fetch_ram = 0

No dispatch request is pending.

Constraints and Contract

  • Drive fetch_ram high exactly while all handoff conditions hold. Otherwise stay on the ROM path. All inputs are binary.

Hints

Hint 1

Separate address validity from image readiness.

Hint 2

Identify what copy_ok actually promises.

Hint 3

Watch the last missing word.

What the grader checks: The judge observes the fetch route, loads nonce-dependent flash words into SRAM, then checks the fetched entry and the full image. The boot model stops before instruction execution.

351 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 problems on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

Empty Destination

Input
dispatch=1, mode=1, ok=1, written=8'h00
Expected output
fetch_ram = 0

Flash is selected but no destination word has arrived.

Run samples executes all 3 public checks. Check all tests runs 351 checks on the server.

Icarus Verilog · server