Commit Graph

2689 Commits

Author SHA1 Message Date
Michael Schaffner bac72d96ec [ibex_pmp/lint] Declare functions before using them
Signed-off-by: Michael Schaffner <msf@opentitan.org>
2023-10-19 07:58:30 +00:00
Greg Chadwick 97c0a7231a Update google_riscv-dv to chipsalliance/riscv-dv@71666eb
Update code from upstream repository
https://github.com/chipsalliance/riscv-dv to revision
71666ebacd69266b1abb7cdbad5e1897ce5884e6

* Fixes to support RV32 (Maciej Kurc)
* Extend CI matrix (Eryk Szpotanski)
* Add pyflow test (Grzegorz Placzek)
* Allow the CI to run from any branch and any PR (Maciej Kurc)
* [pmp] Remove MSECCFG reads from trap handler when Smepmp is disabled
  (Marno van der Maas)

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2023-10-03 13:42:54 +00:00
Greg Chadwick 883acc2bfc [dv,vendor] Pin bitstring version to fix gen_csr_test.py
The gen_csr_test.py script provided by RISC-V DV doesn't work with
version 4.0 and upwards of the bitstring library. This patch pins it to
3.1.9 to avoid the issue.
2023-10-03 13:42:54 +00:00
Greg Chadwick 99fb7be1be [dv] Fix ibex_cmd.py
With the latest versions of all python packages in
python-requirements.txt ibex_cmd.py was seeing a run-time type error.
Data from a YAML file that had previously always been a string could now
be an int as well. This alters the code to allow the int to work.
2023-10-03 13:42:54 +00:00
Rupert Swarbrick dccad9e6a3 Port directed_test_schema.py to recent versions of Pydantic 2023-08-31 08:34:17 +00:00
Rupert Swarbrick fddb2fc3a3 [doc] Bump minimum Verilator version
It turns out that we use split_var in the code, which was added in
version 4.030 (and several bugs were fixed in following versions).
Change the minimum required version to match what we're using in
CI (and presumably works!)

This was triggered by issue #2080.
2023-08-31 08:33:04 +00:00
Rupert Swarbrick eb95f74a5a Tweak ibex_cmd.py to fail more cleanly
This shouldn't change the behaviour when it works. On a failure, we
now print out a bit more about what's going on.

When asked to do something impossible now, I think the output is a bit
clearer. For example, if you try to run riscv_bitmanip_full_test with
an OpenTitan configuration (which doesn't have full bitmanip), the
warning message is now:

    WARNING:ibex_cmd:Rejecting test: riscv_bitmanip_full_test. It specifies rtl_params of ['ibex_pkg::RV32BFull'], which doesn't contain the expected 'ibex_pkg::RV32BOTEarlGrey'.

(The following stuff that appears is a bit messy, but at least the
first line is now clearer!)
2023-08-31 08:32:36 +00:00
Rupert Swarbrick 3c895f89a6 Remove (empty) Verible waiver file
The recent versions of Verible that I've tried die when they are given
an empty waiver file. The error message is "Fatal error: Broken waiver
config handle". I can't see a way to add a comment ("// No waiver" or
similar), so I think the best way to keep everything alive is to
delete the empty file.
2023-08-30 14:41:19 +00:00
Marno van der Maas db6257b44a [doc] Fix background of Icache block
The background of the Icache block was a not-well-fitted path that was
causing the background to seep through. This commit updates that
background to more tightly align with the lines and letters.
2023-08-30 09:37:05 +00:00
Marno van der Maas 3a2cc6ae8c [doc] Fix background in block diagram
The background was originally a gradient background on the right
together with a solid background on the left. This caused some
distortion on closer inspection. This commit changes it to have one
background that is a gradient from left to right.
2023-08-30 09:37:05 +00:00
James Wainwright 1eb0beafa5 [ci] Consolidate Verible linting workflow into one stage
Running the verible linter and adding review comments to the pull
request previously had to be done in two stages:

1. Triggered on the pull request - prepare config and waiver files as
   artifacts.
2. Running on the repo's HEAD - run Verible and add review comments.

This was required because Actions running in the context of the pull
request did not have write permissions to add comments to pull requests.

