Commit graph

55 commits

Author SHA1 Message Date
Riccardo Tedeschi
aae9b2eb66
bp: add BHT with private history (#2793)
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 adds a new two-level BHT predictor with private history. The new BPType parameters allow choosing between the original BHT and the new one.

Co-authored-by: Gianmarco Ottavi <ottavig91@gmail.com>
2025-03-06 09:45:45 +01:00
André Sintzoff
0ec65198bc
doc: fix description of signals in instr_scan.sv (#2752)
as use in design document (automatically generated part)

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>
2025-01-31 05:44:24 +01:00
André Sintzoff
59822e7ad1
instr_scan.sv: remove useless condition (#2748)
is_rvc is redundant with riscv::OpcodeC1, riscv::OpcodeC2

Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>
Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
2025-01-29 11:45:47 +01:00
Guillaume Chauvon
3ce44b1b4e
Spyglass clean up: multiple change to remove Spyglass warnings (#2727)
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
Multiple changes to clean up code and remove Spyglass warnings.

Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
2025-01-23 08:32:31 +01:00
JeanRochCoulon
31008fc4b9
remove ifndef VERILATOR (#2686) 2025-01-08 09:08:44 +01:00
AngelaGonzalezMarino
c389382c89
Altera opt 2 (#2602)
The second optimization for Altera FPGA is to move the BHT to LUTRAM. Same as before, the reason why the optimization previously done for Xilinx is not working, is that in that case asynchronous RAM primitives are used, and Altera does not support asynchronous RAM. Therefore, this optimization consists in using synchronous RAM for the BHT.

The main changes to the existing code are:

New RAM module to infer synchronous RAM in altera with 2 independent read ports and one write port (SyncThreePortRam.sv)

Changes in the frontend.sv file: modify input to vpc_i port of BHT, by advancing the address to read, in order to compensate for the delay of synchronous RAM.

Changes in the bht.sv file: This case is more complex because of the logic operations that need to be performed inside the BHT. First, the pc pointed by bht_update_i is read from the memory, modified according to the saturation counter and valid bit, and finally written again in the memory. The prediction output is given based on the vpc_i. With asynchronous memory, the new data written via update_i is available one clock cycle after writing it. So, if vpc_i tries to read the address that was previously written by update_i, everything is fine. However, in the case of synchronous memory there are three clock cycles of latency (one for reading the pc content (read port 1), another one for writing it, and another one for reading in the other port (read port 0)). For this reason, there is the need to adapt the design to these new latency constraints:

First, there is the need for a delay on the address write of the synchronous RAM, to wait for the previous pc read and store the right modified data.

Once this is solved, similarly to the FIFO case, there is the need for an auxiliary buffer that will store the data written in the FIFO, allowing to have it available 2 clock cycles after the update_i was valid. This is because after having the correct data, the RAM takes 2 clock cycles until data can be available in the output (one clock cycle for writing and one for reading).

Finally, there is a multiplexer in the output that permits to deliver the correct prediction providing the data from the update logic (1 cycle of delay), the auxiliary register (2 cycles of delay), or the RAM (3 or more cycles of delay), depending on the delay since the update_i was valid (i.e. written to the memory).
2024-11-21 23:36:18 +01:00
AngelaGonzalezMarino
33c5d77bd8
Altera opt 1 (#2592)
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
The first optimization for Altera FPGA is to move the instruction queue to LUTRAM. The reason why the optimization previously done for Xilinx is not working, is that in that case asynchronous RAM primitives are used, and Altera does not support asynchronous RAM. Therefore, this optimization consists in using synchronous RAM for the instruction queue and FIFOs inside wt axi adapter.

The main changes to the existing code are:

New RAM module to infer synchronous RAM in altera with independent read and write ports (SyncDpRam_ind_r_w.sv)

Changes inside cva6_fifo_v3 to adapt to the use of synchronous RAM instead of asynchronous:

When the FIFO is not empty, next data is always read and available at the output hiding the reading latency introduced by synchronous RAM (similar to fall-through approach). This is a simplification that is possible because in a FIFO we always know what is the next address to be read.

When data is read right after write, we can’t use the previous method because there is a latency to first write the data in the FIFO, and then to read it. For this reason, in the new design there is an auxiliary register used to hide this latency. This is used only if the FIFO is empty, so we detect when the word written is first word, and keep it in this register. If the next cycle comes a read, the data out is taken from the aux register. Afterwards the data is already available in the RAM and can be read continuously as in the first case.

All this is only used inf FpgaAlteraEn parameter is enabled, otherwise the previous implementation with asynchronous RAM applies (when FpgaEn is set), or the register based implementation (when FpgaEn is not set).
2024-11-15 14:34:15 +01:00
Jean-Roch Coulon
4ca7a3ae38 Fix: Replace riscv_pkg:VLEN by CVA6Cfg.VLEN 2024-10-23 18:24:38 +02:00
JeanRochCoulon
45eaace82b
Revert "Multicommits to shorten smoke-tests duration, to declare VLEN as para…" (#2564)
This reverts commit 0877e8e446.
2024-10-23 18:12:49 +02:00
JeanRochCoulon
0877e8e446
Multicommits to shorten smoke-tests duration, to declare VLEN as parameter, to improve coremark results, to implement spike.yaml/linker dedicated to 65x (#2563)
- FIX: Replace riscv_pkg:VLEN by CVA6Cfg.VLEN
- Declare VLEN as new CVA6 parameter
- smoke-hwconfig: run with vcs-uvm and use return0 tests to speed-up CI light stage timing execution
- Use dedicated linker scripts for 65x configuration.
- Use dedicated spike.yaml for 65x configuration.
- Set BHTEntries=128, cache=WT, scoreboard entries=8 to improve Coremark and Dhrystone results
- Run 4 iterations of coremark to improve results
2024-10-23 17:56:06 +02:00
AngelaGonzalezMarino
1de0da8d96
always update prediction output based on RAM content (#2549)
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
2024-10-16 16:05:48 +02:00
Andrea
ff01467041
Fixed btb for FPGA targets (#2521) 2024-10-02 23:31:40 +02:00
Côme
4a223bee46
decorrelate instr and addr depths in IQ (#2375) 2024-07-22 14:22:56 +02:00
Côme
4df49a6b0f
superscalar: make SuperscalarEn a CVA6Cfg attribute (#2322) 2024-07-05 14:09:48 +02:00
Florian Zaruba
377b0de154
Fix SuperScalar config and add CVA6Cfg to first pass decoder (#2047)
* Add `CVA6Cfg` to first pass decoder

* Fix `verilator` `SELRANGE` warnings

* Update core/decoder.sv

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update core/cva6_accel_first_pass_decoder_stub.sv

Co-authored-by: Côme <124148386+cathales@users.noreply.github.com>

* Update core/decoder.sv

Co-authored-by: Côme <124148386+cathales@users.noreply.github.com>

* Update core/frontend/instr_queue.sv

Co-authored-by: Côme <124148386+cathales@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Côme <124148386+cathales@users.noreply.github.com>
2024-04-17 16:34:08 +02:00
JeanRochCoulon
5df5a5c247
Define InstrTlbEntries, DataTlbEntries, cfg.NrLoadPipeRegs, NrStorePipeRegs, DcacheIdWidth as CVA6 parameters (#2034) 2024-04-12 09:06:35 +02:00
Côme
1c529d68ce
superscalar: return 2 instructions from instruction queue (#2022) 2024-04-09 16:39:24 +02:00
Côme
ec44b22920
superscalar: fetch 64 bits (#2013) 2024-04-08 11:25:39 +02:00
Florian Zaruba
38e8c059b2
Parameterization and other fixes for downstream project (#1950)
* Bender fixes and switch to `cva6_fifo_v3`
* cfg: Fix verilator warnings
* Bender: Fix yml
* acc_dispatcher: Add `csr_addr_i`
* parameterization: Fox AXI_USER_EN warning
* wb_cache: Fix Verilator Lint warnings
* cva6_fifo_v3: Add to Flist
* parameterization: Address review concerns
* Switch to `cva6_fifo_v3`
* tracer: Remove tracer interface

The interface made a bunch of problems with the
typedefs so I've removed it.

---------

Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-05 13:02:18 +02:00
JeanRochCoulon
4423feb06a
Rename ZiCondExtEn and FPGA_EN parameters (#1992) 2024-04-02 15:37:58 +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
JeanRochCoulon
301f18a5f4
Improve FRONTEND description (#1914) 2024-03-11 12:52:35 +01:00
Côme
32a3cd56ee
Parametrization step 2 (#1908) 2024-03-08 22:53:42 +01:00
JeanRochCoulon
f9e6a22960
[HOTFIX] Fix ras.sv (#1887) 2024-03-05 13:32:39 +01:00
JeanRochCoulon
483ef90127
Update frontend module description (#1882) 2024-03-04 23:18:27 +01:00
JeanRochCoulon
3f8649ec7e
Table builder for specification (#1814) 2024-02-08 10:54:47 +01:00
JeanRochCoulon
9d0c700f42
port_builder generates the table of ports (#1805) 2024-02-06 12:06:13 +01:00
Guillaume Chauvon
fa101fae7a
Parameterize TVAL to reduce size in embedded (#1784) 2024-01-25 15:47:06 +01:00
AEzzejjari
738d53af1c
Code coverage: condition RTL With parameters (#1703) 2023-12-13 07:52:47 +01:00
AEzzejjari
1faaec09bc
Code_coverage: condition RTL with the debug parameter (#1582) 2023-10-31 17:35:59 +01: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
Fatima Saleem
d3343f5210
resolving lint warnings (#1520) 2023-10-09 22:38:05 +02:00
Florian Zaruba
93782ddfb5
Merge CVA6Cfg and ArianeCfg (#1321) 2023-09-28 11:41:38 +02:00
Florian Zaruba
91df62885f
Parametrize debug module (#1382) 2023-09-13 16:22:24 +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
Côme
18766f186e
fix prediction shift for BHT and BTB (#1337)
* add labels to if/else blocks for branch prediction

* add labels to if/else blocks for caches

* fix prediction shift for BHT and BTB
2023-08-18 10:26:26 +02:00
Enrico Zelioli
49d1262512
[FIX] m/sret optimization (#1333)
Remove m/sret stall penalty by removing the icache miss

Co-authored-by: Enrico Zelioli <ezelioli@student.ethz.ch>
2023-08-14 14:24:01 +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
5157e2de9d
Move ariane_cfg_t definition from ariane_pkg to in cva6_config_pkg (#1056) 2023-02-13 23:49:27 +01:00
sébastien jacq
3b55657552
BHT optimized for fpga (#1039)
It counts and saves the saturation bits in D flip-flops for 
the ASIC version and in a three-port asynchronous read memory
for the FPGA version.
FPGA flushing is not supported because the frontend module
flushing signal is not connected.
2023-02-01 16:37:44 +01:00
sébastien jacq
6deffb27d7
BTB optimization for FPGA targets (#1016) 2022-12-15 13:24:45 +01:00
JeanRochCoulon
28c620a93a
fix dm package dependency (#1011) 2022-12-09 17:51:30 +01:00
JeanRochCoulon
52fdcc9429
Fix the AXI_USER_WIDTH value and add some begin/end in frontend.sv (#961) 2022-09-22 17:33:15 +02:00