A short arithmetic test ran with the model compare on, and the bench stopped it with four mismatch lines. Find the record where the chip and the model first parted, and say why they did.
This chip is a build under bring-up, with one fault in its core. The program does four steps of arithmetic and stores each result. It has no expected values of its own: only the model checks it. The bench compared every record with the model and stopped the run.
li s0, SYSCTL
la s1, out
li a0, 0x00000013
li a1, 0x00001000
step_add:
add a2, a0, a1
sw a2, 0(s1)
li a3, 4
step_sll4:
sll a4, a0, a3
sw a4, 4(s1)
li a3, 20
step_sll20:
sll a5, a0, a3
sw a5, 8(s1)
step_srl:
srl a6, a1, a3
sw a6, 12(s1)
li t1, 0x900D
sw t1, TB_STATUS(s0)
9: j 9b
out: .word 0, 0, 0, 0
The bench printed four lines. Each names the cycle, the pc, the field that differs, the chip's value (rtl) and the model's.
ISS mismatch cycle=26 pc=80000038 field=rd_wdata rtl=130 model=1300000
ISS mismatch cycle=29 pc=8000003c field=rs2_rdata rtl=130 model=1300000
ISS mismatch cycle=30 pc=80000040 field=rd_wdata rtl=100 model=0
ISS mismatch cycle=32 pc=80000044 field=rs2_rdata rtl=100 model=0
Name the first record where the chip and the model differ. Give its cycle, the field, its address (the instruction's pc) and its label, as the full specification explains. Then choose the cause.
Full specification
The table Retire Records lists every record the chip retired before the bench stopped it. Each row has its cycle, its pc, the instruction and what it changed. The label list of the form holds the program's labels. Answer with the label of the instruction, and its pc as the address.
a0 is 0x13 and a1 is 0x1000 throughout. The shift instructions take their amount from the low five bits of rs2, as the ISA says.
After the first mismatch the model holds other register values than the chip: later lines may follow from the first.
Diagnose the Failing Run
Recorded Console and Result
ISS mismatch cycle=26 pc=80000038 field=rd_wdata rtl=130 model=1300000 ISS mismatch cycle=29 pc=8000003c field=rs2_rdata rtl=130 model=1300000 ISS mismatch cycle=30 pc=80000040 field=rd_wdata rtl=100 model=0 ISS mismatch cycle=32 pc=80000044 field=rs2_rdata rtl=100 model=0 verdict=fail reason=checker status=00000002 cycles=35 retired=18 compares=18 mismatches=4 traps=0 interrupts=0 irq_software=0 irq_external=0
Retire Records
| Cycle | PC (hex) | Instruction | Architectural change |
|---|---|---|---|
| 9 | 80000000 | lui t0, 0x10004 | t0 ← 0x10004000 |
| 10 | 80000004 | addi t1, zero, 2 | t1 ← 0x00000002 |
| 12 | 80000008 | sw t1, 32(t0) | mem[0x10004020] ← 0x00000002 |
| 13 | 8000000c | lui s0, 0x10004 | s0 ← 0x10004000 |
| 14 | 80000010 | auipc s1, 0x0 | s1 ← 0x80000010 |
| 15 | 80000014 | addi s1, s1, 72 | s1 ← 0x80000058 |
| 16 | 80000018 | addi a0, zero, 19 | a0 ← 0x00000013 |
| 17 | 8000001c | lui a1, 0x1 | a1 ← 0x00001000 |
| 18 | 80000020 | add a2, a0, a1 | a2 ← 0x00001013 |
| 19 | 80000024 | sw a2, 0(s1) | mem[0x80000058] ← 0x00001013 |
| 20 | 80000028 | addi a3, zero, 4 | a3 ← 0x00000004 |
| 21 | 8000002c | sll a4, a0, a3 | a4 ← 0x00000130 |
| 24 | 80000030 | sw a4, 4(s1) | mem[0x8000005c] ← 0x00000130 |
| 25 | 80000034 | addi a3, zero, 20 | a3 ← 0x00000014 |
| 26 | 80000038 | sll a5, a0, a3 | a5 ← 0x00000130 |
| 29 | 8000003c | sw a5, 8(s1) | mem[0x80000060] ← 0x00000130 |
| 30 | 80000040 | srl a6, a1, a3 | a6 ← 0x00000100 |
| 32 | 80000044 | sw a6, 12(s1) | mem[0x80000064] ← 0x00000100 |
Given Files
Use the listing to identify the instruction in the recording.
defs.S
# defs.S: addresses and helpers of the smoke programs of ap_soc v1.5 (stage E4).
# check-soc-top.mjs puts this text in front of every program. Numbers: gen/ap_soc_regs.h.
.equ ROM, 0x00000000
.equ CLINT, 0x02000000
.equ PLIC, 0x0C000000
.equ UART, 0x10000000
.equ GPIO, 0x10001000
.equ TIMER, 0x10002000
.equ WDOG, 0x10003000
.equ SYSCTL, 0x10004000
.equ SPI, 0x10005000
.equ DMA, 0x10006000
.equ HOLE, 0x10007000
.equ PWRCTL, 0x10008000
.equ SRAM, 0x80000000
.equ TB_STATUS, 0x20
.equ TB_PUTC, 0x24
.equ TB_EVENT, 0x28
.equ TB_ARG, 0x2C