From recorded records, work out where the core took a timer interrupt and how far behind the pin it was. Then say what each way of telling the model would do.
Hardware context: Interrupts of ap_soc v1.5 and the model: the core's snapshot in mip against the pins. Counting the skid between a pin and its record.
A program took four interrupts on ap_soc v1.5 (4 interrupt records, 298 records compared with the model, 0 mismatches). The timer's pin rose at cycle 98. The table holds the records around it. Index the rows from 0.
This worksheet uses named constants. The first three entries show how to record your decisions.
Replace each unresolved value of 65535 with your result.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Row | cycle | order | pc | instruction | mip | trap |
|---|---|---|---|---|---|---|
| 0 | 98 | 54 | 0x80000078 | addi a1, a1, 3 | 0x00000000 | 0 |
| 1 | 99 | 55 | 0x8000007c | addi t3, t3, -1 | 0x00000000 | 0 |
| 2 | 100 | 56 | 0x80000080 | bne t3, zero, 0x80000078 | 0x00000000 | 0 |
| 3 | 103 | 57 | 0x80000078 | addi a1, a1, 3 | 0x00000080 | 1 |
| 4 | 107 | 58 | 0x80000118 | csrrs t5, mcause, zero | 0x00000080 | 0 |
| 5 | 111 | 59 | 0x8000011c | addi s1, s1, 1 | 0x00000080 | 0 |
| 6 | 112 | 60 | 0x80000120 | andi t6, t5, 15 | 0x00000080 | 0 |
| Code | Method |
|---|---|
| 1 | Record method: the core writes its snapshot into each record, and the model is given that mip |
| 2 | Notify method: the bench calls the model to set its lines, from what it observes of the core |
| 3 | Neither: the model decides the lines itself |
Replayed on the instruction-level model, told one record late, the model first differs at order 16 (next_pc). Told the pins as they stood when each record retired, it differs at order 13 (next_pc).
| Entry | Your decision |
|---|---|
| FIRST_AFTER | The row of the first record after the pin rose. |
| TOOK | The row of the record that took the interrupt. |
| SKID | Records between them: TOOK minus FIRST_AFTER. |
| TOOK_CYCLE | The cycle of the record that took it. |
| LATE_ORDER | The order at which a model told one record late first differs. |
| NOTIFY_ORDER | The order at which a model told the pins at each record's retirement first differs. |
| OUR_METHOD | Which method does this chip's bench use? |
| IBEX_METHOD | Which method does the Ibex co-simulation use, by its documentation (plan §7)? |
| ROW_AFTER | The row of the first record after the pin, if the pin had risen at cycle PIN instead. |
Examples
Example 1
FIRST AFTER- Input
The row of the first record after the pin rose.
- Output
matches = 1
Its cycle is the first above 98.
Example 2
TOOK- Input
The row of the record that took the interrupt.
- Output
matches = 1
trap = 1 and its mip shows bit 7.
Example 3
SKID- Input
Records between them: TOOK minus FIRST_AFTER.
- Output
matches = 1
The core samples the lines as each instruction enters execute; the instructions already past that point retire first.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For ROW_AFTER, enter a constant expression using PIN. Only this entry changes with the parameter. The supported integer range is 97 through 106, inclusive.
Hints
Hint 1
Find the first record whose cycle is after the rise.
Hint 2
The record with trap = 1 and the line in mip.
Hint 3
The difference is what a notify method must model.
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