Repository navigation
Conversation
marnovandermaas
left a comment
There was a problem hiding this comment.
Thanks for putting this together. Some initial comments from my side.
| upstream: { | ||
| url: "https://github.com/openhwgroup/cvfpu.git", | ||
| // CVFPU submodule revision selected by the pinned CVA6 RVY core. | ||
| rev: "106251e502747f17d931a20db0bdbab9e1a6c2ff", |
There was a problem hiding this comment.
Is this revision also a branch name somewhere? The pinning itself can be done using the lock file.
There was a problem hiding this comment.
It's awkward because we really want the one in CVA6. However, I believe that is tracking an upstream branch. Is the flow to get the specific commit we need to just manually edit the lock file?
There was a problem hiding this comment.
I think this makes sense; the vendoring target by default uses the revision in the lock file, and only pulls in from the head of the branch when run with the --update flag. If I've understood it. I've done this now.
| always_ff @(posedge __clk) begin \ | ||
| if (__load) __q <= __d; \ | ||
| end |
There was a problem hiding this comment.
Can we build this using the prim flop asserts?
There was a problem hiding this comment.
I've improved this now, and it requires a patch to the veondored lowrisc_ip repo. I guess this should be implemented upstream.
There was a problem hiding this comment.
I think you've made this work without the patch now right?
There was a problem hiding this comment.
We've made the changes to the vendored-in files, and also committed the patch, so it should be that revendoring will make these changes again when they are pulled in. Maybe it is noteworthy that we needed the additional variant for cva6 + fpu, and the upstream lowrisc_ip repo might want to fold them in at some point.
9db8a90 to
c6f8609
Compare
marnovandermaas
left a comment
There was a problem hiding this comment.
Thanks for the updates, they are looking better now. The Lint is still failing. You will need to update https://github.com/lowRISC/mocha/blob/main/hw/vendor/REUSE.toml to get reuse to pass.
|
|
||
| upstream: { | ||
| url: "https://github.com/lowRISC/cva6-cheri.git", | ||
| // Mocha integration branch with RVY 0.9.10 support; revision pinned in the lock file. |
There was a problem hiding this comment.
No need for this comment.
| # RVY 0.9.10 toolchain, pinned to rvy-0910-wip (2026-10-20). | ||
| llvm_cheri = lrPkgs.llvm_cheri.overrideAttrs (_: { | ||
| version = "20.0.0-rvy-0910-457ae0c4c4a9"; | ||
| src = pkgs.fetchFromGitHub { | ||
| owner = "Capabilities-Limited"; | ||
| repo = "cheri-alliance-llvm-project"; | ||
| rev = "457ae0c4c4a969882b0c26004920d8bfe51cc395"; | ||
| hash = "sha256-+0Ec4rut3F2JvNtq/HGEXefbIvKCDHHSyP1nPo4Z6mY="; | ||
| }; | ||
| }); |
There was a problem hiding this comment.
This change shouldn't be necessary any more with the LLVM in our Nix cache.
| For maximum tracing performance, omit `--threads 2`. | ||
| For maximum non-tracing performance, or when using Verilator v5.048 onwards, omit `--trace-threads 2`. | ||
| The `-j 4` argument enables parallel C++ compilation, while `--threads 2` enables two simulation threads. | ||
| Verilator 5.048 and later ignore the deprecated `--trace-threads` option. |
There was a problem hiding this comment.
This last sentence about trace-threads can be removed since we don't use that option anymore after this change.
| verilator = lrPkgs.verilator_5_048.overrideAttrs (old: { | ||
| version = "5.054"; | ||
| src = pkgs.fetchFromGitHub { | ||
| owner = "verilator"; | ||
| repo = "verilator"; | ||
| rev = "v5.054"; | ||
| hash = "sha256-YCCcFA7Mq7SjK6yHldT0rpS1FwXc5C8mgzcJD/imbEw="; | ||
| }; |
There was a problem hiding this comment.
Are you overriding the v5.048 rules with v5.054? Wouldn't it be better to create a new target instead?
There was a problem hiding this comment.
I've updated our reference to your lowrisc-nix, and now point to lrPkgs.verilator_5_054
| verilator: | ||
| mode: lint-only | ||
| verilator_options: | ||
| # Verilator 5.040 crashes in V3DfgSynthesize on the RVY HPDCache |
There was a problem hiding this comment.
Is this still true for 5.054?
There was a problem hiding this comment.
The fno-dfg-post-inline is no longer necessary; I've removed it now.
| }; | ||
| }); | ||
|
|
||
| llvm_cheri = lrPkgs.llvm_cheri_rvy_0910; |
There was a problem hiding this comment.
Ah, I see you've change it here. Can you rebase and fold this back into the commit where you introduced this?
There was a problem hiding this comment.
I believe this is no longer in the history.
| url: "https://github.com/openhwgroup/cvfpu.git", | ||
| // CVFPU submodule revision selected by the pinned CVA6 RVY core. | ||
| rev: "106251e502747f17d931a20db0bdbab9e1a6c2ff", | ||
| rev: "develop", |
There was a problem hiding this comment.
Can you fold this into your previous commit?
There was a problem hiding this comment.
I believe this is no longer in the history.
| // Divide/square-root submodule revision selected by the pinned CVFPU. | ||
| rev: "86e1f558b3c95e91577c41b2fc452c86b04e85ac", | ||
| // The lock file pins the divide/square-root submodule revision selected by CVFPU. | ||
| rev: "master", |
There was a problem hiding this comment.
Can you fold this into the previous commit? And remove the comment about the lock file since this is true for all vendor files.
| // Flip-Flop with no reset | ||
| `define FFNR(__q, __d, __clk = clk_i) \ | ||
| `PRIM_FLOP_NR(__d, __q, __clk) | ||
|
|
There was a problem hiding this comment.
Nice one! Can you fold this into where you introduced FFLNR in the first place?
314fb40 to
b329682
Compare
Import the mocha integration branch at c1eda9b54e7684c2c39926118405f5b1b93e4f17 using util/vendor.py --update.
…the memory-controller change, but preserves the depth-one buffer pointer fix.
Use lowrisc-nix llvm_cheri_rvy_0910 consistently for the shell, FPGA helpers and CHERI toolchain. Export CHERI_LLVM_BIN for explicit CMake compiler selection.
Set integer mode through hperms, matching the RVY 0.9.9 capability structure.
Add the AES and trigger packages and implementation modules required by the updated CVA6 sources.
Pin Verilator 5.054 and the lowrisc-nix input it builds on. Add scoped provisional waivers for vendor and integration diagnostics and remove deprecated trace-thread options from the documented and CI build commands.
Update capability instructions, register names and address CSRs in startup, trap handling and inline assembly. Use lly/lgy directly for symbol addresses, and account for YPERMC clearing permissions and RVH being disabled. Select rv64ymac_zyhybrid and replace the old ISA feature check with __riscv_zyhybrid; leave the change to ABI-based selection for a separate commit. Audit against RVY 0.9.10: the ported code does not use PACKY, the old YHIR encoding, or the relocated CHERI CSRs. The numeric mtvec, mscratch and mepc indices remain unchanged. Compile the affected purecap and vanilla sources with the pinned RVY 0.9.10 LLVM toolchain.
Use __CHERI_PURE_CAPABILITY__ for startup, trap layouts, MMIO pointers, pointer formatting and capability tests. ISA support alone does not imply that ordinary C pointers or uintptr_t are capabilities. Keep an explicit Zyhybrid requirement for purecap startup because the boot ROM enters in integer mode.
Track CVFPU develop and fpu_div_sqrt_mvp master in vendor descriptions. The separate import locks the revisions selected by CVA6 and CVFPU.
Run the vendor scripts to import the pinned CVFPU and fpu_div_sqrt_mvp revisions and generate their lock files.
Use the F and D settings from the CVA6 configuration and include CVFPU, its divide/square-root dependency, and the CVA6 FPU wrapper in the build. Add the register macro defaults and no-reset variant required by FPnew.
Select the debug-unit revision used by lowRISC/cva6-cheri mocha. Rebase Mocha primitive, wider DMI and reset-pending adaptations; upstream already contains the hart-select and TAP-reset fixes.
Update code from upstream repository https://github.com/Capabilities- Limited/riscv-dbg.git to revision 7fbcff1d606d2193be6517ac1b736c9f85983e5e Signed-off-by: Peter Rugg <peter.rugg@capabilitieslimited.co.uk>
Terminate the debug-module chain explicitly and document how the CVA6 configuration selects the CHERI exception and re-entry vectors. Update the narrow lint waiver for the larger debug ROM and document RVY-aware debugging tools. Validation: Verilator simulator build passed; the existing GDB/OpenOCD regression passed reset/halt, breakpoint, register and memory checks. A locked vendor import reproduces the imported sources. Capability-register inspection using RVY-aware GDB and hardware FPGA testing remain unverified.
This is an in-development update to cva6-cheri to rvy 0.9.10 support.
In addition, floating point and caches are enabled.
This has been tested on FPGA for baremetal tests (which are ported in this branch), and updated OpenSBI and UBoot and seL4 from outside of this repo. Not all assembly in this repo has been ported to 0.9.10 yet, and that which has been ported has not been tested beyond booting on FPGA.