This is now possible with the `pull_request_target` event, which
triggers when pull requests change, but runs in the context of the
repo's HEAD and has the permissions to create comments.

See lowRISC/ibex#1427 and
chipsalliance/verible-linter-action#31 for details.

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
2023-08-04 08:53:47 +00:00
Marno van der Maas 06df66452f [credits] Add names of recent contributors 2023-08-02 08:08:56 +00:00
Marno van der Maas f60d03b6b0 Update google_riscv-dv to chipsalliance/riscv-dv@08b1206
Update code from upstream repository
https://github.com/chipsalliance/riscv-dv to revision
08b12066b34c9728f706e45098ba502a36d7ca59

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2023-07-18 08:40:01 +00:00
Marno van der Maas 44ed214caa [vendor] Use new RISCV-DV URL 2023-07-18 08:40:01 +00:00
Marno van der Maas 18c6053fcf [dv,doc] Point reference to lowRISC branch 2023-07-18 08:34:09 +00:00
Marno van der Maas e791ed49f3 Update riscv-isa-sim to lowrisc/riscv-isa-sim@a4b823a1
Update code from upstream repository https://github.com/lowrisc/riscv-
isa-sim to revision a4b823a1c7a260b532e1aa41b4d929e9634a7222

* Remove personal paths from Makefile (Marno van der Maas)
* Remove trailing whitespace (Marno van der Maas)

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2023-07-18 08:34:09 +00:00
Marno van der Maas 5a485db97b Update riscv-isa-sim to lowrisc/riscv-isa-sim@a7c5d5d8
Update code from upstream repository https://github.com/lowrisc/riscv-
isa-sim to revision a7c5d5d830e4095aa86580579efc46335fbc2f80

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2023-07-18 08:34:09 +00:00
Marno van der Maas e87e31acfa [vendor] Use lowRISC repo for vendoring 2023-07-18 08:34:09 +00:00
Katharina 0264bcf2d4 Update README.md
Describe how to produce a VCD trace file.
2023-07-14 14:43:16 +00:00
Rupert Swarbrick a0c5f5e4d3 Remove initialisation for sim_finish in simulator_ctrl.sv
This initialisation causes Xcelium to complain about multiple drivers
for the variable. Which is rather confusing, but we don't actually
need to initialise it: the variable will be X at the start of time, so
the logic that stops the simulation if it gets big won't fire until
after reset anyway.
2023-07-13 11:49:47 +00:00
Rupert Swarbrick ce552f2e27 Use correct width for 1-bit inputs in ibex_simple_system.sv
Not a big deal, but this silences a warning from some simulators.
2023-07-13 11:49:47 +00:00
Rupert Swarbrick 9f83cbd2b4 Use named constant for default RAM behaviour
The ibex_top_tracing module takes a ram_cfg_i for something to pass
through to the RAM. Use the named zero (RAM_1P_CFG_DEFAULT) instead of
building it by hand: now we get the right width.
2023-07-13 11:49:47 +00:00
Marno van der Maas 7139313ad3 [vendor] Minor alignment improvement 2023-07-06 07:55:47 +00:00
Marno van der Maas d33fc90375 [dv] Move DVSIM data structures
This is copied from OpenTitan 0bda971

Co-authored-by: Gary Guo <gary.guo@lowrisc.org>
2023-07-06 07:55:47 +00:00
Marno van der Maas a1d5d49d10 [dv] Add common_ifs_pkg.sv to DV files 2023-07-06 07:55:47 +00:00
Marno van der Maas 2b1e3de746 Update lowrisc_ip to lowRISC/opentitan@0deeaa99e
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
0deeaa99e5760ee4f5c0a08e5fc1670509d22744

* [dv] Fix extension parsing in memutil (Gary Guo)
* [dv,vcs] add an option to override debug_region vcs flag (Sharon
  Topaz)
* [bazel,dvsim] fix airgapped cquery bug (Tim Trippel)
* [prim_present/dv] Only test relevant configs and improve coverage
  (Michael Schaffner)
* [prim_lfsr/dv] Add tests to improve coverage (Michael Schaffner)
* [gpio/dv] Add second build mode for CDC prims (Michael Schaffner)
* bugFix sim_cfg.hjson.tpl (skfwe wang)
* [verilator] Add optional argument for trace file path (Alexander
  Williams)
