|
2 | 2 | trace { |
3 | 3 | // Note: this transaction is designed to closely model the behavior |
4 | 4 | // of the existing off-the-shelf C++ test-bench (reqwalker.cpp) |
| 5 | + |
| 6 | + // Note: their Verilog DUT ignores write/read addresses, |
| 7 | + // so we only read/write from address 0 in this trace |
5 | 8 |
|
6 | | - // Initial state register is 0; o_led=0 (default case for state=0) |
| 9 | + // Initial state is 0 |
7 | 10 | read(0, 0); |
8 | 11 |
|
9 | | - // 5 idle cycles (Test-bench always sets 5 cycles before each write) |
| 12 | + // 5 idle cycles (Their TB always sets 5 idle cycles before each write) |
10 | 13 | idle(); idle(); idle(); idle(); idle(); |
11 | 14 |
|
12 | | - // Trigger the LED animation: on the accept edge, state becomes 1. |
13 | | - // o_led still shows the old case 0 (from the previous cycle) due to a 1-cycle delay. |
| 15 | + // Write 1 to the subordinate |
14 | 16 | write(0, 1); |
15 | 17 |
|
16 | 18 | // Read back `o_data` and `o_led` as the LED walks through states. |
17 | 19 | // The `read` protocol advances the state (`data`) by 1 |
18 | 20 | // and the write protocol's final step also advances state by 1 (1->2 before |
19 | 21 | // the first read). This means the first value of `data` read is 3. |
20 | | - read(0, 3); // state 2->3, o_led=case(2)=0b00_0010 |
21 | | - read(0, 5); // state 4->5, o_led=case(4)=0b00_1000 |
22 | | - read(0, 7); // state 6->7, o_led=case(6)=0b10_0000 |
23 | | - read(0, 9); // state 8->9, o_led=case(8)=0b00_1000 |
24 | | - read(0, 11); // state 10->11, o_led=case(10)=0b00_0010 |
25 | | - read(0, 0); // state 11->0, o_led=case(0)=0b00_0000 |
| 22 | + read(0, 3); // state 2->3 |
| 23 | + read(0, 5); // state 4->5 |
| 24 | + read(0, 7); // state 6->7 |
| 25 | + read(0, 9); // state 8->9 |
| 26 | + read(0, 11); // state 10->11 |
| 27 | + read(0, 0); // state 11->0 |
26 | 28 |
|
27 | 29 | // Test-bench always sets 5 idle cycles before each write |
28 | 30 | idle(); idle(); idle(); idle(); idle(); |
29 | 31 |
|
30 | | - // Second iteration of outer `for` loop in `reqwalker.cpp` |
31 | | - // (identical state machine behaviour) |
| 32 | + // Second iteration of the outer `for-loop in the `main` function |
| 33 | + // of `reqwalker.cpp` (identical state machine behaviour) |
32 | 34 | write(0, 1); |
33 | | - read(0, 3); |
34 | | - read(0, 5); |
35 | | - read(0, 7); |
36 | | - read(0, 9); |
| 35 | + read(0, 3); |
| 36 | + read(0, 5); |
| 37 | + read(0, 7); |
| 38 | + read(0, 9); |
37 | 39 | read(0, 11); |
38 | | - read(0, 0); |
| 40 | + read(0, 0); |
39 | 41 | } |
0 commit comments