Skip to content

Conversation

@Timmmm
Copy link

@Timmmm Timmmm commented Nov 28, 2025

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!

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.
@Razer6
Copy link
Member

Razer6 commented Nov 28, 2025

cc @SamuelRiedel

Copy link
Contributor

@SamuelRiedel SamuelRiedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this. I fully support using a standardized format, even if it's a very early-stage standard.

The implementation as it is already looks good to me. The linter has a few nits, and I also noticed that loads are currently reported on every memory transaction, so also on stores, but that is not an issue of your trace implementation, but of how we create the rvfi signal. I will push a fix shortly. This actually shows why such a format can be nice, because load information is also polluting the store instruction traces in the current trace, which I just never even noticed until now.

I will also check out the related issues. I see that this is still a draft with multiple TODO comments, but IMO we can also merge this sooner rather than later if the standardization takes a bit, and then update, for example, the memory transaction format once it's fixed.

@cfrantz
Copy link

cfrantz commented Dec 1, 2025

This looks neat and easier to deal with than the current regex monstrosity that I'm using to examine the current trace format.

@Timmmm
Copy link
Author

Timmmm commented Dec 1, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants