Commit graph

2426 commits

Author SHA1 Message Date
Harry Callahan
9c7e6806b2 Update rtl_simulation.yaml to use new <rtl_sim_log> for vcs
This should have been changed to match xcelium etc. when the build system
refactor was merged.
2022-10-05 10:28:46 +01:00
Marno van der Maas
1cdd403564 [formal] Remove build infrastructure for instruction cache assertions 2022-10-04 13:59:39 +01:00
Marno van der Maas
ab350c4604 [formal] Remove build infrastructure for data independent timing 2022-10-04 13:59:39 +01:00
Marno van der Maas
fce41ff4d3 [riscv-formal] Removing unsupported and broken feature 2022-10-04 13:59:39 +01:00
Marno van der Maas
43dc5e8572 [formal] Added missing prim secded package 2022-10-04 09:35:13 +01:00
Marno van der Maas
3943a4eca3 [pmp] Remove off mode from pmp_*_mode_cross coverpoints 2022-09-30 11:05:00 +01:00
Greg Chadwick
1313104bad [ci] Fix pmp_smoke_test
It was renamed pmp_smoke_test from pmp_exception_test in the software
build but not the actual test run
2022-09-30 09:41:07 +01:00
Greg Chadwick
4084dc4a46 [cosim] Fix spike cosim instruction count
The count wasn't being initialised in the constructor and should be of
type 'unsigned int'.
2022-09-30 09:41:07 +01:00
Greg Chadwick
a788593842 [cosim] Pass Ibex config through for verilator cosim 2022-09-30 09:41:07 +01:00
Greg Chadwick
7b1be3354d [rtl] Don't cache instructions in debug mode
RISC-V debug modules may utilise dynamically changing code. Don't cache
any instructions in debug mode to correctly support this.

Fixes #1472
2022-09-27 10:12:09 +01:00
Greg Chadwick
163ed7ec9b [rtl] Switch FF RF to use unpacked arrays
Previously it had two packed dimensions. In general we prefer the use of
unpacked arrays for this kind of usage. In particular this had an impact
on trace viewing in GTKWave, the two dimensions were flattened into a
single large bus which made determining individual register values
tricky.
2022-09-27 09:59:09 +01:00
Greg Chadwick
d35ff67df6 [dv] Fix timeout issues
core_ibex_directed_test has a 'disable fork' that was killing processes
that were running sequences. Another part of the testbench waits for
those sequences to finish. When this 'disable fork' happens too early
the sequences are killed before they finish so the testbench never
terminated and times out. Instead ensure the sequences have finished
before doing the 'disable fork'.
2022-09-27 09:12:54 +01:00
Greg Chadwick
70186c57ae [rtl] Add ic_scr_key_valid field to CPUCTRL (renamed CPUCTRLSTS)
The ic_scr_key_valid field indicates whether the ICache scrambling key
is valid.

CPUCTRL is also renamed CPUCTRLSTS as it contains both control and
status bits.
2022-09-22 16:17:31 +01:00
Greg Chadwick
06fece4640 [cosim] Pass SecureIbex and ICache paramters through to cosim 2022-09-22 16:17:31 +01:00
Greg Chadwick
02ccf9e5d0 [ci] Bump cosim version for privilege spec updates 2022-09-07 17:31:41 +01:00
Greg Chadwick
cd8bb4608f [doc] Bump privileged spec version to v1.12 2022-09-07 17:31:41 +01:00
Greg Chadwick
1c5e6b10f5 [rtl] Remove/reword comments referring to specific specifications
Referring to specific parts of a specific version of the specification
can be brittle as all of these references need to be updated when we
shift specification versions. It's also redundant it should be generally
understood Ibex implements the RISC-V specifications and many lines
could have comments that point to the part of the specification they are
implementing. Rather than having a few of these for no particular reason
easier to just remove them all.
2022-09-07 17:31:41 +01:00
Greg Chadwick
423264ce5f [rtl] Clear mprv on mret to non M-mode
This is specification change between the v1.11 and v1.12 privileged
architectures. Previously mprv wasn't altered on mret. Now if returning
to a privilege level other than M mode mprv must be cleared.
2022-09-07 17:31:41 +01:00
Greg Chadwick
1d0344eb89 [rtl, dv] Add new CSRs for latest priviledged spec
This adds the following CSRs to support the v1.12 priviledged spec.

 - MSTATUSH
 - MCONFIGPTR
 - MENVCFG
 - MENVCFGH