* [dv] Fix multibit bug in interrupt test register prediction (Michael
  Schaffner)
* [dvsim] update sim.mk to accomodate OTP images under hw/ (Tim
  Trippel)
* [doc] Remove defunct sectionContent macros (James Wainwright)
* [util/uvmdvgen] Fix links in HW checklist template (Andreas Kurth)
* [governance] Add `SEC_CM_SCOPED` to D1 Checklist (Andreas Kurth)
* [dv/otp_ctrl] Fix cdc issue (Cindy Chen)
* [dvsim] add custom wavefile option (Jaedon Kim)
* [kmac,dv] fix regression - kmac_err (Jaedon Kim)
* [dv/clk_rst_if] Avoid freeze due to rst undriven (Guillermo
  Maturana)
* [top-level,clk_rst] Create separate clk_rst_if for xbar mode
  (Guillermo Maturana)
* [chip,dv] update flash_wrtie mappping (Jaedon Kim)
* [chip_tb] Integrate usbdpi into chip tb (Adrian Lees)
* [dv/cdc] Enable CDC in four more IPs (Guillermo Maturana)
* [dv/prim_alert] Enable CDC instrumentation (Guillermo Maturana)
* [dv/prim] Enable CDC instrumentation for some prims (Guillermo
  Maturana)
* [prim/rtl] Define `WITHIN_MARGIN` macro (Andreas Kurth)
* Remove out-of-date "mode" in dvsim (Rupert Swarbrick)
* [dv] Define `ASSERT_AT_RESET_AND_FINAL` macro (Andreas Kurth)
* [dv] Define `ASSERT_AT_RESET` macro (Andreas Kurth)
* [usb_diff_rx] Model pull-up behavior (Michael Schaffner)
* [doc] Fix `that that` typo (Douglas Reis)
* [doc] Fix `the the` typo (Douglas Reis)
* [doc] Fixed broken file links (Hugo McNally)
* [doc] Fixed links between books (Hugo McNally)
* [doc] Fixed some broken links to external sites (Hugo McNally)
* [doc] fixed links into github repos (Hugo McNally)
* [doc] removed link to private repo (Hugo McNally)
* [doc] Add DVSim design doc and glossary (Miguel Osorio)
* [doc] Add new DVSim README (Miguel Osorio)
* [doc] Move dvsim test planner into dvsim/doc (Miguel Osorio)
* Add function called by dvsim publish to trigger a website rebuild
  (Harry Callahan)
* [hw,dv_utils] Fix macro substitution issue with Xcelium (Raviteja
  Chatta)
* [bazel,dvsim] enable passing `--data-perm` flag through dvsim/bazel
  (Timothy Trippel)
* [doc] Updated documentation to reference the new build script. (Hugo
  McNally)
* [doc] Update simulation results link (Raviteja Chatta)
* [flash_ctrl] update `IPoly` parameter in flash scrambler (Timothy
  Trippel)
* [dvsim] Removed depreciated Universal Newline flag (Hugo McNally)
* [doc] Replace wavejson shortcodes with code-blocks (Hugo McNally)
* [doc] Rewrite most frontmatters to Markdown titles (Hugo McNally)
* [doc] Manually changed remaining hugo links (Hugo McNally)
* [doc] Replaced Hugo links with standard markdown (Hugo McNally)
* [doc] Created two initial mdbooks for new layout (Hugo McNally)
* [doc mv] `util/` doc files moved for new layout. (Hugo McNally)
* [doc mv] `hw/` doc files moved for new layout. (Hugo McNally)
* [doc mv] hw/ip* doc files moved for new layout. (Hugo McNally)
* [dv/verilator] Get '-c' flag of Verilator simulator working (Raphael
  Isemann)
* [lint,prim_generic] Turn off unused Verilator lint in clock buf
  (Marno van der Maas)
* [dv/util/sungrid] Fix issue when running sungrid in parallel (Eitan
  Shapira)
