Recover an instruction path from a synchronization packet, a program listing and interleaved trace bytes.
Hardware context: Trace funnel and circular sink. Postmortem instruction history
Your capture starts with a full program offset. After that, source zero sends one decision per conditional branch. Reconstruct executed offsets in bytes. All offsets and exercise packet values below are decimal.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Offset | Program at that offset |
|---|---|
| 16 | Ordinary instruction. Continue at 20. |
| 20 | Conditional branch to 36. Fall through to 24. |
| 24 | Stop. |
| 36 | Ordinary instruction. Continue at 40. |
| 40 | Conditional branch back to 36. Fall through to 44. |
| 44 | Jump directly to 60. |
| 60 | Stop. |
The sink starts empty. Each tuple is (source ID, byte, ready). Count edges from zero. All offers are valid. IDs here are local source numbers. Source zero starts with sync offset 16. Its later bytes are outcomes: one means taken, zero means fall through. Source one carries device events.
(0,16,1) (1,0,1) (0,1,0) (0,1,1)
(0,1,1) (1,1,1) (0,0,1)
| Entry | Your decision |
|---|---|
| START | Starting offset? |
| FIRST_TEST | Offset of the first conditional? |
| FIRST_DEST | Offset immediately after that branch? |
| SECOND_TEST | Offset of the next conditional? |
| LOOP_DEST | Destination after the second outcome? |
| EXIT_DEST | Destination after the third outcome? |
| STOP | Final offset? |
| RETIRED | Total executed instructions including stop? |
| OUTCOMES | How many outcome bytes were consumed? |
| FLUSH_ACK | A flush starts at edge 2, with both taken outcomes already queued. All later packets are generated afterward. Sample acknowledgement one edge after the last pre-request packet transfers. At which edge is acknowledgement first sampled? |
| OLDEST_EDGE | A four-entry circular sink retains the last four accepted packets. Which edge supplied the oldest survivor? |
| TOTAL_RETIRED | Insert EXTRA_LOOPS more taken back edges before the final zero. How many instructions execute including stop? |
Examples
Example 1
START- Input
Starting offset?
- Output
matches = 1
The sync packet supplies 16.
Example 2
FIRST TEST- Input
Offset of the first conditional?
- Output
matches = 1
Execution advances from 16 to 20.
Example 3
FIRST DEST- Input
Offset immediately after that branch?
- Output
matches = 1
The first accepted source-zero outcome takes the branch.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For TOTAL_RETIRED, enter a constant expression using EXTRA_LOOPS. Only this entry changes with the parameter. The supported integer range is 0 through 4, inclusive.
Hints
Hint 1
Mark each accepted source-zero packet.
Hint 2
Move through the listing until a conditional needs its outcome.
Hint 3
Count every visit, including repeated offsets and the stop.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
12 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 3 problems on this path