MCONFIGPTR is read only and has its value provided by a ibex_pkg
parameter CSR_MCONFIGPTR_VALUE which is set to 0. Implementors can alter
this value if needed.

All the other CSRs ignore writes and read as 0.
2022-09-07 17:31:41 +01:00
Greg Chadwick
c30f7f98bd [dv] Prevent PMP setup for riscv_mem_error_test
RISCV-DV by default sets up some PMP regions. This leads to PMP failures
within riscv_mem_error_test which it isn't expecting. Suppress the PMP
setup to prevent this issue.
2022-09-06 16:52:24 +01:00
Greg Chadwick
494438dc4e Update google_riscv-dv to google/riscv-dv@9c2b007
Update code from upstream repository https://github.com/google/riscv-
dv to revision 9c2b007eea5baed25dc9b4c3181c2f328f98a2af

* [pmp] Add knob to suppress PMP setup code (Greg Chadwick)

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2022-09-06 16:52:24 +01:00
Greg Chadwick
056cb44ff7 [dv] Increase generated CSR instructions in riscv_rand_instr_test
This employs new RISC-V DV functionality to better stimulate reads and
writes for various CSRs in the random instruction test.
2022-08-30 13:12:11 +01:00
Greg Chadwick
95e0947e77 [cosim] Fix various CSR mismatches
This sets the initial values of a few CSRs in spike to match Ibex. It
also adds an mcause fixup so we get WARL behaviour matching Ibex.
2022-08-30 13:12:11 +01:00
Greg Chadwick
080ad8df96 [dv, cosim] Fix mcycle setting
Spike has a hack that decrements mcycle/minstret when written.
Previously this was not handled correctly by cosim. As we can only write
32 bits at a time two writes must be used and incremented to counteract
the decrementing handled carefully.
2022-08-30 13:12:11 +01:00
Greg Chadwick
28a352b602 [ci] Move to latest spike cosim version 2022-08-30 13:12:11 +01:00
Greg Chadwick
7c37648b06 [dv] Improve riscv_core_setting.sv template
This now takes into account more configuration options allow DV to run
successfully across more configs.
2022-08-30 11:53:14 +01:00
Greg Chadwick
3d76300686 [dv] Add makefile step for generating core config file from template
The prior system of using a patch to alter the riscv_dv_setting.sv file
has been removed and replaced with a mako templating based approach.

Fixes #1787
2022-08-30 11:53:14 +01:00
Greg Chadwick
9c4e4bdf6a [ci] Download cosim from lowRISC GCP bucket 2022-08-30 11:29:29 +01:00
Greg Chadwick
cfef9ef7bb [rtl] Integrity errors only relevant to loads
Previously ECC checks would occur on read data seen for both loads and
stores. The data response has no meaning for a write so should be
ignored.
2022-08-30 10:04:38 +01:00
Greg Chadwick
8653927bbd [dv] Drive read data/integrity to X for write response
Fixes #1727
2022-08-30 10:04:38 +01:00
Michael Schaffner
37745c5c72 [lint] Make case statements unique case
Signed-off-by: Michael Schaffner <msf@google.com>
2022-08-24 15:33:38 -07:00
Michael Schaffner
9e3989f205 [dvsim] Make sure results_html_name key is defined
Signed-off-by: Michael Schaffner <msf@google.com>
2022-08-24 14:42:02 -07:00
Michael Schaffner
e8783c711e [testplan] Align milestone/stage terminology
Signed-off-by: Michael Schaffner <msf@google.com>
2022-08-24 14:42:02 -07:00
Michael Schaffner
bbde00d174 Update lowrisc_ip to lowRISC/opentitan@d1be61ba8
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
d1be61ba88a145e882df4e7c7a47f78bcf2371f8