* [dv/common] Fix xelium enum type issue (Cindy Chen)
* [dvsim] Disable automatic timeout in gui mode (Cindy Chen)
* [dvsim] Publish json results if available (Andreas Kurth)
* [dvsim] Write json report to file (Andreas Kurth)
* [dvsim] Generate json from run results (Andreas Kurth)
* [dvsim] Add method to convert unit of JobTime (Andreas Kurth)
* [dvsim] Add option to disable normalization of JobTime (Andreas
  Kurth)
* [dvsim] Store coverage summary also in dict (Andreas Kurth)
* [doc] Improve various titles (Marno van der Maas)
* [doc] Added missing title headers (Marno van der Maas)
* [doc] Add TODO to empty stubs (Marno van der Maas)
* Add missing dependencies (Wojciech Sipak)
* [dv] Add build options after file list (Sharon Topaz)
* [rtl/prim] Fix prim_alert_receiver SVA for CDC (Guillermo Maturana)
* [dv] Make prim_secded_* toggle coverage 100% (Weicai Yang)
* [dv] Exclude prim_secdec_* in coverage collection (Weicai Yang)
* [secded/fpv] Remove data input assumption (Michael Schaffner)
* [fpv/prim_count] Add expected failure hjson (Cindy Chen)
* [dv, rv_dm] Fix scoreboard (Srikrishna Iyer)
* [dv, dv_macros] Expand DV_CLOCK_CONSTRAINT range (Srikrishna Iyer)
* [dv, dv_base_reg] Add `get_mask_from_fields` function (Srikrishna
  Iyer)
* [dv/xprop] Enable per-IP xprop configuration file (Guillermo
  Maturana)
* [dv] Change alert_test to run with default build mode (Weicai Yang)
* [dv,dvsim] Add run timeout multiplier option (Guillermo Maturana)
* [dv/shadowed_reg] Reduce a env_cfg variable (Cindy Chen)
* [dvsim] do not print status if `--interactive` (Eli Kim)
* [dvsim] Add unlimited timeout (Eli Kim)
* Revert "[dvsim] Add descriptions to timeout" (Eli Kim)
* [dvsim] Fix flake8 lint error (Eli Kim)
* [dvsim] Launch subprocess interactively (Eli Kim)
* [dvsim] Add `--interactive` argument (Eli Kim)
* [dvsim] Better dashboard result for parameterized blocks (Weicai
  Yang)
* create the log in a correct way (Sharon Topaz)
* Sungrid input from command file instead of command line (Sharon
  Topaz)
* [chip dv] Fix compile time warnings - Xcelium (Srikrishna Iyer)
* [dv] Clean up TODOs in csr_utils (Weicai Yang)
* [dv] Clean TODOs in mem_bkdr_* (Weicai Yang)
* [chip dv] Fix compile warnings in RTL and DV (Srikrishna Iyer)
* [dv] Resolve/clean up more TODOs (Weicai Yang)
* [dvsim] Add descriptions to timeout (Eli Kim)
* [fpv] Clean up strong property in simulation (Cindy Chen)
* [dv/xprop] Change code to be more xprop-friendly (Guillermo
  Maturana)
* [dv] Clean up TODOs in dv_lib (Weicai Yang)
* [chip dv] Implement the E2E JTAG debug and inject tests (Srikrishna
  Iyer)
* [dv, util] Add read_vmem function (Srikrishna Iyer)
* [dv str_utils_pkg] Add more string util methods (Srikrishna Iyer)
* [dv] Move sw_symbol_get_addr_size to dv_utils_pkg (Srikrishna Iyer)
* [dv, sim.mk] Copy elf file without .bin suffix (Srikrishna Iyer)
* [dv] Resolve TODOs in cip_macros (Weicai Yang)
* [prim_sparse_fsm_flop] Make DV statement x-prop safe (Michael
  Schaffner)
* [dv/cov] Exclude coverage of dv-only code (Guillermo Maturana)
* [dv/chip] Disable alert ping scb default check (Cindy Chen)
* [dv] ensure RAM ELF file gets copied to the rundir (Timothy Trippel)
* [dv] Use build seed to regenerate LC encoding for each build
  (Michael Schaffner)
* [dv/coverage_cfg] Remove coverage of prim_onehot_check (Guillermo
  Maturana)
