openhwgroup / cva6

The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
https://docs.openhwgroup.org/projects/cva6-user-manual/
Other
2.29k stars 692 forks source link

[BUG] Missed case operator range #2591

Open likeamahoney opened 2 weeks ago

likeamahoney commented 2 weeks ago

Is there an existing CVA6 bug for this?

Bug Description

Hi. We are developing a HDL static analyzer and testing it on opensource projects.

It was founded that in functions fpRegAddrToStr and regAddrToStr from instr_trace_item.svh 6-bit addr variable is passed in case inside operators. But cases only cover the range of integers from 0 to 31 (there are no handlers for integers in the range 32 to 63) and they don't have default labels.

These functions are called in the code only with 5-bit variables logic [4:0] result_regs [$];. So is this a bug or a function declaration oversight?

JeanRochCoulon commented 5 days ago

Hello @likeamahoney thanks for your feedback and your interest in cva6. This piece of code is not so much used since two years because other ways exist to trace instructions (RTL execution is compared with Spike use as reference model). We can keep this issue open for a while to see whether somebody uses this piece of code and would like to dig into the issue.