Commit graph

2724 commits

Author SHA1 Message Date
Canberk Topal
bd8bee8a72 [dv] Don't set sync_exc_seen in Debug Mode
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-07 10:13:56 +00:00
Andreas Kurth
7b0921e14c [dv] Add test glitching icache data or tag
This commit addresses the integrity part of #1759 by verifying that a
glitch on the data or tag response from the instruction cache raises a
minor alert by the core (if the data/tag returned from the cache is used
by the core).

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 16:28:08 +01:00
Andreas Kurth
85cc254b46 [dv] Create signal probe functions in core_ibex_dut_probe_if
These functions are alternatives to `uvm_hdl_read()` when that function
is not available (e.g., when signals are otherwise optimized away such
as when not dumping waves) and the probe functions are apparently much
faster than `uvm_hdl_read()`, which seems to be implemented as foreign
function.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 16:28:08 +01:00
Andreas Kurth
92c8c31c5b [dv] Add icache signals to core_ibex_dut_probe_if
Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 16:28:08 +01:00
Andreas Kurth
66b3ed1ac1 [dv] Add test glitching register file read data
This commit addresses the integrity checking part of #1756 by verifying
that a glitch on the data read from the register file raises a major
alert by the core (if the data read from the register file is used by
the core).

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 16:00:44 +01:00
Andreas Kurth
be9a97e237 [dv] Create signal probe functions in core_ibex_dut_probe_if
These functions are alternatives to `uvm_hdl_read()` when that function
is not available (e.g., when signals are otherwise optimized away such
as when not dumping waves) and the probe functions are apparently much
faster than `uvm_hdl_read()`, which seems to be implemented as foreign
function.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 16:00:44 +01:00
Andreas Kurth
173387e1c7 [dv] Add RF signals to core_ibex_dut_probe_if
Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 16:00:44 +01:00
Andreas Kurth
e9a866ef55 Update lowrisc_ip to lowRISC/opentitan@affb06d8d
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
affb06d8de0973bfdc271a6aa4b5ed7dc0b575bb

* [dv] Add `wait_clks_or_rst` to `clk_rst_if` (Andreas Kurth)
* [dv/cdc] Use cycle based CDC instrumentation (Guillermo Maturana)
* [dv/prim_edn_req] Check data valid (Cindy Chen)
* [rtl, chip dv] Coverage exclusions for pinmux / padring (Srikrishna
  Iyer)
* [dv] Enhance probe function macro (Srikrishna Iyer)
* [dv] enable loading `opentitan_flash_binary` images in DV (Timothy
  Trippel)
* [prim_diff_decode] Update SVAs to make them compatible with sim CDC
  (Michael Schaffner)
* [prim-lfsr] Fix DefaultSeedLocal compile scope (Srikrishna Iyer)
* [dv] Update dv_base_reg_field to handle status interrupts (Weicai
  Yang)
* [dvsim] fix bindgen error in nightlies (Timothy Trippel)
* feat(prim): Add Status Interrupt type to `prim_intr_hw` (Eli Kim)
* [dv/shadow_reg] Add coverplan for shadow reg (Cindy Chen)
* [dv/shadow_reg] Add shadow reg fcov (Cindy Chen)
* [dv/chip] Skip creating dv_base_reg coverage (Cindy Chen)
* [chip, dv] Remove a testpoint - tl_intg_err (Weicai Yang)
* [dv/top] Add option to automatically set rom_exec_en (Timothy Chen)
* [dv] Use positive check in DV_CHECK* macros (Srikrishna Iyer)
* [top/dv] Add plusargs to clear secret partitions (Michael Schaffner)
* [dv/prim] Disable coverage for unused logic (Guillermo Maturana)
* [dv] Add a global end-of-test signaling for RTL (Srikrishna Iyer)
* [dv] Properly remove coverage on CDC rand delay module (Srikrishna
  Iyer)
* [prim_sync_reqack] Disable reset checks by default, enable inside
  OTBN (Pirmin Vogel)
* [prim_sync_reqack] Modify/extend SVAs with respect to reset (Pirmin
  Vogel)