* [prim] Add sync_req_ack based async FIFO (Michael Schaffner)
* [prim] Add RZ protocol to prim_sync_reqack* (Michael Schaffner)
* [dvsim] Move empty pattern list to common (Eli Kim)
* [prim] Reset assertion improvement (Canberk Topal)
* [prim_mubi*_sync] Remove explicit mux prim to improve coverage
  (Michael Schaffner)
* [fpv] Support build_pass_pattern in OneShotCfg (Cindy Chen)
* [dv] Increase MAX_CYCLE to 30 in sec_cm SVA (Weicai Yang)
* [dv_macros] Kill live assertions when disabling in `DV_ASSERT_CTRL`
  (Andreas Kurth)
* [dv, csr_utils_pkg] Add user frontdoor mechanism on all CSR methods
  (Srikrishna Iyer)
* [dv/chip] Support exclude certain alert injections in all_escalation
  test (Cindy Chen)
* [dv, csr_utils_pkg] Fix csr_read for field accesses (Srikrishna
  Iyer)
* [prim-cdc-rand-delay] Fix bug due to dv macro (Srikrishna Iyer)
* [verilator] Simulate GPIOs with weak pull up/down. (Chris Frantz)
* [dv,bazel] only copy over an ELF file if one exists (Timothy
  Trippel)
* [chip,dv,i2c] en_monitor update for top_earlgrey (Jaedon Kim)

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
2023-07-06 07:55:47 +00:00
Marno van der Maas bfe2c2f3c0 [vendor] Patch updated based on OpenTitan/36a2d3c 2023-07-06 07:55:47 +00:00
Greg Chadwick 96988c6ba0 [doc] Fix documented mstatus reset value
Fixes #2054
2023-07-04 09:21:18 +00:00
Greg Chadwick 4a75efde87 [ci] Constrain pydantic version to under v2.0
CI breakages are observed with v2.0
2023-07-04 09:21:18 +00:00
Greg Chadwick fbd070cf58 [dv] New directed test to cover some scenarios with U-mode execution
This directly stimulates cases where U-mode execution is attempted
against locked regions (and a region with no permissions).
2023-06-23 07:50:22 +00:00
Greg Chadwick 4e17587213 [dv] Fix SET_PMP_CFG macro used by directed tests
For some region numbers it would perform additional spurious writes to
the pmpcfg CSRs
2023-06-23 07:50:22 +00:00
Greg Chadwick a7845832a2 [dv,fcov] Add additional illegal bins to PMP fcov 2023-06-22 11:00:26 +00:00
Greg Chadwick 4fe6d89ed3 [dv, fcov] Increase iterations of riscv_mem_intg_error_test
This helps hit more coverage more reliably in particular for the
priv_mode_irq_cross cross coverage.

A better fix would adjust riscv_mem_intg_error_test to utilize U mode
more but it's a quick test for run so this suffices for now.
2023-06-22 10:15:49 +00:00
Rupert Swarbrick 97df7a5b10 Use correct format string for $value$plusargs
Not doing so causes VCS to spit out a warning message. The intention
seems to be that the initial call to $value$plusargs will evaluate to
true and will put the value that was assigned into the
disable_pmp_exception_handler variable, which then gets checked.
2023-05-26 10:58:20 +00:00
Rupert Swarbrick b94ed2813d Reorder classes in ibex_debug_triggers_overrides.sv
The previous version doesn't make sense if you read the classes in
exactly the order they are defined in the file. It turns out that this
is what VCS did: oops! Fortunately, the fix is pretty trivial: declare
the classes the other way around.
2023-05-26 10:58:20 +00:00
Rupert Swarbrick 4118f97595 Express some coverpoint crosses in an equivalent way
The previous code caused VCS to complain that the "with" clause didn't
use any of the constituent coverpoints. I *think* that VCS wasn't
understanding that cp_interrupt_taken[5:4] does indeed depend on
cp_interrupt_taken (concentrating on core_ibex_fcov_if for
concreteness).

