feat(cv32e40p): add CV32E40P ISS core model#146
Conversation
haugoug
left a comment
There was a problem hiding this comment.
Hi Marco,
thanks a lot for your contribution !
It seems you used co-simulation to do fine-grain comparison with RTL, can you give more details ?
|
Hi Germain! The idea is to have a full model of the cv32e40p in GVSOC, so inside the testbench, at each instruction retire of bot the RTL and the GVSOC implementation, PC, GPRs and CSRs are compared. I opened the PR since the model, GVSOC side, is stable enough. It does follow this openHW docmentaion (https://docs.openhwgroup.org/projects/cv32e40p-user-manual/en/cv32e40p_v1.8.3/intro.html). |
|
Nice thanks ! |
|
There are lots of modifications in the generic part of the ISS. Unfortunately, this ISS is still used for some old targets for which I don't have access to the tests anymore. |
c8f567e to
c03a77f
Compare
Branch refreshed — ready for review @haugougThe branch has been refactored and force-pushed. Head is now Commit history (linear, cleaned)Each commit is atomic, has a focused subject, and a short generic body without internal jargon. Cross-target safetyThe 4 cross-template call sites that touch shared headers ( Upstream Related PRs
Suggested merge order: this PR first, then Happy to address any feedback. |
|
Hi @haugoug I have reviewd and modified most of the files, at least I have cleaned up commetns, added a few ifguard and restructured the code a bit. There are a few part of the shared code which have been modified, but every single of them is commented and explained on how the modification of the sahred code does not affects the functionality of GVSOC. I cannot be really sure obviusly, I have build other targets with make all in GVSOC to check if nothing else was having problems, and it looked like it. But let me know if i can do other checks that you know to validate that this PR does not break anything! |
|
Unfortunately I don't have access anymore to part of the tests, so I just prefer to have zero modification in the generic. There are still modifications, can you guard them as well ? |
Add a CV32E40P core model implemented as subclasses of the generic ISS (Csr, Core, Irq, Exception): M-mode-only privilege handling, the CV32E40P CSR map (mtvec/mstatus/mcause write masks, hwloop and trigger CSRs), RTL-accurate IRQ timing, and the CoreV v2 ISA generator description. All files compile only when CONFIG_GVSOC_ISS_CV32E40P is set.
Restructure the CoreV (Xpulp) ISA header for the CV32E40P v2 encodings: hwloop immediate targets use word offsets, and p.* label aliases map to the canonical handlers per the isa_gen naming scheme. This header has no in-tree consumer on master; its only user is the CV32E40P core model.
Hook the CV32E40P subclasses into the shared ISS sources. Every change in the shared files sits inside CONFIG_GVSOC_ISS_CV32E40P (declaration of the subclass hook points, CV32E40P CSR registration, IRQ timing check); with the config unset the sources are identical to master, so other targets are unaffected.
c03a77f to
2221697
Compare
|
memory_config.hpp was an unused leftover, it's gone. All the CV32E40P changes |
Summary
Add CV32E40P (PULP RI5CY) core model to the GVSOC ISS, enabling cycle-accurate simulation and DPI co-simulation with the CV32E40P UVM testbench.
What's included
models/cpu/iss/include/cores/cv32e40p/): CSR subclassing, IRQ handling, exception model, privilege mode, register file — all behind#ifdef CONFIG_GVSOC_ISS_CV32E40Pguardscorev.hpp): PULP custom instructions (hardware loops, post-increment load/store, SIMD, bit manipulation) unified for both ISS v1 and v2csr_cv32e40p.cpp): Full CV32E40P CSR map with configurable write masks, reset values, and volatile flags driven by JSON configirq_cv32e40p.cpp): PULP-style fast interrupt handling with 16 local interruptscv32e40p_exit_device.cpp): Memory-mapped exit device for standalone simulationBase class extensions (non-breaking)
Small extensions to
csr.hpp,exception.hpp,irq_riscv.hpp,exec_inorder.cppto support core-specific subclassing. All changes are backward-compatible — existing cores (snitch, ri5ky, ara) are unaffected.Validation
make build TARGETS=rv64passes without regressionsRelated PRs