Commit graph

2495 commits

Author SHA1 Message Date
Michael Schaffner
3264fe85c6 Update fetch enable encoding
This is done to match the encoding update done in the OpenTitan repo
here: https://github.com/lowRISC/opentitan/pull/12153

Signed-off-by: Michael Schaffner <msf@google.com>
2022-04-19 15:11:25 +01:00
Rupert Swarbrick
8d044a3ddc Replace dump-vars line for ISS runs
I accidentally deleted this in commit 9e0e0cd01.
2022-04-14 12:19:30 +01:00
Harry Callahan
6cc2d6149e Nit: remove some comments that got duplicated in 4854a131 2022-04-14 11:34:27 +01:00
Rupert Swarbrick
aa7168d3bd [dv] Tweak ibex_dv.f so we can use it in OpenTitan
It turns out that there aren't many changes needed, but we need to be
able to point at a prim directory that might not be inside
vendor/lowrisc_ip: put that path in an environment variable and pass
it from core_ibex/Makefile. That way, a caller on the OpenTitan side
can just override the corresponding variable and everything works.
2022-04-14 11:06:03 +01:00
Rupert Swarbrick
7fd03d4406 [dv] Add missing entries to ibex_dv.f
Oddly, changing how we do paths (in the next commit) caused the build
to fail without them. I don't understand why it worked before!
2022-04-14 11:06:03 +01:00
Rupert Swarbrick
903d895750 Fix spurious rebuilds from dumped vars
Commit f49f452f2 greatly tidied up the file, which is nice, but also
introduced some whitespace around the first argument to vars-prereq.
In Make, this causes chaos!

In particular, we ended up checking whether a variable called
something like "$(last-   gen  -vars-loaded)" was defined. It isn't,
but $(last-gen-vars-loaded) is.

Call strip in the vars-prereq function to get rid of the whitespace at
the "entry point" for all this machinery.
2022-04-14 09:44:47 +01:00
Rupert Swarbrick
9e0e0cd014 Add a wrapper script for running tests in ISS 2022-04-14 09:40:16 +01:00
Rupert Swarbrick
6dc5c0ed84 Add a wrapper script for compiling generated tests 2022-04-14 09:40:16 +01:00
Rupert Swarbrick
2dc7765081 Add a wrapper script for running the instruction generator 2022-04-14 09:40:16 +01:00
Rupert Swarbrick
9b14d0c908 Add a wrapper script for the instruction generator build
This is the first such script, but the idea is that we're going to
move a bunch of logic out of the Makefile and into Python scripts
where things are a bit easier to understand.
2022-04-14 09:40:16 +01:00
Rupert Swarbrick
a0638a8592 Move empty line avoidance into construct_makefile.py
Before we were running sed, but that's not so convenient from a
script. Since skipping empty lines is pretty easy, let's just do it in
Python.
2022-04-14 09:40:16 +01:00
Rupert Swarbrick
dcc7f85c84 Move guts of construct_makefile into a function
This means that other Python scripts can run it without needing a
subprocess.
2022-04-14 09:40:16 +01:00
Rupert Swarbrick
cb0c81a76f Move construct_makefile.py into the scripts directory 2022-04-14 09:40:16 +01:00
Rupert Swarbrick
60a04fdc3c Add an underscore prefix to RISCV_DV_OPTS in core_ibex Makefile
This isn't supposed to be something that people update manually.
Remove it from instr-gen-build-var-deps, since it's not something that
should ever change under our feet.
2022-04-14 09:40:16 +01:00
Rupert Swarbrick
d1b98d0ece Remove LSF_CMD from core_ibex Makefile
We're not using this and I strongly doubt that it actually works. Drop
the technical debt: we can always put something back in if we need to
in future.
2022-04-14 09:40:16 +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
Michael Schaffner
ccc9bef3ec [regfile] Add countermeasure label
Signed-off-by: Michael Schaffner <msf@google.com>
2022-04-13 14:36:52 -07:00
Michael Schaffner
cfd9b45cfc [regfile] Add spurious write enable check for secure ibex
Signed-off-by: Michael Schaffner <msf@google.com>
2022-04-13 14:36:52 -07:00
Michael Schaffner
91745a076c Update lowrisc_ip to lowRISC/opentitan@1740ccd1a
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
1740ccd1ad19f83bf2cec120c87b807b9af2ca1b

* [prim_onehot_check] Add address-based check (Michael Schaffner)
* [flash_ctrl] convert flash config to mubi (Timothy Chen)
* [sw,tests] Enter RMA LC_STATE and check flash access and wipe (Dave
  Williams)
* [prim_onehot_check] Add lint waivers (Michael Schaffner)
* [prim] Stub out guts of prim_cdc_rand_delay for Verilator (Rupert
  Swarbrick)
