Skip to content

[proj] CVA6-CHERI D1 sign-off - #738

Draft
PRugg-Cap wants to merge 19 commits into
lowRISC:mainfrom
Capabilities-Limited:pdr32-cva6-cheri-d1-signoff
Draft

PRugg-Cap wants to merge 19 commits into
lowRISC:mainfrom
Capabilities-Limited:pdr32-cva6-cheri-d1-signoff

Conversation

@PRugg-Cap

Copy link
Copy Markdown

No description provided.

@marnovandermaas marnovandermaas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you so much for putting this together. Once the comments are addressed I think we will be able to sign this one off!

Comment thread doc/proj/clockaudit.txt Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we rename this file cva6-cheri-d1-clock-audit.md or similar? It would also be nice if this was rederable markdown.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okay: I will do that if we're happy we want to keep it!

@PRugg-Cap PRugg-Cap Sep 17, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Just to check: Am I okay to Resolve these, or would you prefer to do it once you've checked the comment is addressed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can resolve whichever ones you think I don't need to have a second look at.

Comment thread doc/proj/cva6-cheri.md Outdated
@@ -0,0 +1,101 @@
# CVA6-CHERI

CVA6-CHERI in Mocha is imported from the [Capabilities Limited repo][capltd-cva6-cheri].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably good to mention that there are some extra patches on top in the lowRISC fork.

Comment thread doc/proj/cva6-cheri.md Outdated

CVA6-CHERI in Mocha is imported from the [Capabilities Limited repo][capltd-cva6-cheri].

## CVA6-CHERI design specification

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should probably go in a file called cva6.md in this folder: https://github.com/lowRISC/mocha/tree/main/doc/ref
We should also reference it in https://github.com/lowRISC/mocha/blob/main/doc/ref/arch.md

Comment thread doc/proj/cva6-cheri.md Outdated

[riscv-spec]: https://github.com/riscv/riscv-isa-manual
[capltd-cva6-cheri]: https://github.com/Capabilities-Limited/cheri-cva6
[cva6-cheri-docs]: https://github.com/Capabilities-Limited/cheri-cva6/tree/zcheri/docs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should prefer to point to the vendored in versions of these: https://github.com/lowRISC/mocha/tree/main/hw/vendor/cva6_cheri/docs

Comment thread doc/proj/cva6-cheri.md Outdated
Comment on lines +18 to +28
F (floating point)
D (double-precision floating point)
C (compressed instructions)
A (atomics)
Y (CHERI: both purecap and hybrid)
Zkn (scalar cryptography)
B (bit manipulation)
Zicond (branchless conditional instructions)
Sdext (debug support)
Sdtrig (debug trigger support)
Zicbom (cache management operations)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably good to make this a bullet list.

Comment thread doc/proj/cva6-cheri.md Outdated

| Type | Item | Status | Note/Collaterals |
|---------------|----------------------------|--------|------------------|
| Documentation | SPEC_COMPLETED | Done | The above section gives information on the specification for CVA6-CHERI, including links to the parent RISC-V and RISC-V CHERI (Y) specifications.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Once we move the spec to the doc/ref document we should link to it here.

Comment thread doc/proj/cva6-cheri.md Outdated
|---------------|----------------------------|--------|------------------|
| Documentation | SPEC_COMPLETED | Done | The above section gives information on the specification for CVA6-CHERI, including links to the parent RISC-V and RISC-V CHERI (Y) specifications.
| Documentation | CSR_DEFINED | Done | As the CPU itself, CVA6-CHERI does not have a memory mapped interface for CSRs. The CSRs are defined by the RISC-V specifications listed above and accessed internally within the core.
| RTL | CLKRST_CONNECTED | TODO | This is still in progress. I've checked up to about 3 modules deep: see `clock_audit.txt`. We should discuss whether/how this should be checked in.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it's fine to have it in the doc/proj. As suggested above we should rename it and make sure it is markdown, but fine to keep this as a separate file to avoid clutter in this one.

Comment thread doc/proj/cva6-cheri.md
| RTL | CLKRST_CONNECTED | TODO | This is still in progress. I've checked up to about 3 modules deep: see `clock_audit.txt`. We should discuss whether/how this should be checked in.
| RTL | IP_TOP | Done | CVA6-CHERI's top-level `cva6` module is defined in [`cva6.sv`][cva6-top]
| RTL | IP_INSTANTIABLE | Done | CVA6-CHERI's top-level module is instantiated in [`top_chip_system.sv`][cva6-inst-loc].
| RTL | PHYSICAL_MACROS_DEFINED_80 | TODO | ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Main question here is whether the data cache is configured as you would expect the final version to be. If yes, then happy for this to be checked off.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@marnovandermaas On the PHYSICAL_MACROS_DEFINED_80, it looks like we have doubled the ICache size (16KB -> 32KB) since the version imported in Mocha. This was due to the observed sensitivity of Linux boot times to the ICache size. This means we'll miss the 80% accuracy requirement. I guess there are three options:

  1. Bump the size up in Mocha. This should be a simple patch.
  2. Waive the requirement and document the expected byte usage, as with the tag controller.
  3. Plan to keep the 16K ICache in the version vendored into Mocha.

