Commit graph

243 commits

Author SHA1 Message Date
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
99c8a7ce00 [fcov] Add coverage for making PMP regions executable. 2022-11-18 17:18:04 +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
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
Andreas Kurth
e5a6c9f38c [doc] Add RF write enable glitch detection
This resolves #1893.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-03 10:31:03 +01:00
Greg Chadwick
ed927be387 [cov] Remove ignored_csrs coverpoints
These related to unimplemented CSRs. These are already captured by one
of the illegal instruction categories.
2022-10-28 11:59:58 +01:00
Greg Chadwick
bb92ea6df4 [cov] Remove pointless cross
This cross wasn't much use as many of the transitions it was crossing
with instruction types only occur when the pipeline is empty (so there's
no instruction type to check).

The remaining interesting cases are already covered by other crosses
(e.g. `debug_if_entry_instr_cross` and `pipe_flush_instr_cross`).

Also adds an assertion to check the pipe is empty when we transition to
IRQ_TAKEN (we need this condition to hold to ensure we don't need extra
coverage for instruction types on this transition).
2022-10-28 11:59:58 +01:00
Greg Chadwick
2f9fd69ec4 [rtl] Remove unused transition in ibex_controller FSM
When in the FLUSH state we cannot have `csr_pipe_flush` set as it
depends upon `instr_executing` being set (within `ibex_id_stage`) and
that is only set in the DECODE stage.
2022-10-28 11:59:58 +01:00
Greg Chadwick
1d4cf9b207 [dv] Add single step over exception coverpoint 2022-10-26 12:13:19 +01:00
Greg Chadwick
bfe71faf5f [dv] Remove cp_insn_trigger_exception coverpoint
This coverpoint does not make sense. The hardware breakpoint is
triggered as the instruction moves into the ID/EX stage so it never has
a chance to take an exception (it effectively never begins executing).
2022-10-26 12:13:19 +01:00
Pirmin Vogel
28935490c2 [rtl] Protect core_busy_o with a multi-bit encoding
This commit protects the core_busy_o signal using a multi-bit encoding
to reduce the chances of an adversary for glitching this signal to low,
thereby putting the core to sleep and e.g. not handling an alert.

Without this commit, the glitch would only be detected once both the
main core and the shadow core wake up again and the comparison of the
core_busy_o signals continues.

This resolves lowRISC/Ibex#1827.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2022-10-25 12:52:01 +02: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
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
Marno van der Maas
08115056f9 [doc] Add NAPOT address mode to coverage plan 2022-10-10 13:46:17 +01:00
Harry Callahan
ee7854fd3a Update docs for (s/ms)context 2022-10-05 16:59:12 +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
cd8bb4608f [doc] Bump privileged spec version to v1.12 2022-09-07 17:31:41 +01:00
Marno van der Maas
97ccca7f27 Made values of mcause 32 bits 2022-08-18 13:16:21 +01:00
Canberk Topal
dfca76f386 [dv,fcov] Implement Misaligned Mem Error coverage
Adds some signal to the load store unit to catch when we have the
fetch error signals from both first and second part of the misaligned
load/store access cases.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-07-21 01:02:15 +03:00
Marno van der Maas
3459d7f8df [lint] Remove whitespace from non-vendored source files
Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2022-07-14 15:59:34 +01:00
Greg Chadwick
ab510f8acf [dv/doc] Tweaks/fixes to functional coverage
This fixes up some minor issues in the functional coverage plan and
implemented cover points
2022-07-11 12:10:55 +01:00
Canberk Topal
5c49fad9a2 [fcov] Adding debug related functional coverage
Includes coverpoints for:

- Hardware trigger point matches
- Debug simple step entrance in controller
- Seeing different insns while single stepping