* [dv/clkmgr] Add exclusions and coverage pragmas (Guillermo Maturana)
* [prim] Simplify defensive coding (Timothy Chen)
* [prim_mubi] Fix sampling issue in MUBI sync assertions (Michael
  Schaffner)
* [rtl/prim] Fix some prim_esc_receiver SVAs (Guillermo Maturana)
* refactor(prim): rst_sync to have scanchain (Eli Kim)
* [unr] Use elite license (Cindy Chen)
* feat(prim): prim_rst_sync (Eli Kim)
* refactor(dvsim): Remove `verdi` checker (Eli Kim)
* [mubi/lc] Relax transient SVA checks (Michael Schaffner)
* [fpv] fix random seed syntax error (Cindy)
* [doc] Fix typos in //hw/lint and //hw/top_earlgrey (Dan McArdle)
* [doc] Fix typos in //hw/ip (Dan McArdle)
* [doc] Fix trailing whitespace before editing Markdown (Dan McArdle)
* [dv/shadow_reg] Update comment (Cindy Chen)
* [dv] Add macro `DV_CHECK_Q_EQ` (Weicai Yang)
* [fpv/pwrmgr] Add assertions to check escalation (Cindy Chen)
* [dv] Fix clk_rst_if limitation (Srikrishna Iyer)
* [dv, pins_if] Add disconnect() method (Srikrishna Iyer)
* SunGrid launcher support (Sharon Topaz)
* [chip dv] Fix errors due to use of invalid HIER macros (Srikrishna
  Iyer)
* [dv, clk_rst_if] Expand instance name in context (Srikrishna Iyer)
* [dv] pins_if improvement (Srikrishna Iyer)
* [CDC/PRIM] Updated prim_fifo_sync and prim_fifo_async to avoid CDC
  in rdata (Joshua Park)
* Fix various typos in Markdown files (Dan McArdle)
* [dvsim] Promote xcelium warning ENUMERR to an error (Michael
  Schaffner)
* [dvsim] Install a SIGTERM handler (Srikrishna Iyer)
* [flash_ctrl,dv] Enable random device param for all tests (Jaedon
  Kim)
* [prim] Patch up design to help with coverage (Timothy Chen)
* [flash_ctrl] Use comportable channels for alerts emanating from
  prim_flash (Michael Schaffner)
* [doc, prim] doc update for new prim library (Joshua Park)
* [otp_ctrl] Use comportable channels for alerts emanating from
  prim_otp (Michael Schaffner)
* [dv] Replace wait_timeout with DV_WAIT_TIMEOUT (Weicai Yang)
* [prim_lfsr] Initial block label (Srikrishna Iyer)
* [dv/top] Regression triage (Timothy Chen)
* [prim_lfsr] Enable randomization of initial seed (Srikrishna Iyer)
* [dv] Fix timeout log (Weicai Yang)

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 15:21:14 +01:00
Andreas Kurth
46dad5edc1 [dv] Compile dv_assert.sv before prim_util_pkg.sv
This is necessary because after the upcoming update of `lowrisc_ip`,
`prim_util_pkg` will depend on `INC_ASSERT`, which is defined in
`dv_assert.sv`.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-04 15:21:14 +01:00
Greg Chadwick
ef43917dec [dv] Fix random data on uninit accesses
Previously the memory model writes didn't work correctly leaving an
incoherent view of memory.
2022-11-04 13:51:38 +00:00
Greg Chadwick
455dbe30f1 [dv] Add missing isolation forks 2022-11-04 12:17:19 +00:00
Andreas Kurth
120607f4f2 [xlm] Enable access to signals without dumping waves
The `-access rw` option allows Xcelium to access signals in the design
(e.g., with `uvm_hdl_read` or `uvm_hdl_force`) without having to dump
waves (which substantially increases the run time).  See [1] for the
background discussion.

