Commit graph

2576 commits

Author SHA1 Message Date
Saad Khalid
dcb0abe34d added test flow using is_directed knob 2022-12-06 14:13:44 +00:00
Greg Chadwick
9a65bc1f0d [doc] Fixes and clarifications for exceptions and interrupts 2022-11-29 19:21:08 +00:00
Greg Chadwick
9696b80c88 [doc] Add V2/V2S checklists and declare V2S 2022-11-18 20:37:13 +00:00
Greg Chadwick
156acc0d0b [dv] Add more code coverage waivers 2022-11-18 17:18:24 +00:00
Greg Chadwick
011ebb347a [dv] Add new test to help hit pmp_wr_exec_region cross 2022-11-18 17:18:04 +00:00
Greg Chadwick
99c8a7ce00 [fcov] Add coverage for making PMP regions executable. 2022-11-18 17:18:04 +00:00
Greg Chadwick
bf0397f37a [dv] Add instruction stream to toggle Ibex specific features
It randomly writes to fields of cpuctrlsts to enable and disable data
independent timing, dummy instruction insertion and the icache. This is
used in riscv_debug_basic_test and riscv_single_interrupt_test to see
interrupts and debug requests when dummy instruction insertion and data
independent timing is enabled.
2022-11-18 14:06:53 +00:00
Greg Chadwick
4cd79ed2b1 Update google_riscv-dv to google/riscv-dv@68ab823
Update code from upstream repository https://github.com/google/riscv-
dv to revision 68ab8230c52ec66b393c04394aef4d6082ee53b4

* [pmp] Ensure MML PMP configurations don't dominate. (Greg Chadwick)
* [pmp] Add option to constrain addresses to stay in 32-bit space
  (Greg Chadwick)
* randomizing mstatus.MIE when priv mode is lower than machine (Saad
  Khalid)

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2022-11-18 10:21:28 +00:00
Greg Chadwick
3b61634e29 [dv] Add coverage waivers 2022-11-17 14:51:20 -08:00
Greg Chadwick
2de84f6128 [dv] Coverage flow fixes 2022-11-17 14:51:20 -08:00
Greg Chadwick
e2f9fed856 [dv] Increase timeout on riscv_debug_triggers_test 2022-11-17 18:24:41 +00:00
Greg Chadwick
bc4a4df9b8 [dv] Add pass on timeout option
This is used in riscv_pmp_full_random_test as some executions of that
test run very slowly. These are still valuable so the timeout is used to
ensure they don't take too long but still result in a pass.
2022-11-17 18:24:41 +00:00
Greg Chadwick
4c875b5bd2 [dv,ci] Add tests for data independent timing and dummy instructions 2022-11-17 18:20:57 +00:00
Greg Chadwick
10f56505c8 [ci] Add script for running directed co-sim tests
This helps reduce repetition in the CI yaml in preparation for adding
more directed tests.

