Add RVVI-TEXT support to the tracer
Extend ibex_tracer so you can select the output format. As well as the existing one it adds support for RVVI-TEXT, which is a new machine-readable format.
This is very drafty because RVVI-TEXT is still a work in progress - see the barrage of issues I opened. Example output:
' 287' MODE 3 RET 001001ca 8082 'c.jr x1'
' 288' MODE 3 RET 001003e2 4781 'c.li x15,0' \
X 15 00000000
' 289' MODE 3 RET 001003e4 32079073 'csrrw x0,mcountinhibit,x15'
' 292' MODE 3 RET 001003e8 00000517 'auipc x10,0x0' \
X 10 001003e8
' 293' MODE 3 RET 001003ec 0c050513 'addi x10,x10,192' \
X 10 001004a8
' 295' MODE 3 RET 001003f0 3145 'c.jal 100090' \
X 1 001003f2
' 296' MODE 3 RET 00100090 00020737 'lui x14,0x20' \
X 14 00020000
' 298' MODE 3 RET 00100094 00054783 'lbu x15,0(x10)' \
X 15 00000048 \
LOAD 001004a8 00000048
' 300' MODE 3 RET 00100098 e399 'c.bnez x15,10009e'
' 302' MODE 3 RET 0010009e 0505 'c.addi x10,1' \
X 10 001004a9
' 304' MODE 3 RET 001000a0 c31c 'c.sw x15,0(x14)' \
STORE 00020000 00000048 \
LOAD 00020000 00000000
' 306' MODE 3 RET 001000a2 bfcd 'c.j 100094'
' 308' MODE 3 RET 00100094 00054783 'lbu x15,0(x10)' \
X 15 00000065 \
LOAD 001004a9 00000065
' 310' MODE 3 RET 00100098 e399 'c.bnez x15,10009e'
' 312' MODE 3 RET 0010009e 0505 'c.addi x10,1' \
X 10 001004aa
' 314' MODE 3 RET 001000a0 c31c 'c.sw x15,0(x14)' \
STORE 00020000 00000065 \
LOAD 00020000 00000000
I'm not sure why stores also report a load. That seems wrong. Also I don't think this will report interrupts correctly due to RVFI's weird trap/intr signals. I haven't tested it though.
Related: #2334
@doddssynopsys you might be interested in this!
cc @SamuelRiedel
This looks neat and easier to deal with than the current regex monstrosity that I'm using to examine the current trace format.
After having tried to write a parser for this format, I think there are a few tweaks that could make it a lot easier to parse without hurting readability. I'll get back to you guys when it's (hopefully) updated.