Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verilator compile fails when compiling with the RV32E parameter set #39

Closed
ColinDBates opened this issue Jul 16, 2024 · 6 comments
Closed

Comments

@ColinDBates
Copy link

Observed Behavior

As the attached log file shows, fusesoc.log, Verilator compile of the Cheri Ibex fails if the RV32E parameter is set.

Expected Behavior

RV32E enables 16x GP registers, which matches the CHERIoT spec. Without the RV32E option there are 16x redundant GP registers implemented.

The attached patch, ibex_cheri_rv32e.patch.txt, fixes the compile issue for me and has been lightly tested. The patch also propagates the RV32E parameter through the top_tracing module.

Steps to reproduce the issue

I'm using the Sonata System project.

My Environment

EDA tool and version:
Verilator 5.023 devel rev v5.020-200-g88831ca21

Operating system:
Ubuntu 20.04

Version of the Ibex source code:
Sonata main with RV32E parameter set at the ibex_top level

@marnovandermaas
Copy link
Contributor

Thanks for the patch, definitely useful to fix this lint issues.

@kliuMsft
Copy link
Contributor

Please try a2f2976. Verilator compilation works for me on this commit.

@ColinDBates
Copy link
Author

Hi Kunyan,

It looks like you might have some missing lint checks in Verilator. In particular, I'm seeing a lot of WIDTHEXPAND and WIDTHTRUNC errors in the cheri_trvk_stage module.
image

I've currently got the following Verilator command line (which has a lot less tough lint optioning as compared with the Sonata project)
verilator -f lowrisc_sonata_system_0.vc -DDISABLE_PRIM_CDC_RAND_DELAY --trace --trace-fst --trace-structs --trace-params --trace-max-array 1024 --notiming -CFLAGS "-Wall -DVM_TRACE_FMT_FST -DTOPLEVEL_NAME=top_verilator" -LDFLAGS "-pthread -lutil -lelf" -Wall -Wno-UNOPTFLAT -Wno-GENUNNAMED -Wno-STMTDLY -Wwarn-IMPERFECTSCH -Wno-ASSIGNDLY -Wno-UNUSEDSIGNAL +define+RVFI --unroll-count 72 -j 4

Cheers

@ColinDBates
Copy link
Author

Or, maybe, you are not setting RV32E parameter in your compile?

@kliuMsft
Copy link
Contributor

kliuMsft commented Jul 24, 2024

I did set RV32E, but my verilator setting probably is different from yours. I can't say I fully agree with verilator's lint rules.. however, the index width complaints probably should be fixed (even though they aren't real RTL issues since the cheriot_ibex design guarantee all regfile addresses <=16 when cheri_pmode=1). I can look into that.

@kliuMsft
Copy link
Contributor

Please take at the latest commit 3f0ec86. Basically,

  1. RV32E is now a top-level parameter at ibexc_top_tracing level.
  2. In ibexc_top, NCAPS now fixed to 16.
  3. I took a closer look at the verilator warnings. Currently, I have -Wno-WIDTH and -Wno-UNOPTFLAT in my setup. Basically I am not convinced that the verilator WIDTH warnings provides much value and OPTFLAT warnings keep declaring false combinatorial loops. So I would recommend keeping those 2 warnings turned off.

@kliuMsft kliuMsft closed this as completed Aug 5, 2024
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

No branches or pull requests

3 participants