This is a very basic script and will be replaced by a more complete
system at a later point.
2022-11-17 18:20:57 +00:00
Greg Chadwick
957349e9a7 [fcov] Add missing security related coverpoints
Also introduces using `DV_FCOV_EXPR_SEEN for some existing coverpoints
where appropriate.
2022-11-17 18:20:50 +00:00
Greg Chadwick
eeede2d98b [doc] Add security countermeasure to coverpoint mapping
Some missing coverpoints were identified in this process which have been
added to the coverage plan.
2022-11-17 18:20:50 +00:00
Greg Chadwick
fff1ebbc2a Update lowrisc_ip to lowRISC/opentitan@34de51f3a
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
34de51f3a39717f636e5f447a628632ec8c31837

* [rdc] Add `waves` option to RDC flow. (Eli Kim)
* [dv] add ability to backdoor load second flash bank (Timothy
  Trippel)
* [entropy_src/dv] No backpressure on AST RNG agent (Martin Lueker-
  Boden)
* [prim_sync_reqack_data] Add check flag to better capture async
  resets (Michael Schaffner)
* [prim] Adjust reset assertion (Timothy Chen)
* [rstmgr] Update reset info since ndm_reset is now a hardware reset
  (Timothy Chen)
* [dv/edn] Allow randomly select a EDN endpoint to enable (Cindy Chen)
* [rom_e2e] add rom_e2e_shutdown_output to DV (Timothy Trippel)
* [chip dv] Fix chip_sw_rom_ctrl_integrity_check test (Srikrishna
  Iyer)
* [prim] Add hardened rectifying lc_tx OR/AND functions (Michael
  Schaffner)
* [dvsim] pass OTP image seeds to Bazel build (Timothy Trippel)
* [tools/dvsim] Remove old cdc plusargs from common_sim_cfg (Guillermo
  Maturana)
* [prim] Add an internal check flag (Timothy Chen)

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2022-11-17 17:33:09 +00:00
Greg Chadwick
21b1420cc4 [dv] Alter cov_merge.tcl patch so icache coverage collection works
cov_merge.tcl has been patched so the Ibex regression can pass through
coverage directories via a file. However this breaks dvsim based flows,
in particular the icache coverage merge.

This patch checks to see if the file is provided, if not it uses the
original merge method that's compatible with dvsim.
2022-11-17 17:33:09 +00:00
Greg Chadwick
6b3e0e7914 [dv, icache] Add functional coverage 2022-11-17 17:33:09 +00:00
Greg Chadwick
ef6219b0ad [doc] Add coverage plan to ICache dv documentation 2022-11-17 17:33:09 +00:00
Greg Chadwick
726eb97a88 [rtl] Flush pipe on MSECCFG CSR write
Without this an instruction executed immediately after the MSECCFG write
doesn't have the new MSECCFG setup applied to its execute permission.
2022-11-17 15:16:33 +00:00
Greg Chadwick
fb32236a3f [dv] Add direct instruction stream to hit pmp boundary cross coverage
The new instruction stream randomly chooses a NAPOT PMP region and emits
a store or load which will cross the boundary of that region at either
the top or the bottom.
2022-11-16 12:52:33 +00:00
Greg Chadwick
c48ca23c40 [dv] Various fcov fixes and tweaks 2022-11-16 12:52:33 +00:00
Greg Chadwick
581f5d45da [lint] Minor lint fixes 2022-11-15 16:11:20 -08:00
Greg Chadwick
3d13c6ccd8 [dv] Fixup coverage collection to match OT dvsim flow 2022-11-15 20:27:16 +00:00
Greg Chadwick
d8b00f0b17 [fpv] Only include double fault prediction logic where RVFI exists 2022-11-15 19:21:56 +00:00
Greg Chadwick
b736680ddb [dv] Add assertions checking double_fault_seen_o 2022-11-14 16:49:23 +00:00
Greg Chadwick
ddf56b3603 [dv] Add debug_mode to rvfi_ext
This indicates if debug mode was active when the instruction was
executed in ID/EX.
2022-11-14 16:49:23 +00:00
Greg Chadwick
abe1ab03e6 [dv] Don't set rvfi_trap when executing ebreak into debug
This aids the implementation of the double fault detector checker (as an
ebreak into debug doesn't sync the seen_sync_exec flag).
2022-11-14 16:49:23 +00:00
Greg Chadwick
8e852d285a [dv] Fix iside error notification to cosim
When a writeback exception occurs when the instruction in ID/EX has seen
an instruction fetch error we need to ensure that error doesn't get
notified to cosim. This requires watching for a writeback exception and
removing the latest iside error from the queue if needed.
2022-11-14 16:49:06 +00:00
Greg Chadwick
b399c7c8c4 [fpv] Fix linting issues in oustanding access tracking logic
This refactors the code to avoid a -1 index access that caused no issues
in functional verification but caused lint errors and is problematic for
formal tools.

Fixes #1799
2022-11-14 11:07:49 +00:00
Greg Chadwick
c9dc225135 [fpv] Add asserts to check crash dump connectivity 2022-11-14 09:13:59 +00:00
Greg Chadwick
eb82c0da14 Update google_riscv-dv to google/riscv-dv@d7c50c1
Update code from upstream repository https://github.com/google/riscv-
dv to revision d7c50c1eb9abe85bd6673878fe2e98489cf5f07e

* Fix `update_src_regs` for ZBB (Greg Chadwick)
* Sample bitmanip instruction coverage (Greg Chadwick)
* Fix for issue google/riscv-dv#826, illegal rs1 in C_JALR (Henrik
  Fegran)

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2022-11-14 09:11:50 +00:00
Greg Chadwick
c07414e8f6 [rtl] Fix zbs bitmanip instruction tracer output
They only have 5 bit immediates so use the shift form for I format
decode.
2022-11-14 09:11:08 +00:00
Saad Khalid
94f9517287 [dv] fixed uvm check for mstatus.MPIE when interrupt is nmi
Signed-off-by: Saad Khalid <saad.khalid@lowrisc.org>
2022-11-10 17:23:22 +00:00
Marno van der Maas
1c720e51b2 [dv,pmp] Put test done/fail sections before main for PMP tests 2022-11-09 09:24:51 +00:00
Saad Khalid
2c15b96a35 [dv] added functional coverpoints
Coverpoints for priv modes with interrupts and mstatus.MIE, and with exceptions.
Also, fixed a checker for scenarios when interrupt is taken from lower priv modes.

Signed-off-by: Saad Khalid <saad.khalid@lowrisc.org>
2022-11-08 09:17:45 +00:00
Canberk Topal
56268c675a [dv] Generate random writes in custom CSRs
This commit adds random custom CSR writes to debug_single_step_test
and riscv_mem_error_test.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 18:42:41 +00:00
Andreas Kurth
dd0063e394 [dv] Add coverage for debug requests and interrupts while executing a dummy instruction
Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-07 18:42:41 +00:00
Andreas Kurth
550c9b2903 [dv] Add coverpoints for dummy instructions in each stage
Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-07 18:42:41 +00:00
Canberk Topal
1ba7a3af38 [dv] V2S Coverage Implementation
This commit adds coverpoints and crosses for security countermeasures
implemented in the design.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 18:42:41 +00:00
Greg Chadwick
7592bb9478 [dv] Disable bad integrity on uninit accesses for mem error tests 2022-11-07 16:24:48 +00:00
Greg Chadwick
346eacb46c [cosim] Add write suppress support
When Ibex does a load that receives data with bad integrity it
suppresses the write to the destination register. The implements
matching functionality for cosim.
2022-11-07 16:24:48 +00:00
Canberk Topal
7de5674a1e Fixup RVFI connection for pc_wdata
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 16:24:48 +00:00
Canberk Topal
715292ce55 [cosim] Cosim integration of internal NMI
This commit is mainly an extension to cosim environment to drive the newly
introduced state variable `nmi_int` in Spike.

This commit
 - Extends RVFI interface by a single bit (ext_nmi_int)
 - Configures cosim to set nmi_int inside Spike

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 16:24:48 +00:00
Canberk Topal
12ae6b2478 [ibex,dv] Add new test for memory integrity errors
This test picks between inserting an integrity error or a bus error
to the response in the case of a memory request from Ibex. Introduces
a control knob `enable_mem_intg_err` which can control the rate of
having integrity errors per request.

This commit also disables checking for double fault alerts in the
scoreboard because they're expected to be seen while simulating and
they don't cause infinite loop problems because every time a memory
response is requested the error causing part is just randomized.
That means Ibex trying to execute same instruction again would have
a chance to succeed this time.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 16:24:48 +00:00
Greg Chadwick
bb959c7181 [dv] Add probe and wait functionality for traps 2022-11-07 16:24:48 +00:00
Greg Chadwick
042c12abd0 [dv] Add custom test done functionality
This enables tests to implement custom test completion handling
2022-11-07 16:24:48 +00:00
Greg Chadwick
4b88ee9571 [dv] Set rdata on write response in sequence not driver
This enables the sequence to corrupt the integrity on write responses
should it choose to.  Previously the driver would always produce correct
integrity.
2022-11-07 16:24:48 +00:00
Canberk Topal
2d03fc8b73 Fix-up new_seq_lib to start after stopping
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 16:24:48 +00:00