Skip to content

Add vCLIC support - #55

Merged
niwis merged 2 commits into
pulp-v2from
ez/vclic
Jul 16, 2025
Merged

Add vCLIC support#55
niwis merged 2 commits into
pulp-v2from
ez/vclic

Conversation

@ezelioli

@ezelioli ezelioli commented Jul 3, 2024

Copy link
Copy Markdown
Collaborator

This PR adds support for the custom vCLIC extension.

It is a replacement of the previous PR, with only changes strictly relevant to vCLIC. It also makes the extension parametrized on an additional RVVCLIC parameter, which depends on RVH and RVSCLIC parameters and can be used to enable / disable the virtualization extension support.

The main changes are:

  1. CSRs: Implemented HGEIE write logic and functionality. Added vCLIC-specific VSTVT and VSINTTHRESH registers.
  2. CLIC interface: Adapted core interface and CLIC controller logic to vCLIC.

@ezelioli
ezelioli requested a review from niwis as a code owner July 3, 2024 08:27
@niwis niwis added the pulp-v2 label Nov 8, 2024
@niwis
niwis changed the base branch from pulp-v1 to pulp-v2 February 24, 2025 03:49
@niwis

niwis commented Feb 24, 2025

Copy link
Copy Markdown
Collaborator

@ezelioli can you rebase onto pulp-v2?

@ezelioli
ezelioli force-pushed the ez/vclic branch 2 times, most recently from 5e37e89 to ff6255a Compare March 19, 2025 13:08
Comment thread core/include/cv64a6_imafdch_sv39_config_pkg.sv Outdated
@ezelioli

Copy link
Copy Markdown
Collaborator Author

@niwis currently the cheshire-integration check fails because the configuration of Cheshire pointed by the CI does not enable the CLIC but uses a CVA6 configuration which enables RVSCLIC and RVVCLIC (only RVSCLIC is overwritten by Cheshire leading to an invalid config with RVVCLIC enabled when CLIC is disabled).

Possible workarounds that I see are:

  1. Re-point the CI job to a version of Cheshire which sets both the RVSCLIC and RVVCLIC parameters (probably the right way to do it). In this case, should I have the CLIC / vCLIC enabled or disabled for this CI check ?
  2. Change the defaul config package used by Cheshire to disable vCLIC feature.

Any hints on how to proceed?

@ezelioli

Copy link
Copy Markdown
Collaborator Author

@niwis currently the cheshire-integration check fails because the configuration of Cheshire pointed by the CI does not enable the CLIC but uses a CVA6 configuration which enables RVSCLIC and RVVCLIC (only RVSCLIC is overwritten by Cheshire leading to an invalid config with RVVCLIC enabled when CLIC is disabled).

Possible workarounds that I see are:

1. Re-point the CI job to a version of Cheshire which sets both the RVSCLIC and RVVCLIC parameters (probably the right way to do it). In this case, should I have the CLIC / vCLIC enabled or disabled for this CI check ?

2. Change the defaul config package used by Cheshire to disable vCLIC feature.

Any hints on how to proceed?

assertion_error
vclic_cheshire_regression

@ezelioli

Copy link
Copy Markdown
Collaborator Author

@niwis currently the cheshire-integration check fails because the configuration of Cheshire pointed by the CI does not enable the CLIC but uses a CVA6 configuration which enables RVSCLIC and RVVCLIC (only RVSCLIC is overwritten by Cheshire leading to an invalid config with RVVCLIC enabled when CLIC is disabled).

Possible workarounds that I see are:

  1. Re-point the CI job to a version of Cheshire which sets both the RVSCLIC and RVVCLIC parameters (probably the right way to do it). In this case, should I have the CLIC / vCLIC enabled or disabled for this CI check ?
  2. Change the defaul config package used by Cheshire to disable vCLIC feature.

Any hints on how to proceed?

I followed approach 1. and the cheshire-integration for this branch (push) is now passing (the CLIC/vCLIC parameters are disabled on the cva6/vclic branch of Cheshire).
The pull_request cheshire-integration job seems to fail due to Bender not finding the CVA6 hash. Do you have any hints on what I could have misconfigured here?

@niwis

niwis commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

Thank you @ezelioli! I agree with approach 1. Let's stick to the same approach as for the CLIC: disable it per default and only enable it for the tests that actually need it (which is currently none?)

Don't worry about the failing pull_request run; it's not your fault. This was fixed in pulp-platform/bender#181 and should be part of the next bender release.

One more point: my understanding is that upstream Cheshire tries to only reference released versions of dependencies. Should vCLIC be integrated into CLIC before updating Cheshire? (to be confirmed with the Cheshire/CLIC maintainers)

I'll do a full review pass asap.

@ezelioli

Copy link
Copy Markdown
Collaborator Author

Thank you @ezelioli! I agree with approach 1. Let's stick to the same approach as for the CLIC: disable it per default and only enable it for the tests that actually need it (which is currently none?)

Don't worry about the failing pull_request run; it's not your fault. This was fixed in pulp-platform/bender#181 and should be part of the next bender release.

One more point: my understanding is that upstream Cheshire tries to only reference released versions of dependencies. Should vCLIC be integrated into CLIC before updating Cheshire? (to be confirmed with the Cheshire/CLIC maintainers)

I'll do a full review pass asap.