[1]: https://github.com/lowRISC/ibex/pull/1879#issuecomment-1300216022

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-03 11:18:30 +01: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
Harry Callahan
31cc8e0b5a Increase iterations for PMP tests to improve coverage 2022-11-02 10:41:02 +00:00
Harry Callahan
dda18c155f Apply lowrisc-ip patch 2022-11-02 10:40:49 +00:00
Harry Callahan
4e524a52bf Add patch for lowrisc_ip 2022-11-02 10:40:49 +00:00
Harry Callahan
f6ebb47274 Applied riscv-dv patch 2022-11-02 10:40:49 +00:00
Harry Callahan
f628f47ef5 Add patch for riscv-dv 2022-11-02 10:40:49 +00:00
Harry Callahan
34341fdc67 Merge coverage using db's in a file
Tidy up merge_cov.py to use metadata / pathlib

The 'imc' tool can accept a list of coverage databases as arguments on the
command line, or a '-runfile' argument can point to a file containing a list of
the databases, one entry per line.
Switch to use the file-method, as too many iterations leads to exceeding the
maximium length of arguments to the shell.
2022-11-02 10:40:49 +00:00
Harry Callahan
9086afe3ac Move tests to their own directory, out/run/tests
Make it easier to find the coverage / regr.log file
2022-11-02 10:40:49 +00:00
Harry Callahan
78bdc9b334 Cleanup check_logs.py, remove redundant cosim_trace check 2022-11-02 10:40:49 +00:00
Andreas Kurth
63be01b608 [dv] Add test glitching PC
This commit addresses #1755 by verifying that a glitch on the PC of Ibex
raises an internal major alert in the core.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-02 09:50:30 +01:00
Andreas Kurth
2f7ff0cbf8 [dv] Add assert control for NoAlertsTriggered
Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2022-11-02 09:50:30 +01:00
Canberk Topal
c145ac3985 [dv] Add a matching NA4 in pmp_full_random_test
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-01 15:36:20 +00:00
Canberk Topal
614f716498 [dv] Randomize MPRV in pmp_full_random_test
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-01 15:36:20 +00:00
Canberk Topal
d92f3be687 [dv] Add directed instruction for random MSECCFG
This commit adds a directed instruction stream to riscv_pmp_full_random_test
To inject random writes to MSECCFG register.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-11-01 15:36:20 +00:00
Greg Chadwick
b278e5b267 [dv] Fix riscv_mem_error_test
Memory errors trigger the same exception as PMP failures. For this test
we simply need to return to the failing instructions rather than the
more complex handling from the PMP exception handler.
2022-10-31 18:03:43 +00:00
Greg Chadwick
4dca23383a [dv] Access CPUCTRLSTS and SECURESEED in riscv_rand_instr_test 2022-10-31 18:03:43 +00:00
Greg Chadwick
cb01156154 [cov] Add illegal bin for misaligned data accesses 2022-10-31 18:03:43 +00:00
Greg Chadwick
ad584baa9a [rtl] Fix dummy instructions
Previously there was a single dummy_instr_id_o signal from ibex_core
which the register file used to determine if it could write to the zero
register (which reads as zero always for real instructions). However a
write occurs in the writeback stage so this signal was not asserted
correctly.

