Commit graph

2469 commits

Author SHA1 Message Date
Marno van der Maas
d2b6a7dfad TODO(vendor) [riscv-dv] using random offset for non-NAPOT regions to increase coverage 2022-10-17 15:59:45 +01:00
Marno van der Maas
1ab3bfea05 [dv,pmp] Add double fault pass flag 2022-10-17 15:57:36 +01:00
Marno van der Maas
5876ffcbac [pmp] Enable double fault detecter for MML read only test
Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-10-17 10:47:15 +01:00
Marno van der Maas
7e84d2ad4d TODO(vendor) [riscvdv,pmp] fix plusarg detection 2022-10-17 10:47:15 +01:00
Marno van der Maas
6e7ecb7280 [pmp] Adjust full random PMP to use random memory addresses
Also increase the iterations back to 100
2022-10-17 10:47:15 +01:00
Marno van der Maas
81c0a7d249 TODO(vendor) use kernel_instr_end for code entry 2022-10-17 10:45:45 +01:00
Marno van der Maas
d5c8412dc8 TODO(vendor) improve debugging of addresses in PMP trap handler 2022-10-17 10:45:45 +01:00
Marno van der Maas
a32e062b37 TODO(vendor) add an extra PMP scratch register to stop overwriting MSCRATCH 2022-10-17 10:45:45 +01:00
Marno van der Maas
66197c2f41 TODO(vendor) fix for NAPOT address mode constraints 2022-10-17 10:45:45 +01:00
Marno van der Maas
2c4e3a90c5 TODO(vendor) fixes, and NAPOT/TOR constraints 2022-10-17 10:45:45 +01:00
Marno van der Maas
c1621381b1 TODO(vendor) [riscv-dv] Add routine to increment PC in load and store trap handlers 2022-10-17 10:45:45 +01:00
Marno van der Maas
59007d6a90 TODO(vendor) [riscv-dv] Add end of kernel stack to stack entry 2022-10-17 10:45:45 +01:00
Marno van der Maas
ee074eb038 TODO(vendor) [riscv-dv] Check for MML when checking for locking 2022-10-17 10:45:45 +01:00
Marno van der Maas
de166d0f3f TODO VENDOR [dv] Put signature and stack entry at end of PMP. 2022-10-17 10:45:45 +01:00
Marno van der Maas
5f7d9401ee TODO(vendor) [dv,pmp] allow already configured addresses to be overwritten with plusargs 2022-10-17 10:45:45 +01:00
Harry Callahan
bece44f4d6 Change double_fault detector to on by default, fatal error if triggered
Add a plusargs "+is_double_fault_detected_fatal" to the top-level cfg,
which is set to 1 by default.

Set the default for the "+enable_double_fault_detector" to 1.
2022-10-17 10:37:04 +01:00
Harry Callahan
b214fa1c72 Add a double_fault detector to core_ibex uvm environment
Add a new scoreboard component to the core_ibex uvm environment, which contains
a double_fault detector task. This uses the top-level output
'double_fault_seen_o' to count the number of total and consecutive double_faults
seen with a test. A helper task allows the base_test to wait upon each of these
counters reaching the configured thresholds, and then to end the test early with
a passing result.

The default thresholds are 100 for consecutive faults, and 1000 for total faults.

The double_fault detector is disabled by default.
A plusarg '+enable_double_fault_detector=1' enables the checker.

This commit enables it for only the 'pmp_full_random_test', as that is a useful
test candidate to begin with.
2022-10-17 10:37:04 +01:00
Greg Chadwick
083fe2a54f [dv] Use fetch enable sequence by default
This sequence randomly toggles the fetch enable.
2022-10-16 17:17:15 +01:00
Greg Chadwick
7feffd566f [dv] Increase various timeouts
When the fetch enable sequence is employed in some tests these timeouts
are hit. Increasing them allows these tests to pass.
2022-10-16 17:17:15 +01:00
Greg Chadwick
12952cfe13 [dv] fetch_enable_seq tweaks
Previously the time over which fetch enable was disabled was randomized
at the start of the sequence and kept constant throught. Now it is
randomized for every `send_req`.

Stop generating FetchEnableOn as a possible fetch_enable value to set
and use the SecureIbex parameter to decide if full randomisation off all
of the non FetchEnableOn MUBI values if needed or we just always switch
between FetchEnableOn/FetchEnableOff

Tweaks the default min/max delay values for how long fetch remains
disabled.
2022-10-16 17:17:15 +01:00
Greg Chadwick
27907d1d4a [rtl] Immediately stop execution when fetch disabled
Previously `fetch_enable_i` only controlled the request going into the
instruction fetch stage.  Due to buffering in the prefetch queue and
icache when this request is dropped it's possible for multiple
instructions to still be available for the ID/EX stage to consume. So
when `fetch_enable_i` was set to off you would get a 'soft stop'. Some
finite number of instructions may still execute and Ibex would come to
an eventual halt.

Now `fetch_enable_i` also gates the instruction moving between the fetch
stage and the ID/EX stage. This gives a 'hard stop' where once fetch is
disabled Ibex comes to an immediate halt.
2022-10-16 17:17:15 +01:00
Harry Callahan
75a93dbed0 Fixup signal used when checking for ebreak cause 2022-10-14 18:44:02 +01:00
Canberk Topal
f2c1d6dc9d [rtl] Change how we record debug causes
This commit changes when we cath the debug causes. Since debug_cause_o
only gets latched when `csr_save_cause_o` is high, it would work if
we change the cause with a mux that is connected to the input signals.

Resolves #1772

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-10-14 18:44:02 +01:00
Greg Chadwick
298c8789da [rtl/dv] Bring back data integrity check on write responses
Previously Ibex signalled a major alert on an integrity error (where
incoming read data doesn't match its integrity bits) for both read and
write responses. This was removed as the data part of a response to a
write is ignored.

This brings it back in a more measured way. This provides a little extra
fault injection hardening as an attacker glitching the memory bus will
generate an alert on both read and write responses.
2022-10-14 18:22:58 +01:00
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