* [testplanner] Replace IP milestone terminology with development
  stage (Michael Schaffner)
* [doc] Replace IP milestone terminology with development stage
  (Michael Schaffner)
* [prim] Fix missing case from prim_reg_cdc_arb assert (Timothy Chen)
* [tools/dv] Remove set_fsm_reset_scoring coverage directive from
  common.ccf (Steve Nelson)
* [dv] Exclude FSM transitions that can only happen on reset (Weicai
  Yang)
* [chip dv] Fixes for chip level falures (Srikrishna Iyer)
* [dv, mem_bkdr_util] Add system base addr (Srikrishna Iyer)
* Switch to run-time options instead (Timothy Chen)
* [dvsim] Fix coverage upload URL (Michael Schaffner)
* [prim] Tweak code slightly to avoid UNR entries (Timothy Chen)
* [prim] Add () to s_eventually (Timothy Chen)
* [dvsim] Add python workaround for shutil (Michael Schaffner)
* [dvsim] Make sure odir is of type Path (Michael Schaffner)
* [dvsim] Fix bug causing error in existing odirs (Canberk Topal)
* [prim] More refactoring to remove UNR generation (Timothy Chen)
* [dvsim] Fix flake8 lint warnings (Michael Schaffner)
* [dvsim] Align local and server path structure (Michael Schaffner)
* [dvsim] Remove support for email report (Michael Schaffner)
* [dvsim/doc] Place summary results into separate hierarchy (Michael
  Schaffner)
* [dvsim/utils] Fix a typo (Michael Schaffner)
* [dvsim] Default report folder name to 'latest' (Michael Schaffner)
* [dvsim] Use relative links on summary page (Michael Schaffner)
* [xcelium warning] Cleanup unexpected semicolon warning (Srikrishna
  Iyer)
* [dv/mem_bkdr] Fix digest update (Timothy Chen)
* [dvsim] Handle same test added twice via `-i` (Srikrishna Iyer)
* [lint] Fix shellcheck errors in hw (Miles Dai)
* [sw/silicon_creator] Rename mask_rom to rom (Alphan Ulusoy)
* [spi_device/dv] Fix payload check (Weicai Yang)
* [dvsvim] ensure ELF file with proper ext gets copied to `run_dir`
  (Timothy Trippel)
* [prim] Assertion update for prim_reg_cdc (Timothy Chen)
* [prim_lfsr dv] Designate a primary build (Srikrishna Iyer)
* [dv] Increase stress tests run time limit to 3h (Weicai Yang)
* [dvsim] Fix run timeout override in hjson (Srikrishna Iyer)
* [dv/cov] Exclude some prim modules from detailed coverage (Guillermo
  Maturana)
* [prim,dv] Reg CDC hardware request fix (Canberk Topal)
* [prim] Add more lint waivers (Michael Schaffner)
* [dvsim] Add support for specifying primary_build_mode (Srikrishna
  Iyer)
* [dv] Add some VCS coverage options (Srikrishna Iyer)
* feat(kmac): Add FI attack protection on packer pos (Eunchan Kim)
* [dv] small fix at mem_model (Weicai Yang)
* [dvsim] enable manufacturer tests to run in DV sim (Timothy Trippel)
* [dvsim] Fix errors due to test duplication (Srikrishna Iyer)
* [pad_wrapper] Do not model keeper (Michael Schaffner)
* [lint] Fix several SAME_NAME_TYPE errors (Michael Schaffner)
* [flash_ctrl] Lint fix (Michael Schaffner)
* [dvsim] Include error message cotext (Srikrishna Iyer)

