Commit graph

46 commits

Author SHA1 Message Date
Matteo Perotti
1bc415391a
[RVV] CVA6 re-parametrization and MMU interface (#2652)
Follow-up to the discussion on extending Linux support to the Ara vector processor.

* Main changes:
Add:
Add external MMU interface to share the MMU with the external accelerator.
Add avoid_neg() function used to clip negative numbers to zero. Useful for parametric array sizes and vector multipliers.

Modifications:
2 commit ports by default in cv64a6_imafdcv_config_pkg.
Change exception_t from localparam to param in cva6.sv.
Add parameters accelerator_req_t, accelerator_resp_t, acc_mmu_req_t, and acc_mmu_resp_t to cva6.sv.
Replace the fall-through register with a spill register in acc_dispatcher to decouple timing with the accelerator.
Decrease cache sizes in cv64a6_imafdcv_sv39_config_pkg.
Modify Bender.yml package name from ariane to cva6.
Add harmless code to prevent synthesizer tool from crashing when compiling csr_regfile.

* Collateral changes:
Fixes:
Guard some X-IF code lines with correct parameter in cva6.sv.
Parametrize the tracer interface with NrCommitPorts.
Add missing local dependencies to Bender.yml.

---------

Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
2025-02-11 07:22:31 +01:00
Cesar Fuguet
db568f3e1d
Fully support the Write-Back mode of the HPDcache in the CVA6 (#2691)
Some checks are pending
bender-up-to-date / bender-up-to-date (push) Waiting to run
ci / build-riscv-tests (push) Waiting to run
ci / execute-riscv64-tests (push) Blocked by required conditions
ci / execute-riscv32-tests (push) Blocked by required conditions
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.
2025-01-10 17:57:32 +01:00
JeanRochCoulon
837b204753
Make PMP disableable (#2692)
Some checks are pending
bender-up-to-date / bender-up-to-date (push) Waiting to run
ci / build-riscv-tests (push) Waiting to run
ci / execute-riscv64-tests (push) Blocked by required conditions
ci / execute-riscv32-tests (push) Blocked by required conditions
2025-01-09 12:14:18 +01:00
OlivierBetschi
23355d29f0
Pmp/extracted pmp master (#2528)
Extraction of the PMP outside of the MMU.
2024-12-04 10:06:36 +01:00
Côme
4619a67fc6
expand glob port maps (#2585)
Some checks failed
bender-up-to-date / bender-up-to-date (push) Has been cancelled
ci / build-riscv-tests (push) Has been cancelled
ci / execute-riscv64-tests (push) Has been cancelled
ci / execute-riscv32-tests (push) Has been cancelled
Expands all glob port maps in the core/ directory of this repository except the core/cache_subsystem/ directory, despite the glob port maps in core/cache_subsystem/miss_handler.sv and core/cache_subsystem/std_nbdcache.sv.

Also reorders port maps to keep the same order as port declarations.
2024-11-07 16:51:46 +01:00
JeanRochCoulon
51653c6377
Revert "[PMP] Extracted PMP (#2476)" (#2524)
This reverts commit 969c1518f2.
2024-10-04 07:39:35 +02:00
CoralieAllioux
969c1518f2
[PMP] Extracted PMP (#2476)
* Remove misaligned_ex computation: get it from outside

* Remove data and instr pmps, get match_execution from outside

* Get data and instr allow from outside

* Simplify fetch_instruction exception when instr not allow by pmp

* Simplify exception when data not allow by pmp, getting it from outside

* Apply verible format

* First public version of extracted pmp

* Integrate PMP fully outside MMU

* fix translation_valid and dtlb_ppn when no mmu

* Add pmp_data_if in needed file lists

* Fix exception tval when translation is enabled

* integrate no_locked assertions for pmp: now in blocking assignments to avoid raise condition in simulation

* Fix mixed assignment for no_locked_if

* Remove assertion no_locked from pmp: need clk and reset

* Apply verible format

---------

Co-authored-by: Olivier Betschi <olivier.betschi@fr.bosch.com>
2024-10-03 08:21:56 +00:00
Asmaa Kassimi
12be3adb81
Solve some of W240 and W415a warnings increased by PMP entries (#2415) 2024-08-01 18:43:13 +02:00
Moritz Schneider
fd489a16fb
Fix off by one error in PMP length (#2394) 2024-07-25 12:08:53 +02:00
Asmaa Kassimi
4c48a60804
increase condition coverage in lsu, issue and commit stages (#2391) 2024-07-25 07:37:21 +02:00
Côme
4df49a6b0f
superscalar: make SuperscalarEn a CVA6Cfg attribute (#2322) 2024-07-05 14:09:48 +02:00
Moritz Schneider
246961b3c3
Increase max num PMPs to 64 (#2279) 2024-07-04 14:09:37 +02:00
Michael Platzer
318be6dcde
Use correct fault type for VLSU overflow (#2273) 2024-06-19 21:31:00 +02:00
AngelaGonzalezMarino
9142fdd03a
integrate unified mmu with H extension (#1958) 2024-05-16 00:24:50 +02:00
JeanRochCoulon
5df5a5c247
Define InstrTlbEntries, DataTlbEntries, cfg.NrLoadPipeRegs, NrStorePipeRegs, DcacheIdWidth as CVA6 parameters (#2034) 2024-04-12 09:06:35 +02:00
Bruno Sá
86e1408666
Hypervisor extension (#1938)
Support 64bit H extension
2024-03-21 10:28:01 +01:00
Côme
bd4b57cc64
Parametrization step 3 part 3 (last) (#1940) 2024-03-18 16:19:52 +01:00
Côme
4817575de9
Parametrization step 3 part 2 (#1939) 2024-03-18 12:06:55 +01:00
Côme
987c645bb7
Parametrization step 3 (#1935)
This is the third step for #1451. Many values are moved but not all values are moved yet

* move NR_SB_ENTRIES & TRANS_ID_BITS
* remove default rvfi_instr_t from spike.sv
* fifo_v3: ariane_pkg::FPGA_EN becomes a param
* move FPGA_EN
* inline wt_cache_pkg::L15_SET_ASSOC
* move wt_cache_pkg::L15_WAY_WIDTH
* inline wt_cache_pkg::L1I_SET_ASSOC
* inline wt_cache_pkg::L1D_SET_ASSOC
* move wt_cache_pkg::DCACHE_CL_IDX_WIDTH
* move ICACHE_TAG_WIDTH
* move DCACHE_TAG_WIDTH
* move ICACHE_INDEX_WIDTH
* move ICACHE_SET_ASSOC
* use ICACHE_SET_ASSOC_WIDTH instead of $clog2(ICACHE_SET_ASSOC)
* move DCACHE_NUM_WORDS
* move DCACHE_INDEX_WIDTH
* move DCACHE_OFFSET_WIDTH
* move DCACHE_BYTE_OFFSET
* move DCACHE_DIRTY_WIDTH
* move DCACHE_SET_ASSOC_WIDTH
* move DCACHE_SET_ASSOC
* move CONFIG_L1I_SIZE
* move CONFIG_L1D_SIZE
* move DCACHE_LINE_WIDTH
* move ICACHE_LINE_WIDTH
* move ICACHE_USER_LINE_WIDTH
* move DCACHE_USER_LINE_WIDTH
* DATA_USER_WIDTH = DCACHE_USER_WIDTH
* move DCACHE_USER_WIDTH
* move FETCH_USER_WIDTH
* move FETCH_USER_EN
* move LOG2_INSTR_PER_FETCH
* move INSTR_PER_FETCH
* move FETCH_WIDTH
* transform SSTATUS_SD and SMODE_STATUS_READ_MASK into functions
* move [SM]_{SW,TIMER,EXT}_INTERRUPT into a structure
* move SV
* move vm_mode_t to config_pkg
* move MODE_SV
* move VPN2
* move PPNW
* move ASIDW
* move ModeW
* move XLEN_ALIGN_BYTES
* move DATA_USER_EN
* format: apply verible
2024-03-15 17:21:34 +00:00
Côme
aed4ed7c23
move functions into modules (#1926) 2024-03-13 17:46:33 +01:00
Côme
32a3cd56ee
Parametrization step 2 (#1908) 2024-03-08 22:53:42 +01:00
JeanRochCoulon
b3ae6e9362
Revert MMU (#1890)
* Revert "fix vcs simulation errors regarding hypervisor extension code (#1889)"

This reverts commit 5ff5f164fb.

* Revert "Mmu user manual (#1881)"

This reverts commit 6a5863e71a.

* Revert "Mmu unify pr (#1876)"

This reverts commit 9fb5db2555.
2024-03-05 16:44:40 +01:00
AngelaGonzalezMarino
9fb5db2555
Mmu unify pr (#1876) 2024-02-29 22:03:56 +01:00
JeanRochCoulon
f332688fc0
Complete Design Document (#1865) 2024-02-23 23:09:11 +01:00
Guillaume Chauvon
fa101fae7a
Parameterize TVAL to reduce size in embedded (#1784) 2024-01-25 15:47:06 +01:00
Yannick Casamatta
0ce6b40b26
Remove all logic and sequential related to RVFI in CORE cva6 (#1762) 2024-01-18 22:51:10 +01:00
AEzzejjari
3720295bd3
Code_coverage: condition RTL with the IS_XLEN64 parameter (#1666) 2023-12-04 22:21:48 +01:00
Fatima Saleem
49a4b5b4ff
resolving lint warnings... (#1529) 2023-10-20 15:01:42 +02:00
André Sintzoff
7cd183b710
verible-verilog-format: apply it on core directory (#1540)
using verible-v0.0-3422-g520ca4b9/bin/verible-verilog-format
with default configuration

Note: two files are not correctly handled by verible
- core/include/std_cache_pkg.sv
- core/cache_subsystem/cva6_hpdcache_if_adapter.sv
2023-10-18 16:36:00 +02:00
AEzzejjari
ed5d42f1db
Code_coverage: Add conditions for the MMU (#1507) 2023-10-07 18:40:02 +02:00
Florian Zaruba
93782ddfb5
Merge CVA6Cfg and ArianeCfg (#1321) 2023-09-28 11:41:38 +02:00
Fatima Saleem
e76eec7f25
Bypass misaligned address exception info in case of no MMU (#1457) 2023-09-21 10:05:20 +02:00
JeanRochCoulon
1db42ee8da
Add variant into CVA6 parameter (#1320)
* Variane as CVA6 parameter

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* fix FPGA build

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* Fix tipo in cva6.sv

* fix lint warnings

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* Fix is_*_fpr functions

* remove blank lines

* set IsRVFI out of CVA6Cfg

* define config_pkg

* Fix ariane_pkg comments

* Fix Lint from André's feedbacks

* Fix parameter transmission

* Fix replace CVA6Cfg by CVA6ExtendCfg in cva6.sv

* fix add CVA6Cfg in instr_queue, instr_scan and pmp parameters

---------

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
Co-authored-by: ALLART Come <come.allart@thalesgroup.com>
2023-08-22 14:04:06 +02:00
Florian Zaruba
dc103cd49f
Clean-up README.md and top-level directory (#1318)
* Clean-up README.md and top-level directory

This removes the duplicate `scripts` and `util` directories. Furthermore
the README is condensed by collapsing the citation and adding the
CITATION file to the repository.

Signed-off-by: Florian Zaruba <florian@openhwgroup.org>

* Re-name icache req/rsp structs

The structs used to communicate with the icache have contained the
direction, which makes no sense for structs since they inherently don't
have any direction.

Signed-off-by: Florian Zaruba <florian@openhwgroup.org>

---------

Signed-off-by: Florian Zaruba <florian@openhwgroup.org>
2023-07-28 08:32:48 +02:00
Domenic Wüthrich
1a13d6c678
Add New Stall and Flush Signals to acc_dispatcher (#1317)
* [lsu] Add external store buffer pending stall signal

* [controller] Add external acc request pipeline flush signal

* [frontend] Do not increment commit pc on flush if commit stage is halted

* [acc_dispatcher] Add new store buffer stall and flush pipeline ctrl signals

* [acc_dispatcher] Add top module passable config type and parameter

* [cva6] Pass on missing CVA6Cfg parameter to acc_dispatcher
2023-07-26 13:50:38 +02:00
JeanRochCoulon
279ce9fb9b
Define RVFI as cva6 parameter (#1293) 2023-07-19 08:21:39 +02:00
JeanRochCoulon
5284f828e4
declare cva6_cfg_t to pass the configuration through the hierarchy (#1287)
Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
2023-07-01 17:24:21 +02:00
JeanRochCoulon
640eb9dc67
Replace "operator" by "operation" to avoid C++ keyword names in the SV Code. (#1154) 2023-04-02 16:13:59 +02:00
JeanRochCoulon
a8ec2aa868
Make MMU optional (#1136) 2023-03-24 16:13:00 +01:00
JeanRochCoulon
b2cc59a0cc
Add mem_paddr information in RVFI (#1078) 2023-02-28 12:26:33 +01:00
sébastien jacq
a63226d8be
Add TLB entries in cva6 configuration (#1052) 2023-02-09 22:23:49 +01:00
cathales
e41b3f67a2
Add pipe registers number for LOAD and STORE in HW configuration (#1041) 2023-02-01 16:50:03 +01:00
JeanRochCoulon
9109ff07f6
Cvvdev/dev/rvfi (#959)
* Add load and store information to RVFI
* Add rs1 and rs2 information to RVFI
* Condition rvfi mem and rs1/rs2 information generation by RVFI_MEM
This add-on is requested by ISACOV and test termination.
2022-09-21 13:00:59 +02:00
JeanRochCoulon
a9c7b4f1e1
Cvvdev/dev/formating4 (#920)
Several format cleanings:
- split load_store_unit.sv to create lsu_bypass.sv
- add several "begin" and "end"
2022-06-28 22:15:55 +02:00
sébastien jacq
0b61544da8
Dev dcache 32bits (#849)
Reduce dcache data output width from 64 to 32 bits in cv32a6 configuration

Signed-off-by: sjthales <sebastien.jacq@thalesgroup.com>
2022-04-11 14:54:09 +02:00
André Sintzoff
3ddf797e95
Re-organize CVA6 and APU (#725)
* Initial repository re-organization (#662)

Initial attempt to split core from APU.

Signed-off-by: MikeOpenHWGroup <mike@openhwgroup.org>
Co-authored-by: Jean-Roch Coulon <jean-roch.coulon@invia.fr>

Compile `corev_apu` (#667)

* Makefile verilates corev_apu
* Cleanup README
* Fix URL to repo
* Cleaned-up Makefile verilates corev_apu

Signed-off-by: Mike Thompson <mike@openhwgroup.org>

Add extended verification support (#685)

* Makefile, riscv_pkg.sv: Select C64A6 or CV32A6

according to variant variable

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* add RVFI tracer and debug support

New files: rvfi_pkg.sv, rvfi_tracer.sv, ariane_rvfi.pkg.sv

- RVFI ports are added to ariane module
- rvfi_tracer.sv is a module added in ariane-testharness.sv
- RVFI_TRACE enables RVFI trace generation

Co-authored-by: Florian Zaruba <zarubaf@iis.ee.ethz.ch>
Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* Move example_tb from cva6 to core-v-verif project

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* Makefile: remove useless rule for vsim

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* Makefile: add timescale definition when vsim is used

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* Makefile: add vcs support (fix #570)

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* rvfi_tracer.sv: fix compilation error raised by vcs

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* Makefile: use only 2 threads for verilator

when using 4 threads, tests from riscv-compliance and riscv-tests
test suite are randomly stucked with rv32ima configuration

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* Flist.cva6: cleanup for synthesis workflow

Thales synthesis workflow does not manage comments at end of lines

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* Support FPGA generation

- ariane_xilinx.sv: fix AXI bus expansion
- .gitignore, Makefile, run.tcl: fix paths

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* riscv-dbg: update to 989389b0 (to support 32-bit CVA6 debug)

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* Create cva6_config_pkg to setup 32- or 64-bit configuration

According to selected configuration, Makefile calls
cv32a6_imac_sv0_config_pkg.sv or cv64a6_imac_sv39_config_pkg.sv

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* Flist, ariane_wrapper.sv: add wrapper to expand rvfi and axi structures

needed for dc_shell

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* cv*a6_*_pkg.sv, riscv_pkg.sv: (Fix) Use the camel case for the localparams

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* riscv_pkg.sv: clean-up the cva6_config_pkg import

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

* Makefile, ariane.sv: RVFI_TRACE define conditions RVFI port in ariane

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>

Co-authored-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
Co-authored-by: Florian Zaruba <zarubaf@iis.ee.ethz.ch>

* Add lfsr.sv to manifest

Signed-off-by: Mike Thompson <mike@openhwgroup.org>

* Directory re-organzation

* fpga/xilinx/xlnx_axi_dwidth_converter_dm_*: move files (#726)

into the new file organisation

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>

* move mmu_sv32 and mmu_sv39, move bootrom, update path (#729)

Signed-off-by: sjthales <sebastien.jacq@thalesgroup.com>

Co-authored-by: Mike Thompson <mike@openhwgroup.org>
Co-authored-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
Co-authored-by: Florian Zaruba <zarubaf@iis.ee.ethz.ch>
Co-authored-by: sébastien jacq <57099003+sjthales@users.noreply.github.com>
2021-09-24 17:21:19 +02:00
Renamed from src/load_store_unit.sv (Browse further)