Tracing - janomach/the-hardisc GitHub Wiki
Printing via syscall
If the LOGGING==0, only characters stored in the CONTROL memory location are printed to the console. This memory location is used by syscall's printf function. The following text is an output in the RTL simulator from the hello_world example:
Hello world!
Clock cycles since boot: 2250
Clock cycles since boot: 7895
Clock cycles since boot: 13891
Clock cycles since boot: 20666
Clock cycles since boot: 27491
Pipeline trace
If the LOGGING>0, the tracer will print useful debugging information from each pipeline stage. It shows the address of the fetched instruction in the transfer's address phase (FA) and data phase (FD). The ID stage shows the disassembled instruction and its ictrl value. The stages OP, EX, and MA show the instruction's ictrl value, whereas the WB also shows the address of the executed instruction and whether and what value it saves to the general purpose registers.
[ 242, 112, 0.463] FA: 1000034c | FD: 10000348 | ID: (41) sub s2, s2, a5 | OP: 41 | EX: 41 | MA: 41 | WB: 41 ~ 10000334, V 10016000 -> R 8
[ 243, 113, 0.465] FA: 10000350 | FD: 1000034c | ID: (41) srai s2, s2, 1026 | OP: 41 | EX: 41 | MA: 41 | WB: 41 ~ 10000338, V 10016000 -> R18
[ 244, 114, 0.467] FA: 10000354 | FD: 10000350 | ID: (02) beq s2, zero, pc + 32 | OP: 41 | EX: 41 | MA: 41 | WB: 41 ~ 1000033c, V 100159fc -> R15
[ 245, 115, 0.469] FA: 10000358 | FD: 10000354 | ID: (41) addi s0, s0, -1540 | OP: 02 | EX: 41 | MA: 41 | WB: 41 ~ 10000340, V 10015a00 -> R18
[ 246, 116, 0.472] FA: 1000035c | FD: 10000358 | ID: (41) li s1, 0 | OP: 41 | EX: 02 | MA: 41 | WB: 41 ~ 10000344, V 00000004 -> R18
[ 247, 117, 0.474] FA: 10000360 | FD: 1000035c | ID: (44) lw a5, 0(s0) | OP: 41 | EX: 41 | MA: 02 | WB: 41 ~ 10000348, V 00000001 -> R18
If the LOGGING>2 and fault insertion is active, you get information about where the fault is inserted.
[ 1400, 687, 0.491] FA: 1000e030 | FD: 1000e02c | ID: (04) sw ra, 1(sp) | OP: 41 | EX: 41 | MA: 04 | WB: 04 ~ 1000e018, V
[ 1401, 688, 0.491] FA: 1000e030 | FD: 1000e02c | ID: (04) no operation | OP: 04 | EX: 41 | MA: 41 | WB: 04 ~ 1000e01c, V
SEU in RF[11][ 2]
[ 1402, 689, 0.491] FA: 1000e034 | FD: 1000e030 | ID: (04) sw zero, 448(gp) | OP: 00 | EX: 04 | MA: 41 | WB: 41 ~ 1000e020, V 10015a00 -> R 8
[ 1403, 690, 0.492] FA: 1000e038 | FD: 1000e034 | ID: (42) jal pc - 0xdebe | OP: 04 | EX: 00 | MA: 04 | WB: 41 ~ 1000e024, V 00000001 -> R10
[ 1404, 691, 0.492] FA: 1000e038 | FD: 1000e034 | ID: (42) no operation | OP: 42 | EX: 04 | MA: 00 | WB: 04 ~ 1000e028, V
SEU in CSR_MSCRATCH[ 1][ 0]
[ 1405, 691, 0.492] FA: 1000e03c | FD: 1000e038 | ID: (41) li a5, -1 | OP: 00 | EX: 42 | MA: 04 | WB: 00 ~ 00000000,