This adds a dummy_instr_wb_o signal to control the write to zero
register. dummy_instr_id_o remains as it's still employed for register
reads for dummy instructions.
2022-10-31 17:42:12 +00:00
Harry Callahan
3dee4621c8 Rework reset handling for UVM env
Move the handling of resets to the routine core_ibex_base_test::handle_reset,
which sequences the resets of different testbench components to ensure that
everything comes back up in the right sequence after a reset stimulus.
2022-10-31 17:32:32 +00:00
Harry Callahan
3e3940aa78 Break-out load_binary_to_mem for ISS and DUT seperately 2022-10-31 17:32:32 +00:00
Greg Chadwick
e63bb13d0a [ci] Bump cosim version to latest
This integrates in the ebreak behaviour changes in spike
2022-10-31 16:46:55 +00:00
Greg Chadwick
980f73b047 [cosim] Fixup ebreak behaviour
When DCSR is set such that ebreak will enter debug mode we were getting
cosim mismatches. This was because Ibex produces the ebreak on the RVFI
interface and spike effectively skips right over it and executes the
first instruction of the debug handler immediately. Traps have similar
but not identical behaviour so we need a special case in the step
function to handle this.
2022-10-31 16:15:09 +00:00
Harry Callahan
d59ed9ab38 Increase delay between irq stimulus for nested_interrupt_test 2022-10-31 16:11:03 +00:00
Harry Callahan
36d0d3089d Bump up timeout for irq_stimulus to accomodate fetch_enable changes
The recent change to add the fetch_enable sequence in to every regression
can very-rarely cause the 3000 cycle timeout for the irq_stimulus check to fail.
This only happens with a large randomized length of the fetch being disabled,
and long latency for memory accesses.
Increase this timeout.
2022-10-31 16:06:57 +00:00
Harry Callahan
b06fb42ab8 Change defaults for bad_intg on uninit accesses for Dmem/Imem
Imem : never create bad_intg on uninit access
Dmem : by default, enable bad_intg on uninit access. Plusarg to change behaviour.
2022-10-31 16:06:57 +00:00
Harry Callahan
352f83fc74 Add new uvm test to hit hardware breakpoints coverpoints
Overrides some riscv-dv classes to create a custom debug_rom for this test,
which is used to setup the breakpoint registers.
I have found it difficult to get stimulus of this hardware feature without
a more directed test. Improvements or ideas are welcome here.

Test-specific timeout of 5min within which I see >90% pass rate.
2022-10-31 16:06:57 +00:00
Harry Callahan
a670743bde Redefine ECALL handler to no-longer jump to 'write_tohost:'
This prevents the simulation from entering an infinite loop which it can no
longer detect and terminate from.
2022-10-31 16:06:57 +00:00
Harry Callahan
1a9ab8bd82 Generate test_done: and test_fail: sections using handshake mechanism
Adding this behaviour to ibex_asm_program_gen allows all test to benefit
from the option of jumping directly to these label. Previously, ECALL was
used to provide a single path to this code.
2022-10-31 16:06:57 +00:00
Greg Chadwick
eca86aef03 [rtl] Fix id_exception_o signal
Previously it was asserted when an instruction in ID would cause an
exception but an earlier instruction in WB also causes an exception
which takes priority.

This didn't cause a functional bug as the `id_exception_o` signal was
used in a single place ORed with `wb_exception_o`. However it was
confusing behaviour and could cause killed instructions to appear on the
RVFI causing false cosim mismatches.
2022-10-31 14:29:59 +00:00
Harry Callahan
0c0626ebbf Update google_riscv-dv to google/riscv-dv@be9c75f
Update code from upstream repository https://github.com/google/riscv-
dv to revision be9c75fe6911504c0e6e9b89dc2a7766e367c500

* Reserve one extra word when pushing GPRs to kernel stack (Harry
  Callahan)
* Store user-stack-pointer on kernel stack when pushing/popping GPRs
  (Harry Callahan)

Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
2022-10-28 17:33:53 +01:00
Canberk Topal
179b776dfb [dv,fcov] MPRV Effect Cross improvements
Removed unnecessary autogenerated bins with using iff more effectively.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-10-28 17:25:45 +01:00
Canberk Topal
2c8ff3b6d8 Extend illegal bin for None config in M-Mode
It is illegal to see an execution/read/write denied while in Machine
mode if MML is disabled. Add this combination to our illegal bin list.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-10-28 17:25:45 +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
727f920c9a [cov] Add waived CSRs IGNORED_CSRS
It has been agreed we are waiving coverage of accessing these CSRs for
V2. They may be removed from list later. See
https://github.com/lowRISC/ibex/issues/1795
2022-10-28 11:59:58 +01:00
Greg Chadwick
57e691507d [cov] Fix debug_wfi_cross
It was triggered only on the debug wakeup actually occurring, so in
particular would never capture debug activity around entering sleep. Now
it just considers if there's something that would trigger debug wakeup.
2022-10-28 11:59:58 +01:00
Greg Chadwick
5e77ccc51a [cov] Add some illegal bins related to 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