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

Fully support the Write-Back mode of the HPDcache in the CVA6 #2691

Merged
merged 7 commits into from
Jan 10, 2025

Conversation

cfuguet
Copy link
Contributor

@cfuguet cfuguet commented Jan 8, 2025

This PR modifies some components in the CVA6 to fully support the WB mode of the HPDcache.

When on WB mode, there may be coherency issues between the Instruction Cache and the Data Cache. This may happen when the software writes on instruction segments (e.g. to relocate a code in memory).

This PR contains the following modifications:

  • The CVA6 controller module rises the flush signal to the caches when executing a fence or fence.i instruction.
  • The HPDcache cache subsystem translates this fence signal to a FLUSH request to the cache (when the HPDcache is in WB mode).
  • Add new parameters in the CVA6 configuration packages:
    • DcacheFlushOnInvalidate: It changes the behavior of the CVA6 controller. When this parameter is set, the controller rises the Flush signal on fence instructions.
    • DcacheInvalidateOnFlush: It changes the behavior of the HPDcache request adapter. When issuing a flush, it also asks the HPDcache to invalidate the cachelines.
    • Add additional values to the DcacheType enum: HPDCACHE_WT, HPDCACHE_WB, HPDCACHE_WT_WB

In addition, it also fixes some issues with the rvfi_mem_paddr signal from the store_buffer.

core/cache_subsystem/cva6_hpdcache_if_adapter.sv Outdated Show resolved Hide resolved
core/cache_subsystem/cva6_hpdcache_if_adapter.sv Outdated Show resolved Hide resolved
core/cache_subsystem/cva6_hpdcache_if_adapter.sv Outdated Show resolved Hide resolved
core/cache_subsystem/cva6_hpdcache_if_adapter.sv Outdated Show resolved Hide resolved
core/cache_subsystem/cva6_hpdcache_if_adapter.sv Outdated Show resolved Hide resolved
core/cache_subsystem/cva6_hpdcache_subsystem.sv Outdated Show resolved Hide resolved
core/cache_subsystem/cva6_hpdcache_wrapper.sv Outdated Show resolved Hide resolved
core/controller.sv Outdated Show resolved Hide resolved
core/include/config_pkg.sv Outdated Show resolved Hide resolved
core/store_buffer.sv Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from 1814312 to 905af11 Compare January 8, 2025 09:31
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

2 similar comments
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet marked this pull request as draft January 8, 2025 14:46
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from 7cb69cb to fbec8ef Compare January 8, 2025 16:05
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from fbec8ef to 9aa0f74 Compare January 8, 2025 16:17
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from dbc6379 to a4f9e6a Compare January 8, 2025 16:23
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet marked this pull request as ready for review January 8, 2025 17:19
@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from a4f9e6a to d787601 Compare January 8, 2025 20:46
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from d787601 to 0ea2596 Compare January 8, 2025 20:58
Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ failed run, report available here.

@cfuguet
Copy link
Contributor Author

cfuguet commented Jan 9, 2025

Hi @JeanRochCoulon,

All Github tests are passing and almost all Thales's Gitlab tests too, except for the "HW config vcs-uvm cv32a65x" test. However, I do not have any log file to analyze what is failing.

Could you please share with me any output file that I could analyze to solve the issue ?

Thank you !

@JeanRochCoulon
Copy link
Contributor

image

@cfuguet
Copy link
Contributor Author

cfuguet commented Jan 9, 2025

Thank you @JeanRochCoulon. I did not update the Python configuration generator. I'll do that.

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from 0ea2596 to 37a5ec0 Compare January 9, 2025 14:56
Copy link
Contributor

github-actions bot commented Jan 9, 2025

❌ failed run, report available here.

@cfuguet
Copy link
Contributor Author

cfuguet commented Jan 9, 2025

@JeanRochCoulon, now the issue is with the "ASIC Synthesis cv32a65x" test. Again no report is given. Could you please share the log file ?

Thank you

@JeanRochCoulon
Copy link
Contributor

@Gchauvon Can you help @cfuguet ?

* There are new cache subsystem subtypes: HPDCACHE_WT, HPDCACHE_WB, or
  HPDCACHE_WT_WB
  * HPDCACHE_WT uses the HPDcache with the write-through policy
  * HPDCACHE_WB uses the HPDcache with the write-back policy
  * HPDCACHE_WT_WB uses the HPDcache with both write-trough and
    write-back policies

* New parameter to indicate if the Dcache shall be flushed on a fence
  instruction

* New parameter to indicate if the Dcache shall be invalidated after
  flushing the cachelines
@Gchauvon
Copy link
Contributor

Hello @cfuguet ,

During synthesis with VCS we have :

Error: /home/gchauvon/rhel8/cva6/core/cache_subsystem/cva6_hpdcache_if_adapter.sv:142: The construct 'enum declaration inside generate' is not supported. (VER-721)
Error: /home/gchauvon/rhel8/cva6/core/cache_subsystem/cva6_hpdcache_if_adapter.sv:144: The construct 'enum declaration inside generate' is not supported. (VER-721)

@cfuguet cfuguet force-pushed the ft/flush_hpdcache_wb branch from 37a5ec0 to 50df5c9 Compare January 10, 2025 15:54
@cfuguet
Copy link
Contributor Author

cfuguet commented Jan 10, 2025

Thank you @Gchauvon for the error messages !

I've made a new push to fix the syntax unsupported by VCS

Copy link
Contributor

✔️ successful run, report available here.

@cfuguet
Copy link
Contributor Author

cfuguet commented Jan 10, 2025

All good now !

@JeanRochCoulon JeanRochCoulon merged commit db568f3 into openhwgroup:master Jan 10, 2025
12 checks passed
@JeanRochCoulon
Copy link
Contributor

We get a HPDCache WB Now, GREAAAT !!

@cfuguet cfuguet deleted the ft/flush_hpdcache_wb branch January 10, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants