Commit graph

2801 commits

Author SHA1 Message Date
Greg Chadwick
9280b92b1f [doc] Move register file and identity CSR info to integration page 2023-02-17 12:24:06 +00:00
Greg Chadwick
4a4c9bbb5d [doc] Update examples 2023-02-17 12:24:06 +00:00
Greg Chadwick
4c3c11d448 [doc] Add documentation on Ibex configuration 2023-02-17 12:24:06 +00:00
Greg Chadwick
08dda90484 [doc] Add verification overview 2023-02-17 12:24:06 +00:00
Greg Chadwick
a95b86ccc3 Update ePMP references
Smepmp is now a ratified specification at v1.0, these are updates to
reflect that.
2023-02-17 12:24:06 +00:00
Greg Chadwick
77cd6e4dda [doc] Remove area result specifics from Ibex overview
Area consumed varies by configuration and will change as the Ibex RTL
changes. So reporting area numbers within documentation is not
sensible.
2023-02-17 12:24:06 +00:00
Greg Chadwick
91d641cebf [doc] Move to newer Sphinx version 2023-02-17 12:24:06 +00:00
Greg Chadwick
ac245b394f Remove FPGA example
Now ibex-demo-system is available the FPGA example in the Ibex
repository has less use and risks causing confusion so remove it
entirely.
2023-02-17 12:24:06 +00:00
Saad Khalid
b4ae5bbb30 Override misa and mtvec CSRs to match Ibex
* misa is hardwired in Ibex
* mtvec has a mask such that it is 256 byte aligned and always vectored
2023-02-09 15:53:41 +00:00
Harry Callahan
4a48b3c08d Move 'clean' to top-level makefile
So you can type 'make clean' instead of 'make GOAL=clean'
2023-02-08 13:05:59 +00:00
Saad Khalid
10f4fad3e8 updated comment since directed test use the same flow 2023-02-08 13:05:59 +00:00
Saad Khalid
c00e3198e3 added license headers 2023-02-08 13:05:59 +00:00
Saad Khalid
72e9bcd488 vendored riscv test env for common macro files 2023-02-08 13:05:59 +00:00
Saad Khalid
d51437bcf9 added ibex specific macros 2023-02-08 13:05:59 +00:00
Saad Khalid
9534627463 vendored riscv-tests 2023-02-08 13:05:59 +00:00
Harry Callahan
15da9f9753 Add 'all_directed' and 'all_riscvdv' as special TEST targets
Running the Makefile dv flow with TEST=all_directed or TEST=all_riscvdv will
run all of the tests from either source of tests.
2023-02-08 13:05:59 +00:00
Harry Callahan
afef45d78e Add missing copyright messages / licenses 2023-02-08 13:05:59 +00:00
Saad Khalid
ce53589e11 Add pydantic schema + common configs for directed tests
This commit introduces the use of a pydantic model to validate the
data used to define directed tests. 'pydantic' is a python data validation
and settings management library which allows for structured data to be
checked against 'pydantic models'. In this case, we define a 'model' for
how we expect the directed-test yaml to look, including fields and datatypes,
and then validate that the imported file matches this expectation.
In effect, it allows the checking of the data to be seperated from its use.

dv/uvm/core_ibex/scripts/directed_test_schema.py defines the pydantic model,
and provides a function 'import_model()' to check the file-contents and
return a valid dictionary of the structured data.
2023-02-08 13:05:59 +00:00
Saad Khalid
2a852685cb added description for directed pmp test 2023-02-08 13:05:59 +00:00
Saad Khalid
552836cf4a Directed test flow
* First implementation of a directed_test framework, which aims to re-use as much
as possible from the existing riscvdv generation
* Fixed directed test flow to cleanly end the test
* clang-format is off for assembly header files
2023-02-08 13:05:59 +00:00
Andreas Kurth
911a6735b9 [rtl/dv] Add assertions for icache scramble keys
This commit adds two assertions in `ibex_top` to ensure that the
scramble key is correctly applied to the icache scrambled memory
primitives.  Those assertions previously existed in the module that
instantiated Ibex in OpenTitan, but the reference into the generate
loops was problematic for some EDA tools; see lowRISC/opentitan#17155.

Additionally, the assertions previously used the input scramble key
(`scramble_key_i`) even though they tolerated a delay after which the
input scramble key was not necessarily valid anymore (i.e.,
`scramble_key_valid_i` could go low and `scramble_key_i` could take any
value).  This mistake has been corrected by sampling the input scramble
key for the assertions when it is valid and using the sampled value in
the comparison of the assertions.  This problem surfaced in the DV
environment of Ibex (but not in OpenTitan), where multiple tests
(including `riscv_rand_instr_test`, `riscv_mem_error_test`, and
`riscv_multiple_interrupt_test`) failed; these tests now pass.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2023-01-31 17:59:50 +01:00
Greg Chadwick
b1ac975c1e Update README to refer to ibex-demo-system 2023-01-27 13:57:50 +00:00
Canberk Topal
87dfd07f98 [doc] Update block diagram
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2023-01-23 13:55:01 +00:00
Pirmin Vogel
f8dd3d8d3e [python-requirements] Pin setuptools version to < 66.0.0
Starting with setuptools version 66.0.0, legacy package version names
such as 0.23ubuntu1 are no longer supported. Since some of our
Python dependencies use this format, we pin the setuptools version to
the last version before this change. This unblocks CI and gives us time
to upgrade/rebase our dependencies.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2023-01-17 14:56:48 +01:00
Pirmin Vogel
590d196e62 [rtl] Improve FI hardening around data_rvalid_i
Previously, it was possible to glitch data_rvalid_i at the interconnect
level and if the data integrity bits happened to be valid, Ibex would
write the current data_rdata_i into the register file even if it wasn't
doing a load. Since the glitch is inserted at the interconnect level,
both the main and the shadow core are affected equally.

This commit changes the WB stage to only forward the LSU write enable,
which is generated from data_rvalid_i, when Ibex is actually waiting for
an interconnect response for a load instruction. This substantially
narrows down the window for attacks at the interconnect level.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2023-01-16 18:53:17 +01:00
Guillermo Maturana
ec32fb1a64 [rtl] Change code to be more xprop-friendly
Xprop is a simulation feature that improves the SV semantics when
conditions contain 'X values. Change RTL or DV code to enable more xprop
instrumentation.

This addresses lowRISC/opentitan#16791 and some of
lowRISC/opentitan#16723.

Signed-off-by: Guillermo Maturana <maturana@google.com>
2022-12-22 10:09:06 +01: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