Fortunately, the check is easy to express a different way. There, we
were just asking that the top two bits are zero. Another way to say
that is "if I shift everything else off the bottom, the result is
zero". So we say it that way.
2023-05-26 10:58:20 +00:00
Rupert Swarbrick 1985c767a2 Drop an import from inside of a class
This causes VCS to spit out an error because it's not technically
allowed in SystemVerilog. The only things that we needed to import
seems to have been the CSR_MHPMCOUNTER3* names. We can just refer to
them explicitly.
2023-05-26 10:58:20 +00:00
Rupert Swarbrick 3b34f803f5 Re-export imported symbols from ibex_mem_intf_pkg
Other code tries to pick up things like DATA_WIDTH through this agent
package, that it imports. That doesn't seem unreasonable, but VCS
complains because we're not re-exporting it here.
2023-05-26 10:58:20 +00:00
Rupert Swarbrick 1e0adfce68 Bump Spike minimum version
Some code we've got in Ibex uses some stuff we added to Spike last
October. That, in turn, is now tagged in our riscv-isa-sim repository
as ibex-cosim-v0.5. Update the version requirement here to match.
2023-05-26 10:57:41 +00:00
Rupert Swarbrick a31c0431b6 Correct type in scripts_lib.py's run_one
It seems that typeguard now spots if env happens to be None. We can
just relax things: we're only using env by passing it through to
subprocess.run, which handles a None env in the expected way.
2023-05-17 13:09:59 +00:00
Greg Chadwick 1084ac118e [dv] Add asserts to check alerts for memory integrity failures 2023-05-15 13:51:06 +00:00
Rupert Swarbrick 7a685b2224 Drop a double entry in rtl_simulation.yaml
We ended up with the Unicode fix twice because of two colliding PR
merges. We only need one copy of the -CFLAGS argument, and VCS
generates a rather strange message about an unknown argument if you
use it twice. Fortunately, it's easy to fix once you've worked out how
to get the system to print out what it's doing.
2023-05-15 08:42:06 +00:00
Greg Chadwick 10d4c97a0f [ci] Add missing dependency and fix RTD config
Cairo libraries are required for a python dependency.
New RTD config introduced to fix build errors introduced by new urllib.
We need to ensure the docs a built on a modern ubuntu with a
sufficiently new python (see
https://github.com/readthedocs/readthedocs.org/issues/10290).
2023-05-10 12:40:05 +00:00
Greg Chadwick 1120e8ddbf [dv] Improve interrupt signalling to cosim
Previously any changes in interrupt state or debug requests were
strictly associated with retired instructions. This causes cosim
mismatches where a lower priority interrupt occurs in time before a
higher priority interrupt or debug request but between instruction
fetches/retirements so both the low and high priority interrupts are
signalled with the instruction retirement.

This introduces a way for the RVFI to signal an interrupt has occurred
that isn't associated with an instruction retirement to allow the cosim
to see the seperation in time between different interrupts and debug
requests and hence model behaviour correctly.
2023-04-27 12:04:22 +00:00
Greg Chadwick e587f20d44 [rtl] Increase minimum delay for IRQ assertion in new sequence library
An IRQ asserting then deasserting when not explictly cleared by an
interrupt handler can lead to RTL/cosim mismatches in some cases.
Increasing the delay here minimises those instances.
2023-04-27 12:04:22 +00:00
Greg Chadwick 54040df15c [doc] Update RVFI extension information 2023-04-27 12:04:22 +00:00
Greg Chadwick 6bd50a97cb [dv] Improve coverage of priv_mode_irq_cross
This allows mie to be randomly enabled/disabled in memory integrity
error tests. It also corrects the illegal bins.
2023-04-25 15:14:31 +00:00
Greg Chadwick 5e3474c9da Remove TODOs
- rvfi_trap now correctly handled for writeback
 - issue created to track coverpoint for pmpcfg reserved bits writes.
 - flush pipe on debug CSR writes is reasonable
2023-04-25 14:23:34 +00:00
Greg Chadwick 033abfc09f [dv] Double fault detector should sample with clocking block 2023-04-18 16:49:41 +00:00
Saad Khalid 6e4352af10 Fixed capture info for spike cosim in case of multiple interrupts
Signed-off-by: Saad Khalid <saad.khalid@lowrisc.org>
2023-04-13 17:30:33 +00:00