Commit graph

456 commits

Author SHA1 Message Date
Nils Wistoff
3bc643e0e2
tb: Fix port width mismatch on AXI_USER_WIDTH and compile order for Questasim (#1043) 2023-02-02 08:10:49 +01:00
sébastien jacq
32abc1ccda
Add Fifo v3 to optimize fpga implementation in resource size (#1032) 2023-01-23 12:33:44 +01:00
Guillaume Chauvon
dc0ecfde0a
Change VCS option "Implicit wire no fanin" from WARNING to ERROR (#1020) 2022-12-15 11:56:59 +01:00
Zbigniew Chamski
17ccfc42f4
Vendorize corev_apu submodules referenced by CVA6 core. (#1015) 2022-12-13 12:20:36 +01:00
JeanRochCoulon
4b33e69a10
Use only one Flist for all configurations (#1012) 2022-12-13 09:31:26 +01:00
JeanRochCoulon
28c620a93a
fix dm package dependency (#1011) 2022-12-09 17:51:30 +01:00
JeanRochCoulon
c205a04c3b
Fix: move axi_adapter.sv file from core to corev_apu dir (#1009) 2022-12-09 16:35:37 +01:00
Zbigniew Chamski
8a5898dce4
Vendorize CVA6 core submodules (common_cells, FPU with related sub-modules) (#1007) 2022-12-09 11:07:12 +01:00
JeanRochCoulon
b5b3abd7d9
Use unique CVA6 Flist for testharness, UVM and FPGA (#1005) 2022-12-08 07:10:04 +01:00
sébastien jacq
3d16fe20fd
Config cache fpga (#1000)
Create a FPGA configuration
Downsized caches from 4 to 2 ways in FPGA configuration
2022-11-25 13:56:15 +01:00
sébastien jacq
c5947082c4
Optimize FPGA memories (#989) 2022-11-08 23:15:02 +01:00
Zbigniew Chamski
871be7c794
[tracing] VCS and Verilator support of waveform dumps. (#965)
Usage of the macros:
    * If defined, VM_TRACE enables tracing. If macro VM_TRACE_FST is not defined (the default), waveform generation will use VCD format. If the command-line option -v FILE or --vcd=FILE is given to the compiled simulator, the VCD output will be written to file named FILE in the current working dir of the verilated simulator. If no -v/--vcd= option is given on cmdline, or an FST-specific trace option is used, the simulator will generate a VCD trace according to the settings in the RTL code.
    * if VM_TRACE_FST is defined as well, then FST format is used instead of VCD. If the command line option -f FILE or --fst=FILE is given to the simulator, the trace will be stored in file FILE in the current working dir of the verilated simulator. If no -f/--fst= option is given, or a VCD-specific trace option is used, the simulator will generate an FST trace according to the settings in the RTL code.
2022-09-27 14:53:06 +02:00
JeanRochCoulon
35f430d8c6
Replace SyncDpRam by tc_ram (#861)
Signed-off-by: Jean-Roch Coulon  <jean-roch.coulon@thalesgroup.com>
2022-04-28 20:13:55 +02:00
Luca Colagrande
75250868eb
wb_dcache: Forward atomic transactions to AXI (#777)
* wb_dcache: Forward "atomic transactions" to AXI

* Correct bugs

* Forward LR/SC atomics

* Fix CI

* miss_handler: Route AMO port through arbiter

* axi_adapter: Correct LOAD AMOs handling

Accept read data only after (or together) handshake on B channel

* Restore old ID

* Correct atop encodings

* Correct AMOs AXI ID

* Correct wb_dcache testbench

Previously not comparing AMOs at all! Due to amo_exp_resp being 'x

* Realign and sign extend 32b request rdata

* Use axi_pkg definitions for ATOPs encoding

* Remove whitespace

* wb_dcache: Style corrections

Co-authored-by: Florian Zaruba <florianzaruba@gmail.com>

Co-authored-by: Florian Zaruba <florianzaruba@gmail.com>
2022-03-09 16:33:37 +01:00
Gchauvon
4c3dc25c0b
Makefile: Add register_interface/include directory to vcs compile option (#825)
Signed-off-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>
2022-02-16 16:32:12 +01:00
JeanRochCoulon
59d9836ee5
Makefile: Use init_testharness.do when VCS (#822)
Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
2022-02-11 10:51:46 +01:00
Andreas Kuster
c72a9e5d56
Bump register interface to v0.3.1 (#819)
* Bump register interface to v0.3.1

* Upgrade PLIC to upgraded register interface version v0.3.1

* Upgrade rv_plic submodule

* Add rv_plic upgrade to xilinx target. Fix indentations

* Try again (indentation)

* Add register_interface include
2022-02-10 14:19:12 +01:00
Andreas Kuster
1e23ebac71
Add missing sources for questa simulation (#818) 2022-02-10 09:12:29 +01:00
Nils Wistoff
741e82133d
ariane_testharness/ariane_xilinx: Fix AXI ID width (#813)
- Fix the AXI ID width for the CLINT (previously `4`, now `5`)
- Parametrise the CLINT's AXI types
- Deprecate `axi_[master|slave]_connect` and move to AXI assign macros,
  as they allow arbitrary AXI types

Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
2022-02-06 11:17:21 +01:00
André Sintzoff
2714b6695c
Makefile: add missing incdir for VCS (fix #791) (#801)
Signed-off-by: André Sintzoff <andre.sintzoff@thalesgroup.com>
2022-01-24 19:47:54 +01:00
Michael Rogenmoser
4bdfa69d20
axi and common_cells upgrade (#791)
* Change questa version reference format

* bump common_cells to v1.23

* Bump axi to v0.31.0, replace axi_node with axi_xbar

* Bump register_interface for axi compatibility

* add prot signals to axi_lite for compatibility
2022-01-15 11:08:14 +01:00
Andreas Kuster
44a89b9cd4
Add fpga cleanup to make clean target (#789) 2022-01-14 15:00:57 +01:00
Gchauvon
360c34af69
cvxif: Flist modifications for core-v-verif and synthesis (#781)
Signed-off-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>
2021-12-29 14:58:54 +01:00
Gchauvon
e197b445fc
Add cv-x-interface (#780)
* Add top hierarchy modification and rs3 for general purpose register file
* CVA6 core modifications to enable CoreV-eXtension-Interface feature
* Addition of an example coprocessor to use with CoreV-eXtension-Interface functionnalities on CVA6
* CoreV-eXtension-Interface available for FPGA
* Add work directories to gitignore
* Flist: fix cvxif files
* CVXIF: Modification and bugfix for cvxif feature
* CVXIF: simplify destination register feature
* Make 3rd read port on regfile configurable
* example_copro: use fifo_v3 instead of stream_fifo
* Makefile: compilation copro using defines
* ariane_pkg,riscv_pkg: add parameter to en/disable cvxif
* cva6.sv, ariane.sv: add hierarchy between ariane and cva6
* Clean Up code and typo
* CVXIF: moved combinatorial part to cvxif_fu module in ex_stage
* instr_decoder: rename instr predecoder and package
* Clean Up code and typo
* cvxif modification to follow style guideline
* issue_read_operands.sv: fix always_ff block for cvxif functionnal uni
2021-12-22 12:31:56 +01:00
Gchauvon
42aa48affd
Add Verdi option and memory preloading for VCS simulator (#772)
* miss_handler.sv: critical_word signals connection explicit to compile with VCS

Signed-off-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>

* Makefile: add verdi support and move gen files to vcs_result directory

Signed-off-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>

* VCS-32 Preloading

Signed-off-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>
2021-12-03 19:16:38 +01:00
JeanRochCoulon
1094082d75
Makefile: Implement plateforms defined in cva6 specification (#769)
* Makefile: Implement the plateforms defined in cva6 specification
target variable can take cv64a6_imacfd_sv39, cv32a6_imac_sv0,
                         cv32a6_imac_sv32, cv32a6_imacf_sv32

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

* Fix plateform name: from imacfd to imafdc
                    from imacf to imafc

Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
2021-11-26 10:39:08 +01:00
JeanRochCoulon
f5c68710fa
Makefile: Fix Verilator bugs by limiting the threads to one (#768)
Signed-off-by: Jean-Roch Coulon <jean-roch.coulon@thalesgroup.com>
2021-11-24 18:14:02 +01:00
Nils Wistoff
486d9dcbc8
mmu: Prevent elaboration of incompat MMU version (#713)
Fix the VCS flow for 64-bit CVA6 by only adding compatible MMU
sources. For instance, `mmu_sv32` assumes `PLEN` > `VLEN`, which
is not the case for RV64.

Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
2021-10-01 11:41:17 +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
Florian Zaruba
97172398ad
Add support for SV32 MMU (#701)
Signed-off-by: Florian Zaruba <florian@openhwgroup.org>
Co-authored-by: sjthales <sebastien.jacq@thalesgroup.com>
2021-08-05 17:29:44 +02:00
Emeric Poulin
caf1872837
Make the cache size and assoc configurable (#690)
* Make the cache size and assoc configurable

Signed-off-by: Emeric Poulin <emeric.poulin@thalesgroup.com>

* Fix cache_inval_t to pass Travis

Signed-off-by: Emeric Poulin <emeric.poulin@thalesgroup.com>
2021-06-26 00:22:44 +02:00
Florian Zaruba
33b7b672ee
ci: Switch to Github workflows (#689)
* ci: Switch to Github Workflows

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

* README: Change build status

* Revert to Verilator 4.040

* verilator: Bump and mark DPI as thread-unsafe

* ci: Verilator v4.100

* verilator: Disable threading
2021-06-24 22:00:02 +02:00
Nils Wistoff
d24287e957
Makefile: Fix whitespace (#635)
Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
2021-03-18 19:14:00 +01:00
Nils Wistoff
4abae602c5
Makefile: Remove excess questa cmd for target sim (#632)
Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>
2021-03-17 07:34:40 +01:00
OttG
7760227f88
Added rules for compiling and running tests on xcelium (#620)
Signed-off-by: Gianmarco Ottavi <gianmarco@openhwgroup.org>

Co-authored-by: Gianmarco Ottavi <gianmarco@openhwgroup.org>
2021-02-22 10:50:00 +01:00
Luca Zulberti
d88cfebed8
Remove CVA6 dependency on ariane_soc_pkg (#598)
*_slv_t types are needed only in ariane_testharness.
The CVA6 core should not depend on packages related to the SoC
where it is placed.

Signed-off-by: Luca Zulberti <zulberti.luca@gmail.com>
2021-02-16 12:07:20 +01:00
Shengjie Xu
27465f1489
Fixed multithreading and optimisation options for Verilator target (#574)
* Fixed multithreading and optimization options for verilator Makefile target

Signed-off-by: Shengjie Xu <shengjie.xu@mail.utoronto.ca>

* Dropped the -j option in the make commands of Travis CI's verilator tests

Signed-off-by: Shengjie Xu <shengjie.xu@mail.utoronto.ca>

* Limit the optimization flag to verilator target

Signed-off-by: Shengjie Xu <shengjie.xu@mail.utoronto.ca>

* Moved -O3 to CFLAGS from verilator-only flags

Signed-off-by: Shengjie Xu <shengjie.xu@mail.utoronto.ca>
2021-02-16 10:54:21 +01:00
André Sintzoff
296ce39211 Makefile: support spike not located in RISCV directory 2020-12-01 15:03:15 +01:00
Florian Zaruba
eef5ff6d3a
Revert "Add FPGA Optimized Register File Version"
This reverts commit c69ebadcd2 as it unfortunately broke Linux booting
on the Genesys image.

Signed-off-by: Florian Zaruba <zarubaf@iis.ee.ethz.ch>
2020-08-27 18:02:42 +02:00
Florian Zaruba
8de6e35288 ci: Consolidate tests
The tests have been spread to many smaller tests previously to avoid CI timeouts.
With memory preloading the overhead of setting up the tests is dominating so we
merge the tests again.

Also remove `rv64ui-v-fence_i` from test list as it is currently failing.

Signed-off-by: Florian Zaruba <florian@openhwgroup.org>
2020-08-25 12:43:36 +02:00
Florian Zaruba
3a13ae0333 verilator: Add memory preloading
Pre-load the Verilator memories through a side-band signal. We have sub-classed
the dtm_t module to prevent the debugger from pre-loading. This commit also
updates the stale bootrom.

Signed-off-by: Florian Zaruba <florian@openhwgroup.org>
2020-08-25 12:43:36 +02:00
ganoam
c69ebadcd2 Add FPGA Optimized Register File Version
Add a register file, optimized for synthesis on FPGAs supporting
distributed RAM.

Principle:

The baseline implementation implements the register file as an array of
flip-flops and implements large multiplexers for read- and write-
accesses. On FPGAs, we have a more efficient implementation for data
storage: By using distributed RAM for memory storage, we can store up
to 64 bits in just one LUT (depending on the memory layout and FPGA
device). In addition, distributed RAM comes with integrated address
decoders. The register file features one distributed RAM block per
implemented sync write port, each with the parametrized number of
async read ports. The read access is arbitrated depending on which
block was last written to. For this purpose an additional array of
*NUM_WORDS* registers is maintained keeping track of write accesses.

Since both FFs and multiplexers are an expensive structure on FPGA
technology, the achieved savings are considerable. The register file
is used for the FPU and general purpose register files.

Concrete Savings: (Xilinx Kintex-7, xc7k325tffg900-2)

```
            LUT    FF      LUTRAM
---------------------------------
baseline:   40499  22799   0
optimized:  36350  18806   440
---------------------------------
Diff        -4149  -3993   +440
            -10.2% -17.5%
```

Signed-off-by: ganoam <gnoam@live.com>
2020-08-24 14:01:07 +02:00
Nils Wistoff
c30e26183e modelsim: fix simulation flow 2020-07-14 16:32:59 +02:00
Florian Zaruba
78361954dc pmp: Add pmps and riscv definitions
Flatten PMP repo. Move definitions to `riscv_pkg.sv`.
2020-07-14 16:08:38 +02:00
Moritz Schneider
d210a1430b pmp: Wire pmp registers to lsu 2020-07-14 16:08:38 +02:00
Nursultan Kabylkas
2d81445209
verification: Add co-simulation with dromajo (#445)
* Summary: initial dromajo integration

* some changes to Makefile to enable `make verilate DROMAJO=1`
* adding ifdefs to ariane_tb.cpp to disable HTIF
* adding dromajo repo
* making dromajo repo a submodule

* syncing with upstream

* bumping to the latest dromajo commit

* Summary: adding DPI functions for cosim

 * added new file tb/dpi/dromajo_cosim.cc that contains
   all DPIs for dromajo to work
 * editted Makefile to see the above file

* Summary: fixing build issues

 * fixing syntax errors in dpi file
 * renaming dpi file due to name conflict with shared library
 * fixing path in Makefile to the shared dromajo lib

* bumping to the latest dromajo change

* Summary: loading checkpoint to bootrom

This change adds `+checkpoint=` argument to the verilator simulator
as well as corresponding changes to load the dromajo checkpoint into
the bootrom. Dromajo checkpoint bootcode contains series of csrw and
immediate loads to restore the architectural state of the processor.

dromajo_bootrom.sv
is a copy of a generated bootrom.sv file. This
file parses the verilog plusargs and loads the bootrom with the code
that is pointed by the +checkpoint.

csr_regfile.sv
Dromajo needs to start running the code in debug mode. The default
value of debug_mode_q was changed to 1.

* updating dromajo to the latest change

* Summary: sync main memories of dromajo and ariane

These changes load the checkpoint into the main memory of Ariane.
The checkpointed memory that is dumped from dromajo contains
(1) the binary and (2) the values of all stores that dromajo
globally performed before dumping the checkpoint.

dromajo_ram.sv
This file is a copy of SyncSpRamBeNx64.sv and was modified to parse
+checkpoint argument to load the memory from the path pointed by
the argument.

The remaining changes were introduced to instantiate the above file
when DROMAJO=1 flag is set.

* Summary: calling DPIs for cosimulation

This change introduces the calls to DPI functions that interface
with Dromajo.

* updating to the latest commit of dromajo

* disabling verbose output when preloading bootrom and mainram

* Summary: bug fix - update logic of `dcsr_d.prv`

This change was made per discussion with Florian via email. The
current versionincorrectly implements the update logic of
`dcsr_d.prv`.

The confusion came from the fact that the core should update its
`dcsr_d.prv` to the current running privilege level when entering
debug mode. I've attached a patch which, as you suggested, removes
the wrong update logic in the CSR write process and should now
correctly handle the update when entering debug mode
(4.9.1 Debug Control and Status of the debug specification).

* bump to the latest version of dromajo

* Summary: dromajo DPI change

This change:
 * Ariane doesn't commit ebreaks and ecalls so some workaround
   was encorporated
 * Proper exit(0) on cosim pass

* Summary: support for running binaries with dromajo

This change adds the ability to run the following command:
  `make run_dromajo BIN=\path\to\riscv\bin`

It automates the dromajo's checkpoint creation and runs the binary
on Ariane with dromajo cosimulation.

For this to work Ariane must be build with DROMAJO=1.

* changing dromajo recipe name to be consistent with existing names

* adding instructions on how to run cosim with dromajo

* Bump to release 0.6.2

* added license headers

* added more details about dromajo
2020-06-16 10:30:58 +02:00
Wilson Snyder
79d4be758c
Makefile: Fix verilator variable (#427)
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2020-05-15 17:45:36 +02:00
Edgar E. Iglesias
5520192918 ariane-soc: Enable the mock-uart on Verilator
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2020-02-04 15:22:40 +01:00
Nils Wistoff
08c71a2273 ariane_soc: Add APB timer peripheral (#361) 2020-01-22 14:42:09 +01:00
jmason827
955bbdb8f4 fpga: Add VC707 compatibility (#335)
* vc707 changes

* vc707 changes redo

* mcs write and bitstream programming scripts now dependent on board variables
2019-10-11 13:41:41 +02:00