* [prim] Add missing waiver (Timothy Chen)
* [prim_onehot_check] Add prim_onehot_check (Michael Schaffner)
* [dv] Add TL error case - write with instr_type = True (Weicai Yang)
* [cdc-rand] Enable CDC random delay injection (Srikrishna Iyer)
* [fpv/pinmux] Add tl integrity error check (Cindy Chen)
* [prim_assert] Add static assertion macro for checks in pkgs (Michael
  Schaffner)
* [prim] Add prim_blanker (Greg Chadwick)
* [prim, rtl] Add new onehot primitives (Greg Chadwick)
* [dvsim] Fix looping through old result directories (Cindy Chen)
* [chip dv] Fixes for tests failing in nightly (Srikrishna Iyer)
* [present] Rewrite TB to avoid non-freely licensed code (Rupert
  Swarbrick)
* [secded_gen] Fix a bug in inverted Hamming codes (Michael Schaffner)
* [prim,rtl] Fix RW collision bug in prim_1p_ram_scr (Greg Chadwick)
* [dvsim,xcelium] Fix sed commands to generate plusargs (Rupert
  Swarbrick)
* [dvsim,xcelium] Split two plusarg strings (Rupert Swarbrick)
* [dvsim] Add a missing newline to error message (Rupert Swarbrick)

Signed-off-by: Michael Schaffner <msf@google.com>
2022-04-13 14:36:52 -07:00
Harry Callahan
d819fa6296 Fixup .rtl.tb_compile vars.mk filename
This was forcing rebuilds continuously
2022-04-13 20:31:15 +01:00
Harry Callahan
f49f452f2a Improve docs explaining Makefile variable dependencies 2022-04-13 16:14:20 +01:00
Harry Callahan
b4eb7323f7 Add better dependencies for the coverage targets using stampfiles 2022-04-13 16:14:20 +01:00
Harry Callahan
9b52fc132a Handle stdstreams from submakefile commands cleanly
Some commands utilise a logfile argument, while others capture the stdstreams
into a file. Discard the stdout/stderr when a logfile argument is used.
This keeps the logs readable.
2022-04-13 11:42:25 +01:00
Harry Callahan
7083d669c6 Add parallelism to instr_gen_run and iss_sim steps
This commmit enables parallelism of more steps of the dv process by capturing
the commands generated by the riscv-dv tool, then populating and executing a
sub-makefile. This allows us to have parallelism at the level of the makefile
jobserver.
Seperated instr_gen build and run steps

A python script construct_makefile.py is used to capture the raw output commands
and construct a trivial makefile for each stage.

This commit also renames some of the helper variables and stamps for consistency.
2022-04-13 11:42:25 +01:00
Harry Callahan
9ba58db30a Changed whitespaces to be consistent throughout Makefile
- Every line in a recipe must start with a tab, except wrapping lines of dependencies.
- Wrapping dependencies of a target use only spaces. Use two spaces by default.
2022-04-13 11:42:25 +01:00
Michael Schaffner
6caf82c2b4 [lint] Minor fixes
Signed-off-by: Michael Schaffner <msf@google.com>
2022-04-12 08:38:35 -07:00
mbaykenar
2ae62c145c assign irq_nm_int_cause to all zeros 2022-04-12 15:23:44 +01:00
mbaykenar
eeedeb003a Update ibex_controller.sv
Vivado gives synthesis error complaining about assignment of irq_nm_int_cause to '0 by saying it is an enum type.

Change the assignment to NMI_INT_CAUSE_ECC, which is defined to 5'b0 in ibex_pkg.sv
2022-04-12 15:23:44 +01:00
Rupert Swarbrick
1f6bcb9ab5 [dv] Remove support for building against ibex-cosim-v0.1 2022-04-12 11:09:33 +01:00
Rupert Swarbrick
ddb069bc1c [ci,docs] Bump minimum Spike version to ibex-cosim-v0.2 2022-04-12 11:09:33 +01:00
Rupert Swarbrick
0a9f5ed1da [rtl] Remove "mispredict" ports from icache
These are no longer needed: a previous commit has moved the logic that
handles misprediction into the IF stage and branch_mispredict_i was
dead zero.
2022-04-04 16:56:04 +01:00
Rupert Swarbrick
618f1f08bd [rtl] Remove "mispredict" ports from prefetch buffer
These are no longer needed: a previous commit has moved the logic that
handles misprediction into the IF stage and branch_mispredict_i was
dead zero.
2022-04-04 16:56:04 +01:00
Rupert Swarbrick
59a4d11c10 [rtl] Combine the two branch signals in the IF stage
The prefetch buffer and icache both treat the branch_i and
branch_mispredict_i signals identically, so it's a bit cleaner to pull
that treatment up into ibex_if_stage.sv