Signed-off-by: Michael Schaffner <msf@google.com>
2022-08-24 14:42:02 -07:00
Greg Chadwick
7b4b780c7e [dv] Double timeout for an RTL run in regression flow
This takes it from 15 to 30 minutes
2022-08-23 13:35:51 +01:00
Marno van der Maas
d77dd501c9 [dv,pmp] Minor fixes to PMP full random test
- Increase iterations to 20 because double faults are less likely.
- Remove restriction on MPRV randomization.

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-08-22 09:55:31 +01:00
Marno van der Maas
4990aa2684 Update google_riscv-dv to google/riscv-dv@68e3bca
Update code from upstream repository https://github.com/google/riscv-
dv to revision 68e3bcac7293ac79067f0d8196bb973bd7c889cf

* [pmp] Remove restriction on using NAPOT when granularity = 0 (Marno
  van der Maas)
* [pmp] Add PMP entries for data in case of MML or MMWP (Marno van der
  Maas)
* [pmp] Add already_configured flag to skip address in PMP routine
  (Marno van der Maas)
* [pmp] Fix constraint and CSR write test in MML mode (Marno van der
  Maas)
* [pmp] Use random address instead of offset for full random test
  (Marno van der Maas)
* [pmp] Allow specifying address zero in `+pmp_region_%0d` (Marno van
  der Maas)
* [pmp] Randomizing entry for instructions for PMP randomization
  (Marno van der Maas)
* [lint] Remove trailing whitespace (Marno van der Maas)
* Tweak CSR constraints for more even read/write distribution (Greg
  Chadwick)
* [lint] Replace tabs with spaces (Marno van der Maas)
* [pmp] No PMP exception handler when no PMP support (Greg Chadwick)
* Expand CSR instruction constraint functionality (Greg Chadwick)
* Refactor CSR instruction into their own class (Greg Chadwick)

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-08-22 09:55:31 +01:00
Marno van der Maas
2669260aa0 [dv] Stop write PMP CSR routine when using full randomization 2022-08-22 09:55:31 +01:00
Harry Callahan
90daca9765 Bring back +disable_cosim to instead de-escalate fatal to info 2022-08-19 14:45:28 +01:00
Harry Callahan
d5c7b1be02 Remove the final cosim flags from core_ibex uvm environment
We are running with cosim by default now, and no longer support COSIM=0. Hence
this option and all downstream conditional paths are no longer required.
2022-08-19 14:45:28 +01:00
Harry Callahan
781f8445d8 Change method to locate ibex root to relative paths
I had used git to identify the repo root previously but this obviously does not
work with vendoring.
2022-08-19 11:45:52 +01:00
Marno van der Maas
f2f77a3cac [dv] Use lowRISC IP dir from imports instead of re-deriving it
Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-08-19 11:45:52 +01:00
Marno van der Maas
6cb528f8ce [dv] Made dedicated gitignore file and add coverage files 2022-08-19 11:39:49 +01:00
Greg Chadwick
a646737d4d [rtl] Cannot add M mode executable PMP regions when MML = 1
A rule that allows M mode execution (either M mode only or shared M/U
mode) cannot be added when MML is set, unless RLB is also set.

Fixes #1740
2022-08-18 15:45:27 +01:00
Greg Chadwick
2ff233726d [dv] Add sim selection to icache make file 2022-08-18 14:51:23 +01:00
Greg Chadwick
1affeff527 [ci] Fix co-sim install
Due to a failure of mirror syncing the co-sim package cannot be
installed. This downloads it directly from the master server and
installs it manually.
2022-08-18 14:12:09 +01:00
Greg Chadwick
32801e8d12 [dv] Add MCAUSE and MSTATUS to the riscv_csr_test
With the new WARL functionality for the RISCV-DV CSR test generator we
can bring back these CSRs into the test.

Fixes #1663
2022-08-18 13:16:55 +01:00
Marno van der Maas
97ccca7f27 Made values of mcause 32 bits 2022-08-18 13:16:21 +01:00
Harry Callahan
261e9eb3b9 Fix isinstance error with Union types 2022-08-16 14:41:12 +01:00
Harry Callahan
7c8465f9c5 Switch to using pathlib3x to get backported features 2022-08-16 14:41:12 +01:00