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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Run | Last cycle | First mismatch line | Memory image equal to the model's |
|---|---|---|---|
| shift kernel, 1,200 rounds | 1004426 | ISS mismatch cycle=34 pc=8000002c field=rd_wdata rtl=1e3779b9 model=78dde6e4 | no |
| byte kernel, 1,200 rounds | 1388426 | ISS mismatch cycle=24 pc=80000038 field=rd_wdata rtl=ffdaa674 model=daa674 | yes |
| shift kernel, 4 rounds | 3374 | no: 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.
| Code | What the report names |
|---|---|
| 1 | An instruction: its pc, its record and its field |
| 2 | A word of memory and its value |
| 3 | Nothing |
| Entry | Your decision |
|---|---|
| STEP_SHIFT | The cycle at which the step compare reported the shift bug. |
| MEM_SHIFT | The cycle at which the memory compare could report it: the end of the run. |
| LATE | How many cycles later the memory compare reported it. |
| MEM_BYTES | The cycle at which the memory compare reported the byte bug (0: never). |
| STEP_NAMES | What the step compare's report names. |
| MEM_NAMES | What the memory compare's report names. |
| RECORDS | Records the step compare checks in the good chip's run of 1,200 rounds (one per retired instruction). |
| CYCLES_ROUND | Cycles a round of the shift kernel takes. |
| MEM_AT | The 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