This commit doesn't change the modules below: it just passes zeros for
the "mispredict" version. Removing those ports will be done in a
follow-up commit.
2022-04-04 16:56:04 +01:00
Canberk Topal
a3e5eebffa [dv,fcov] Timeout fix + removing .ccf from yaml
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-04-04 15:33:14 +01:00
Canberk Topal
9acd2583e1 Update google_riscv-dv to google/riscv-dv@6e0dc18
Update code from upstream repository https://github.com/google/riscv-
dv to revision 6e0dc183a4678bfd581c1021b5ab7705f31d14a5

* [XCelium] Enable coverage collection with XCelium (Canberk Topal)

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-04-04 15:33:14 +01:00
Canberk Topal
d659c96cda Update lowrisc_ip to lowRISC/opentitan@3a33c4df2
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
3a33c4df2ed31b0d7a8936531a4ae9a275177f1b

* [prim,rtl] Pass addr_i in no scrambling case (Canberk Topal)
* [dvsim,xcelium] Avoid an OPTP2ND error if a plusarg isn't set
  (Rupert Swarbrick)
* [dv,tcl] Merge Coverage Databases with union_all (Canberk Topal)
* [prim_count] Add missing include (Pirmin Vogel)
* [sram_ctrl] Additional write gating based on intg error (Michael
  Schaffner)
* [sram_ctrl] Remove nonce reversal to improve timing (Michael
  Schaffner)
* [sram_ctrl] Retime address mux to improve timing (Michael Schaffner)

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-04-04 15:33:14 +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
Canberk Topal
4a2427cd32 Fix cov_report directory in sim.py
Enables us to save coverage groups text file which helps easily see the overall
coverage in a regression.
2022-04-01 15:46:32 +01:00
Pirmin Vogel
db926e5ef5 [ram_2p] Set DataBitsPerMask parameter for prim_ram_2p
It turned out that with the default value of 1, Vivado infers a separate
18 Kbit BRAM instance for each bit of the 32-bit word for the FPGA
examples. This can be very wasteful in terms of resource utilization
especially for smaller configurations.

As our examples don't use ECC or parity and mainly target simualation
and FPGA, it's better to use a value of 8 for the DataBitsPerMask
parameter. Vivado will then not distribute words across different BRAM
instances which results in more efficient FPGA resource utilization.

For a detailed analysis and explanation, please refer to
lowRISC/Ibex#1587.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2022-04-01 16:32:45 +02:00
Pirmin Vogel
fe3e029108 Update google_riscv-dv to google/riscv-dv@cb4295f
Update code from upstream repository https://github.com/google/riscv-
dv to revision cb4295f9ce5da2881d7746015a6105adb8f09071

* Update list search (Matthew Ballance)
* Trap and report exceptions encountered in sub-processes and
  propagate error back (Matthew Ballance)
* Workaround fix for loop test colon issue (aneels3)
* Fix typo (aneels3)
* Add support for RV64AFD (aneels3)
* Fix typo (aneels3)
* Update README.md (aneels3)
* Add support for sub_programs (aneels3)
* fix issue with imm value for 64 bit instr (aneels3)
* Allow for underscores and capital letters in ISA for ISS (Pirmin
  Vogel)
* implement rv64i (shrujal20)
* Add support for RV32FD coverage (aneels3)
* Integrate random seed for pyflow (aneels3)
* Add riscv_loop_test (ShraddhaDevaiya)

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2022-04-01 16:15:35 +02:00
Canberk Topal
2fc4cde7d2 [dv,xlm] Pass simulator flag to cov.py in Makefile
Enables us to work with only xlm licences when doing the coverage.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-03-31 15:36:06 +01:00
Canberk Topal
4c1a4ed1df Update lowrisc_ip to lowRISC/opentitan@0747afbdd
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
0747afbddec0ad176980429fe3100b32edb71d4a

* [dv] Enable C/C++ code sourcing with VCS in .core (Canberk Topal)
* [dv/dv_base_reg] Remove duplicated `get_map_by_name` method (Cindy
  Chen)
* [prim] Pulse Sync assertion to check input/output (Eunchan Kim)
* [sparse_fsm_flop] Create flop macro to increase DV coverage (Michael
  Schaffner)
* [dvsim] Make build-randomization opt-in (Srikrishna Iyer)
* [xcelium] Fix compile error (Srikrishna Iyer)
* [dv/cov] fpv_csr_assert only collect assertion coverage (Cindy Chen)
* [dv/jtag] Fix chip_level jtag csr rw failure (Cindy Chen)
* [rtl] Convert some non-ANSI parameters to localparams (Rupert
  Swarbrick)