Also updates on coverage plan to fill up missing mentions of
coverpoints/crosses

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-06-29 16:02:53 +03:00
Canberk Topal
c253bd76a9 [dv] PMP related functional coverage points
Adding MSECCFG CSR related functionality also some write checks etc.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-06-01 13:25:09 +01:00
Pirmin Vogel
e1f614887e Update spike_cosim.cc to be able to build against newer Spike versions
This works with versions ibex-cosim-v0.2 and ibex-cosim-v0.3. The latter
version is required to support the mseccfg CSR added with ePMP.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2022-06-01 00:50:49 +02:00
Canberk Topal
57d810e7fe [fcov] Implementing interrupts section of covplan
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-30 15:56:05 +01:00
Canberk Topal
97a949df02 [doc] Update coverage plan to point crosses/cp's
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
nedguthrie
fe157648a6 Fix formatting if IcacheScramble Description 2022-05-20 20:29:04 +01:00
Pirmin Vogel
05f3b205c5 [doc] Add missing PKG_CONFIG_PATH now required for Ibex DV
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2022-05-13 10:33:00 +02:00
Rupert Swarbrick
42ce56b6b6 [dv] Simplify instructions for how to use Spike with cosim
This depends on Spike version ibex-cosim-v0.2 (which exposes the
various library headers with pkg-config, making configuration much
easier).
2022-04-29 11:13:21 +01:00
Harry Callahan
4db6d15def Fix dead link 2022-04-27 10:51:42 +01:00
Rupert Swarbrick
4854a131fa Remove GEN_OPTS from core_ibex Makefile
We don't actually use it anywhere and it adds some complexity. Let's
put it back in if we turn out to need it.
2022-04-14 09:40:16 +01:00
Rupert Swarbrick
ddb069bc1c [ci,docs] Bump minimum Spike version to ibex-cosim-v0.2 2022-04-12 11:09:33 +01:00
Greg Chadwick
a3b50fb694 [doc, fcov] Remove coverpoint names from unimplemented coverage 2022-04-04 13:05:55 +01:00
Greg Chadwick
fbf4b6a5b2 [doc, fcov] Tweak and add coverpoints
Moved some from 'Miscellaneous' to 'Exceptions/Interrupts/Debug' and
added some details along with a couple of new coverpoints.
2022-04-04 13:05:55 +01:00
Greg Chadwick
ead2174c1a Introduce internal interrupt concept
An internal interrupt triggers an NMI. A single one is implemented, one
on integrity errors being seen in load data. This replaces a synchronous
exception on an integrity error which caused timing issues.
2022-04-01 17:00:23 +01:00
Greg Chadwick
72acfe2fca [fcov, doc] Update coverage plan
Added coverpoint and cross names to relevant plan entries so plan is up
to date with implemented coverage. Also some minor changes to remove
plan entries that are no longer required.
2022-03-28 14:53:27 +01:00
Greg Chadwick
f44ae90040 [doc] Update coverage plan 2022-03-21 14:52:26 +00:00
Greg Chadwick
3438b77921 [rtl] Add minor alert for icache ECC error 2022-03-09 08:57:24 +00:00
Greg Chadwick
58bc6f27ab [doc] Add details about icache latency to DIT docs
When the icache is enabled and data independent timing is required
variable fetch latency due to cache hit or miss may introduce
undesirable timing behaviour. This adds explicit mention of this to the
documentation.
2022-02-23 08:48:12 +00:00
Greg Chadwick
b18eceba81 [rtl] Switch to multi-bit fetch enable
The multi-bit enable aids security hardening. For non secure Ibex all
but the bottom bit is ignored so it is effectively a single bit enable.
2022-02-21 15:35:35 +00:00
Rupert Swarbrick
3475b9106c Refer to a specific tag for the ibex-cosim version of Spike
We're going to want to make a couple more releases of Spike, cleaving
a bit closer to the upstream repository. Let's be explicit about which
version people should get.
2022-02-21 09:43:11 +00:00
Rupert Swarbrick
302bb65161 [doc] Update bitmanip list in integration.rst 2022-02-17 16:19:59 +00:00
Greg Chadwick
9943f9a42c [rtl, doc] Seperate major alert into internal and bus
This is to allow more consistent signalling in systems that integrate
Ibex (e.g. OpenTitan) so bus integrity errors external to Ibex and one's
detected within Ibex can be fed into the same alert whilst seperating
out Ibex's various internal alert causes.
2022-02-17 15:11:51 +00:00
Rupert Swarbrick
bc4bafd8ca [docs] Update description of ISS versions
We can now point at a single version of Spike (the "ibex_cosim"
branch, until we've managed to upstream things properly). And ditch
the OVPsim stuff: that's not going to be supported again any time
soon.
2022-02-16 12:26:36 +00:00
Rupert Swarbrick
4482af1789 [doc] Fix inline literal syntax in icache.rst 2022-02-02 10:19:13 +00:00
Rupert Swarbrick
4bcc0fae6a [doc] Fix botched table layout
My commit 46b7e07 moved the right-most pipe symbol, which causes
Sphinx to skip the rest of the file. Oops!
2022-02-02 10:19:13 +00:00
Rupert Swarbrick
46b7e07098 [doc] Fix RV32B enum description 2022-01-27 16:02:44 +00:00