Thanks for the updates!
I will double check with the maintainers about the versioning in the meantime.

@ezelioli

Copy link
Copy Markdown
Collaborator Author

Thank you @ezelioli! I agree with approach 1. Let's stick to the same approach as for the CLIC: disable it per default and only enable it for the tests that actually need it (which is currently none?)

Don't worry about the failing pull_request run; it's not your fault. This was fixed in pulp-platform/bender#181 and should be part of the next bender release.

One more point: my understanding is that upstream Cheshire tries to only reference released versions of dependencies. Should vCLIC be integrated into CLIC before updating Cheshire? (to be confirmed with the Cheshire/CLIC maintainers)

I'll do a full review pass asap.

Yes there is no test currently using vCLIC. I can add a vCLIC test and respective config to Cheshire and update this PR to point there.

@niwis

niwis commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

Yes there is no test currently using vCLIC. I can add a vCLIC test and respective config to Cheshire and update this PR to point there.

I think that would be useful to avoid regressions with vCLIC.

@ezelioli

Copy link
Copy Markdown
Collaborator Author

@niwis from my side all changes have been integrated.

  • On CLIC side, the branch has been rebased on main and the PR is being reviewed but it is close to merge. Already tested with new baremetal tests and full hypervisor + guest tests in Cheshire on this new version. No changes affecting CVA6 are anyways expected.
  • On Cheshire side, I added two more tests which validate the delegation of interrupts to S-mode and VS-mode (latter one only when vclic is enabled).
  • Cheshire is updated and ready for a cumulative pulp-v2 PR (pulp-v2.0.0-alpha.1 + vclic).

Let me know if further updates are required :)

@niwis niwis 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 @ezelioli! Only a few points:

  • I think according to the RISC-V naming convention, the name for this extension would be Shclic or, since this is no standard extension, Xhclic. could you rename the config parameter accordingly (e.g. RVVCLIC -> RVXHCLIC)?
  • Some of these changes seem to fix the standard CLIC extension (wfi, trap logic, and the stvt register in csr_regfile). If this is the case, could you split these changes into a separate PR? This will make future maintenance easier e.g. if single extensions shall be upstreamed.
  • Same for changes/fixes that are valid for H extension alone (e.g. hgeie CSR)

Comment thread core/csr_regfile.sv Outdated
@ezelioli

ezelioli commented Apr 5, 2025

Copy link
Copy Markdown
Collaborator Author

Thank you @ezelioli! Only a few points:

  • I think according to the RISC-V naming convention, the name for this extension would be Shclic or, since this is no standard extension, Xhclic. could you rename the config parameter accordingly (e.g. RVVCLIC -> RVXHCLIC)?
  • Some of these changes seem to fix the standard CLIC extension (wfi, trap logic, and the stvt register in csr_regfile). If this is the case, could you split these changes into a separate PR? This will make future maintenance easier e.g. if single extensions shall be upstreamed.
  • Same for changes/fixes that are valid for H extension alone (e.g. hgeie CSR)

Opened PR #64 for CLIC-only related fixes

@niwis

niwis commented Jun 13, 2025

Copy link
Copy Markdown
Collaborator

@ezelioli could you please do a last rebase of this branch on pulp-v2 and the related Cheshire integration branch on nw/cva6-pulp-v2? I'll merge this next, then.

@niwis
niwis merged commit 6ba1a62 into pulp-v2 Jul 16, 2025
36 of 39 checks passed
ezelioli added a commit that referenced this pull request Oct 21, 2025
ezelioli added a commit that referenced this pull request Nov 12, 2025
ezelioli added a commit that referenced this pull request Nov 12, 2025
ezelioli added a commit that referenced this pull request Nov 24, 2025
ezelioli added a commit that referenced this pull request Jan 14, 2026
ezelioli added a commit that referenced this pull request Jan 14, 2026
ezelioli added a commit that referenced this pull request Jan 14, 2026
ezelioli added a commit that referenced this pull request Jan 15, 2026
ezelioli added a commit that referenced this pull request Jan 15, 2026
ezelioli added a commit that referenced this pull request Jan 15, 2026
ezelioli added a commit that referenced this pull request Feb 23, 2026
ezelioli added a commit that referenced this pull request Feb 24, 2026
ezelioli added a commit that referenced this pull request Feb 24, 2026
ezelioli added a commit that referenced this pull request Mar 11, 2026
ezelioli added a commit that referenced this pull request Mar 12, 2026
ezelioli added a commit that referenced this pull request Mar 12, 2026
ezelioli added a commit that referenced this pull request Mar 12, 2026
ezelioli added a commit that referenced this pull request Mar 18, 2026
ezelioli added a commit that referenced this pull request Mar 30, 2026
@ezelioli
ezelioli deleted the ez/vclic branch March 31, 2026 15:14
ezelioli added a commit that referenced this pull request May 13, 2026
ezelioli added a commit that referenced this pull request May 28, 2026
ezelioli added a commit that referenced this pull request May 29, 2026
ezelioli added a commit that referenced this pull request May 29, 2026
ezelioli added a commit that referenced this pull request Jun 25, 2026
ezelioli added a commit that referenced this pull request Jul 29, 2026
ezelioli added a commit that referenced this pull request Jul 29, 2026
ezelioli added a commit that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants