Commit graph

2495 commits

Author SHA1 Message Date
Greg Chadwick
d7ce082779 [dv] Remove riscv_perf_counter_test
This test doesn't actually check the performance counters, it just runs
a random instruction test and dumps the performance counters at the end
for some final checking. That checking does not exist. The test is
currently broken as well so just remove it as it adds nothing to the
regression.
2022-10-14 12:59:20 +01:00
Greg Chadwick
511a3516a6 [dv] Remove CPUCTRLSTS from riscv_csr_test
Bit 8 of this CSR cannot be predicted by the CSR test generator leading
to test failures. Remove it from the test for now until this is
addressed.
2022-10-14 12:59:20 +01:00
Greg Chadwick
48733e23ec [rtl] Ignore MIE bit in U mode 2022-10-13 17:30:05 +01:00
Greg Chadwick
48789dd095 [rtl] Don't take interrupts when single stepping
Fixes #1814
2022-10-13 17:30:05 +01:00
Harry Callahan
25d81afef6 Update google_riscv-dv to google/riscv-dv@c6acc18
Update code from upstream repository https://github.com/google/riscv-
dv to revision c6acc1897429f5245cc89b2ecee2e3eefdefd18d

* Add plusarg to enable ECALL insn in main randomized body (Harry
  Callahan)

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
2022-10-11 17:42:23 +01:00
Marno van der Maas
4608df4606 [dv] Shellcheck prettify script
Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-10-11 17:08:46 +01:00
Marno van der Maas
322ab3a285 [dv] Shellcheck objdump script and check for RISCV_TOOLCHAIN variable
Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-10-11 17:08:46 +01:00
Canberk Topal
7c28d3caf3 [ci] Update IBEX_COSIM_VERSION to latest
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-10-11 15:52:42 +01:00
Canberk Topal
e27deb1015 [dv] Add MHPM Counter number param to SpikeCosim
This commit adds another field in SpikeCosim class so that Spike
can hardcode the correct event registers.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-10-11 15:52:42 +01:00
Marno van der Maas
08115056f9 [doc] Add NAPOT address mode to coverage plan 2022-10-10 13:46:17 +01:00
Marno van der Maas
671b924f66 [pmp] Add coverpoints for large NAPOT regions 2022-10-10 13:46:17 +01:00
Greg Chadwick
574d993dcd [ci] Switch to downloading verilator from GCP bucket
Previously it was sourced from the OpenSUSE build service. This has
produced some reliability issues. Downloading pre-built binaries from a
GCP bucket should improve things.
2022-10-07 13:34:07 +01:00
Greg Chadwick
b57c9a4349 [ci] Switch to using Ubuntu 20 LTS azure agent
The Ubuntu 18 LTS image has been deprecated by Azure so we need to
switch to a new version.
2022-10-07 13:34:07 +01:00
Harry Callahan
3c11ef10b9 single_step test : only drive debug_req_i after stepping finishes
This addresses a current testbench issue where asserting debug_req_i close to
when single_stepping over an instruction causes an incorrect 'cause' to be
recorded within DCSR.
2022-10-06 17:52:36 +01:00
Harry Callahan
377382fb78 Single step debugging test changes for fcov
This builds upon the cosimulation environment to allow us to rip-out all the
existing checking from the test, and instead focus on generating good stimulus
to hit all our coverage points.
Make use of the riscv-dv changes to insert ecall into the main test body, now
that we have a different mechanism for ending the test.
Allow illegal instructions, csr instructions, ebreak, etc. which the previous
brittle checking paradigms could not handle.
2022-10-06 17:52:36 +01:00
Marno van der Maas
7ab2571bea [if,pmp] Check second bit instead of third for instruction alignment
Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-10-06 10:23:01 +01:00
Harry Callahan
0e396d5944 Change failure modes and add comments with more clarifying details 2022-10-05 17:00:31 +01:00
Harry Callahan
3650e08e4e Record test failure due to timeout in regr.log
This commit adds a new field to the trr (test-run-result) structured data
that records the failure_mode of a testcase. If the test failed due to a
timeout, print a small addendum {T} to each log-line in the summary.

eg.

23.33% PASS 7 PASSED, 23 FAILED
riscv_debug_basic_test.21259:                     PASS
riscv_debug_basic_test.21260:                     FAILED {T}
riscv_debug_basic_test.21261:                     PASS
riscv_debug_basic_test.21262:                     FAILED {T}
riscv_debug_basic_test.21263:                     FAILED {T}
riscv_debug_instr_test.21259:                     FAILED {T}
riscv_debug_instr_test.21260:                     FAILED {T}
riscv_debug_instr_test.21261:                     FAILED {T}
riscv_debug_instr_test.21262:                     PASS
riscv_debug_instr_test.21263:                     FAILED {T}
riscv_dret_test.21259:                            FAILED
riscv_dret_test.21260:                            FAILED
riscv_dret_test.21261:                            FAILED {T}
2022-10-05 17:00:31 +01:00
Harry Callahan
ee7854fd3a Update docs for (s/ms)context 2022-10-05 16:59:12 +01:00
Harry Callahan
836bd67531 Update SCONTEXT address, add MSCONTEXT csr to match riscv_debug 1.0
Observing the spec change:
RISC-V Debug Support Version 1.0.0-STABLE
1.2.1.4 New Features from 0.13 to 1.0
> 8. Move scontext, renaming original to mscontext, and create hcontext. #535

MSCONTEXT is a backwards-compatible alias to SCONTEXT
In Ibex, SCONTEXT is a read-only zero register. Hence MSCONTEXT has the same behaviour.
2022-10-05 16:59:12 +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