Let me know what you think is the best path forwards.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can waive the requirement. Please link the following issue where we track this: #745

Comment thread doc/proj/cva6-cheri.md Outdated
| RTL | IP_INSTANTIABLE | Done | CVA6-CHERI's top-level module is instantiated in [`top_chip_system.sv`][cva6-inst-loc].
| RTL | PHYSICAL_MACROS_DEFINED_80 | TODO | ...
| RTL | FUNC_IMPLEMENTED | Done | CVA6-CHERI's mainline functionality is implemented. The baseline processor implements the RISC-V specification, and CHERI features are implemented, including manipulating capabilities, enforcing capability checks, and propagating tags and capability metadata throughout the pipeline. This is demonstrating by booting the pure capability CHERI Linux within Mocha, and pure capability CheriBSD in the `COREV_APU` SoC on FGPA.
| RTL | ASSERT_KNOWN_ADDED | TODO | ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just putting a comment here so that we can mark it as resolved when the assert knowns are added.

Comment thread doc/proj/cva6-cheri.md Outdated

@marnovandermaas marnovandermaas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok I've left another review, I think we're nearly there. If you can address all the open comments that I've raised and then mark them as resolved (unless you need my further input). Please also clean up the commit history a bit. It's fine to introduce the assertions in one commit and then the documentation in another but there's no need to see edits of the same file. If that is too much work it is also fine for you to squash it all into one commit.

Comment thread doc/proj/cva6-cheri.md
| RTL | FUNC_IMPLEMENTED | Done | CVA6-CHERI's mainline functionality is implemented. The baseline processor implements the RISC-V specification, and CHERI features are implemented, including manipulating capabilities, enforcing capability checks, and propagating tags and capability metadata throughout the pipeline. This is demonstrating by booting the pure capability CHERI Linux within Mocha, and pure capability CheriBSD in the `COREV_APU` SoC on FGPA.
| RTL | ASSERT_KNOWN_ADDED | TODO | ...
| Code Quality | LINT_SETUP | DONE | Verilator warning waivers are added to [`top_chip_system.vlt`][waivers].
| Code Quality | LINT_SETUP | Done | Verilator warning waivers are added to [`top_chip_system.vlt`][waivers].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: can we squash this commit with the previous one?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, I was definitely expecting all these commits to get squashed. Just thought the history would be helpful for you to check all your comments were addressed. I'll rework the history

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: can we squash the rename of the file with the commit that introduces clockaudit.txt?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of adding this patch, I have fixed and commited these output asserts on our fork see this commit
You should be able to vendor in the latest CVA6 from there with the following command:

util/vendor.py --update --commit hw/vendor/cva6_cheri.vendor.hjson 

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Great, thank you!

Comment thread doc/proj/cva6-cheri.md
|---------------|----------------------------|--------|------------------|
| Documentation | SPEC_COMPLETED | Done | [The CVA6-CHERI design spec][cva6-cheri-spec] describes the specification for CVA6-CHERI, including links to the parent RISC-V and RISC-V CHERI (Y) specifications.
| Documentation | CSR_DEFINED | Done | As the CPU itself, CVA6-CHERI does not have a memory mapped interface for CSRs. The CSRs are defined by the RISC-V specifications listed above and accessed internally within the core.
| RTL | CLKRST_CONNECTED | TODO | This is still in progress. See the [clock audit][clock-audit].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is now done right?

Comment thread doc/proj/cva6-cheri.md
| RTL | CLKRST_CONNECTED | TODO | This is still in progress. I've checked up to about 3 modules deep: see `clock_audit.txt`. We should discuss whether/how this should be checked in.
| RTL | IP_TOP | Done | CVA6-CHERI's top-level `cva6` module is defined in [`cva6.sv`][cva6-top]
| RTL | IP_INSTANTIABLE | Done | CVA6-CHERI's top-level module is instantiated in [`top_chip_system.sv`][cva6-inst-loc].
| RTL | PHYSICAL_MACROS_DEFINED_80 | TODO | ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can waive the requirement. Please link the following issue where we track this: #745

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.

2 participants