V5.5.2 What Each Compare Costs

MediumImplement22 minIcarus Verilog · serverReview the topic

From recorded runs of two faulty chips, work out when each way of comparing reports a bug and what it names. Then count what the step compare checks.

Hardware context: Two core faults of ap_soc v1.5 under a step compare and an end-of-test memory compare. Pricing both methods from recorded runs.

Two kernels of lesson V5.5 ran on ap_soc v1.5, each on a chip with one core fault. The shift kernel ran on the chip whose SLL shifts right. The byte kernel ran on the chip whose SRL fills from the sign. Each ran once with the model compare on: the step compare. Each ran once with it off, its final memory then compared with the model's: the memory compare.

This worksheet uses named constants. The first three entries show how to record your decisions.

Replace each unresolved value of 4294967295 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
RunLast cycleFirst mismatch lineMemory image equal to the model's
shift kernel, 1,200 rounds1004426ISS mismatch cycle=34 pc=8000002c field=rd_wdata rtl=1e3779b9 model=78dde6e4no
byte kernel, 1,200 rounds1388426ISS mismatch cycle=24 pc=80000038 field=rd_wdata rtl=ffdaa674 model=daa674yes
shift kernel, 4 rounds3374no: 64 words differ, the first at 80000400, last written at cycle 2535

The shift kernel of 1,200 rounds ran 5 times each way on the good chip (laptop, Verilator 5.052). Every run took between 3.868 and 4.425 s, with the model compare or without: the difference is inside the spread between runs.

CodeWhat the report names
1An instruction: its pc, its record and its field
2A word of memory and its value
3Nothing
EntryYour decision
STEP_SHIFTThe cycle at which the step compare reported the shift bug.
MEM_SHIFTThe cycle at which the memory compare could report it: the end of the run.
LATEHow many cycles later the memory compare reported it.
MEM_BYTESThe cycle at which the memory compare reported the byte bug (0: never).
STEP_NAMESWhat the step compare's report names.
MEM_NAMESWhat the memory compare's report names.
RECORDSRecords the step compare checks in the good chip's run of 1,200 rounds (one per retired instruction).
CYCLES_ROUNDCycles a round of the shift kernel takes.
MEM_ATThe cycle at which the memory compare reports the shift bug for a run of ROUNDS rounds: 26 + 837 × ROUNDS.

Examples

Example 1

STEP SHIFT
Input
The cycle at which the step compare reported the shift bug.
Output
matches = 1

The first record whose value differs from the model's.

Example 2

MEM SHIFT
Input
The cycle at which the memory compare could report it: the end of the run.
Output
matches = 1

The images are compared only when the run is over.

Example 3

LATE
Input
How many cycles later the memory compare reported it.
Output
matches = 1

MEM_SHIFT minus STEP_SHIFT.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For MEM_AT, enter a constant expression using ROUNDS. Only this entry changes with the parameter. The supported integer range is 10 through 1000, inclusive.

Hints

Hint 1

Step: the first mismatch line. Memory: the last cycle.

Hint 2

An instruction against a word.

Hint 3

The step compare checks every record of every run; the memory compare costs the hunt afterwards.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

13 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

STEP SHIFT

Input
The cycle at which the step compare reported the shift bug.
Expected output
matches = 1

The first record whose value differs from the model's.

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

Icarus Verilog · server