* [prim] Waive unused parameters for Verilator in prim_generic_otp
  (Rupert Swarbrick)
* [prim] Make a variable widening explicit in prim_present.sv (Rupert
  Swarbrick)
* [prim] Waive some ALWCOMBORDER Verilator warnings in prim_arbiter_*
  (Rupert Swarbrick)
* [prim] Fix Verilator lint warnings in prim_gf_mult.sv (Rupert
  Swarbrick)
* [prim] Make some widening comparisons explicit in prim_clock_*.sv
  (Rupert Swarbrick)
* [prim] Waive unused EnableAlertTriggerSVA for verilator lint (Rupert
  Swarbrick)
* [bazel,dvsim] Add build rules for dvsim.py (Timothy Trippel)
* [prim] Fix a bunch of Verilator lint errors in prim_packer.sv
  (Rupert Swarbrick)
* [prim_sparse_fsm_flop/lint] Move waiver to correct file (Michael
  Schaffner)
* [rv_dm dv] Test drive compile-time seed (Srikrishna Iyer)
* [dvsim] Introduce Verilog compile-time seeds (Srikrishna Iyer)
* [dvsim] Treat `tests: ["N/A"]` as an ignored testpoint (Srikrishna
  Iyer)
* [hw/dv] Removed colon from Questa build and run fail patterns.
  (David Pudner)
* [hw/dv] Code review changes for running questa simulations. (David
  Pudner)
* [hw/dv] Added apache license header to questa_initial_setup.sh.
  (David Pudner)
* [doc/ug] Updated opentitan documentation to include information
  about Questa use. (David Pudner)
* [hw/dv] Added Questa dvsim files (David Pudner)
* [dv/unr] Blackbox common security modules from UNR flow (Cindy Chen)
* [dv] Minor fix to error message in mem_model.sv (Rupert Swarbrick)
* [keymgr] Update keymgr to use prim_edn_req (Timothy Chen)
* [doc] Fix rendering of special characters in testplan table (Rupert
  Swarbrick)
* [dv] enable tlul_assert for csr part2 (Rasmus Madsen)
* [dv] Enable tlul_assert for CSR tests (Weicai Yang)
* [dv] Add valid/ready req/ack coverage for push_pull agent (Weicai
  Yang)
* [dv,verilator] Make multiple sim_ctrl extensions play nicely (Rupert
  Swarbrick)
* [chip dv] Add AST initialization routine (Srikrishna Iyer)
* [top] auto generate (Timothy Chen)
* [reggen] Make field 'qe' behavior consistent (Timothy Chen)
* [prim] IFDEF_CODE waiver in sparsefsm flop (Eunchan Kim)
* [dv] Update checklist for all blocks (Weicai Yang)
* [dv/entropy_src] Temp remove stress_all_with_rand_reset test (Cindy
  Chen)

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-03-31 15:20:56 +01:00
Canberk Topal
68b56ef0f5 Include the main C++ file only with Verilator
This is necessary for having VCS support with simple system example.
Because in the ibex_simple_system_main.cc we are including some
Verilator exclusive header files.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-03-31 14:26:29 +01:00
Canberk Topal
db0b89a7ed [dv,xlm] Save each UCM file in <test_name>.<seed>
This enables to have a coverage report in instances where we have
different types of tests.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-03-31 14:11:12 +01:00
Canberk Topal
6884f6b990 Coverage support with Cadence Tools
Enables coverage collection while running the ibex-dv with xcelium.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-03-30 17:11:17 +01:00
Prajwala Puttappa
2317bb7fc0 [icache, dv] Added ram interface and enables ecc error injection.
This commit adds ibex_icache_ram_if to connect between DUT and tag /
data RAMs.

This interface injects 1 or 2 bit error on rdata if enable_ecc_errors
bit is set. It also checks that ecc_err_o pin is asserted by DUT
whenever an ecc error is injected.

ibex_icache_ecc_vseq and ibex_icache_base_vseq have been modified to
inject ecc errors through the ram interface.
2022-03-29 16:06:44 +01:00
Prajwala Puttappa
eea478be51 [icache, dv] Removed ecc agent
This commit removes ecc agent from the testbench. Following PRs will add
changes to drive the rdata pin (input to icache) with 1 or 2 bits
flipped.
2022-03-29 16:06:44 +01:00
Harry Callahan
98931c7dff Remove logfile param in Ibex RTL Sim for Xcelium
Fixes a bug where both Xcelium and Python open the same sim.log file and race to
write the simulation results into it. This change makes Python the sole writer of this
file using the captured stdout/stderr from the subprocess.run call in
run_rtl.py.

This bug was also previously present for VCS but was fixed in 90ff7ca6c.
2022-03-28 17:50:22 +01:00