Commit graph

782 commits

Author SHA1 Message Date
Canberk Topal
1ad55daf96 [dv] Randomize mstatus.mprv properly
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
Canberk Topal
c2f5fea8a9 [fcov] MPRV with Load/Store and RAW Hazard
Added in functional coverage interface

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
Canberk Topal
51bcae432b [rtl] PMP Logic Refactoring
This makes use of functions in a way that enables us to use `priv_lvl`
dependent logic in the DV environment.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
Canberk Topal
04ce927a74 [fcov] Add various coverage points
Mostly related to WFI, but also double fault and icache enable

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
Canberk Topal
f21b6545ac [fcov] CSR related coverage points
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
Canberk Topal
11002708ea xlm support for PMP coverage groups
Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-05-25 13:37:30 +01:00
Harry Callahan
c5567e8f66 Change makefile default simulator for core_ibex dv to xcelium 2022-05-23 17:24:12 +01:00
Rupert Swarbrick
6efb4b1597 Dump riscv-dv generation messages to a log file
I was previously just dumping them to /dev/null because the
code always worked but... predictably I was wrong! Write them
somewhere more useful for debug.
2022-05-19 17:34:41 +01:00
Rupert Swarbrick
efd289dc17 [core_ibex] Disable waves by default
This seems like something you'd want to enable explicitly, to avoid
filling up a disk on a big run.
2022-05-17 12:04:26 +01:00
Rupert Swarbrick
09d2dd2306 Update ISA strings from Xbitmanip to XZb*
This allows us to model stuff more closely. This depends on Spike
version ibex-cosim-v0.2 (which is rebased onto a master branch commit
supporting these more specific ISA strings).
2022-05-13 09:47:00 +01:00
Harry Callahan
832259401e Add warning when cosim is disabled by a plusarg
May aid in debugging
2022-05-12 11:01:36 +01:00
Harry Callahan
ef3549a2d3 Add pre_abort callback to cosim scoreboard for proper cleanup 2022-05-12 11:01:36 +01:00
Greg Chadwick
a0adf60d0b [dv] Fix bitmanip test building 2022-05-12 10:42:15 +01:00
Harry Callahan
0c38b203dd Run core_ibex dv with cosim by default 2022-05-11 15:46:46 +01:00
Harry Callahan
36129a2cb1 Modify existing comparison scripts to process cosim trace
Don't yet tear out the old logfile-comparision code, add a new path for the
cosim flow.

This uses the existing riscv-dv functions to parse the cosim logfile, as it is
fundamentally still generated by spike so should be checked for errors.
2022-05-11 15:46:46 +01:00
Harry Callahan
e34bb4d92f Construct compile-tb cmds to link against ISS for cosim
This is a continuation of PR's #1613 and #1575 work.

If cosim in enabled, we need to pass the appropriate flags to the eda tool for
it to link against the precompiled ISS when building the testbench.
This commit assembles the appropriate flags using pkg-config to query the
SPIKE_ISS build, then uses the scripts_lib.subst_vars() method to populate the
templated commands in the yaml.

The eda tools have different requirements for consuming the flags, so massage
them into the appropriate shape on the python side.
2022-04-29 11:13:21 +01:00
Harry Callahan
345dd6644b Fix variable-checking in makefile 2022-04-29 11:13:21 +01:00
Harry Callahan
d4c945622e Replace concatenation with mask operations
Make Xcelium happy
Add leading zero for readability (Addresses PR comment)
2022-04-29 11:13:21 +01: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
Canberk Topal
394a0d2160 Updating parameters for OpenTitan option
Updated the parameters with respect to top_earlgrey.hjson in OpenTitan
repository. For other builds, kept the previously undeclared parameters
as their default values.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-04-28 15:14:42 +01:00
Rupert Swarbrick
2f28987916 Remove some unused variables from core_ibex Makefile 2022-04-28 13:52:07 +01:00
Rupert Swarbrick
26f824b907 Infer PMP config from Ibex config in core_ibex scripts 2022-04-28 13:52:07 +01:00
Rupert Swarbrick
f6f84b0b06 Read config data in 2 steps in core_ibex scripts
No functional change, but this means we can look at the configuration
object to do other stuff without having to reload things.
2022-04-28 13:52:07 +01:00
Rupert Swarbrick
ecdb1e01f6 Remove ISA, ISA_ISS from Makefile
Move their calculation into the Python scripts, which means that we
don't have to make sure everything is kept in sync.
2022-04-27 16:33:49 +01:00
Rupert Swarbrick
b63ab3b120 Strengthen types in ibex_config.py
This should make it easier for other scripts to use
parse_config().
2022-04-27 16:33:49 +01:00
Canberk Topal
3ad3bd0d71 [dv] Coverage fixes
Makes coverage work for VCS and XLM.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2022-04-27 10:52:44 +01:00
Rupert Swarbrick
d6bc8a6f2c Fix relocation of files in run-instr-gen for riscv_csr_test
Commit a628007 broke this test (which uses different paths from all
the others: aargh!)
2022-04-26 15:55:37 +01:00
Rupert Swarbrick
8e1fb63ff3 Don't pass --iterations to list_tests.py if not overriding it
This fixes a bug introduced by 14c400c, where I sort of half made this
change but didn't follow through the whole way!
2022-04-26 11:11:52 +01:00
Rupert Swarbrick
f082cf2351 Rationalize paths in core_ibex Makefile and scripts
Now we have the following structure (for an example where we've just
run seed 123 of riscv_arithmetic_basic_test):

    out/
    +- build/
    |  +- tb/
    |  |    (built testbench)
    |  +- instr-gen/
    |  |    (built instruction generator)
    +- run/
       +- riscv_arithmetic_basic_test.123/
       |  +- test.S
       |  +- test.o
       |  +- test.bin
       |  +- rtl.log
       |  +- trace_core_00000000.log
       |  +- spike.log
       |  ... (some more log files etc. here)
       +- fcov/
       |    (architectural fcov from riscv-dv)
       +- coverage/
       |    (merged coverage data)
       +- regr.log
       +- regr_junit.xml
       +- regr_junit_merged.xml
2022-04-26 10:57:30 +01:00
Rupert Swarbrick
ca4b655564 Delete some Makefile variables that we're not using any more 2022-04-26 10:57:30 +01:00
Rupert Swarbrick
7ac622c23b Allow compiling the TB when the working directory isn't core_ibex
This makes things much easier for OpenTitan integration.
2022-04-25 16:50:54 +01:00
Rupert Swarbrick
c2bead628a Simplify Makefile flow by removing sim_makefrag_gen.py
This used to work by dumping a Makefile fragment, reading it back in,
and then passing the relevant options through to the RTL compile and
run scripts.

This commit switches things around so that the RTL compile and run
scripts just look up the options when they need them.
2022-04-25 15:57:57 +01:00
Rupert Swarbrick
14c400c1e7 Factor out guts of list_tests.py
No functional change, but the point is that we can vendor this into
OpenTitan where dvsim can load up the Python library and get something
sensible without having to call a subprocess and mess around with
string parsing.
2022-04-25 13:51:02 +01:00
Rupert Swarbrick
668856441a Drop the "tb copy" stage of running a simulation
I don't quite understand why I thought this was needed: perhaps some
holdover from riscv-dv expecting files to be a certain shape? Anyway,
no need to keep it now.
2022-04-22 16:17:23 +01:00
Rupert Swarbrick
a628007826 Split calls to run-instr-gen.py 2022-04-22 16:17:23 +01:00
Rupert Swarbrick
a58fb02b68 Remove unused --lsf-cmd argument from run-rtl.py 2022-04-22 16:17:23 +01:00
Rupert Swarbrick
b4f5f17e4d Split calls to compile-generated-tests.py
This also involves a bit of file renaming, which makes the stuff
downstream a bit easier.
2022-04-22 16:17:23 +01:00
Rupert Swarbrick
b06f30b8a0 Split calls to run-iss.py
Now we call it once for each test and seed instead of getting riscv-dv
to iterate over all the tests and seeds we've requested.
2022-04-22 16:17:23 +01:00
Rupert Swarbrick
19d60932d5 Move read_test_dot_seed Python code to a helper library 2022-04-22 16:17:23 +01:00
Rupert Swarbrick
35a63d7e66 Change scripts_lib run_one to provide "redirect_stdstreams" 2022-04-22 16:17:23 +01:00
Rupert Swarbrick
3e42d128cd Write instr-gen build output to a log file, rather than stdout 2022-04-22 16:17:23 +01:00
Rupert Swarbrick
9dfdc800b7 Build insn generator in a different directory from where it runs
This isn't how riscv-dv wants to work! So we do a rather nasty hack in
run-instr-gen.py and rewrite the paths that come out of riscv-dv on
the fly.

Note that we don't move the instruction generator build vars to
something like $(OUT-DIR)/instr_gen/.build.vars.mk. The problem is
that the dumping of these variables runs as part of evaluating the
rule that builds the instruction generator (before the rule actually
runs). The end result is that you would end up writing them to the
directory and then immediately deleting the directory, causing
spurious rebuilds.
2022-04-22 16:17:23 +01:00
Rupert Swarbrick
87fb0b7906 Move pre-build tidyup into Python for build-instr-gen.py 2022-04-22 16:17:23 +01:00
Rupert Swarbrick
5a9b5b9993 Revert "Remove COMPILE_OPTS from Makefile"
This reverts commit 1f57795: these options are needed for plumbing
Ibex configs through. I've got a follow-up that does this more neatly,
but that depends on some other scripting changes so let's revert the
breakage for now.
2022-04-22 16:17:23 +01:00
Rupert Swarbrick
1c02f450d6 Revert "Remove SIM_OPTS from Makefile"
This reverts commit 014b544: these options are needed for plumbing
Ibex configs through. I've got a follow-up that does this more neatly,
but that depends on some other scripting changes so let's revert the
breakage for now.
2022-04-22 16:17:23 +01:00
Rupert Swarbrick
09cfe83191 Tidy up the sim.py wrapper script and rename it merge-cov.py
Also, update the copyright notice to be lowRISC: we've rewritten
pretty much the entire file, so I don't think it really makes sense to
describe it as copyright Google any more.

While we're at it, we slightly simplify the plumbing for Xcelium,
which means we don't have to export any Xcelium-specific environment
variables from the Makefile any more.
2022-04-22 13:02:15 +01:00
Rupert Swarbrick
f7863ce57c Move run_rtl wrapper into scripts lib 2022-04-22 13:02:15 +01:00
Rupert Swarbrick
8fd1a0df50 Add a wrapper script for building the core_ibex UVM testbench
This kind of existed already, but this tweaks things so that it's the
same shape as the other scripts we're adding and (hopefully) the
Python gets a bit cleaner.
2022-04-22 13:02:15 +01:00
Rupert Swarbrick
014b5443b8 Remove SIM_OPTS from Makefile
Again, this isn't used by anything and just adds complexity.
2022-04-22 13:02:15 +01:00
Rupert Swarbrick
1f57795468 Remove COMPILE_OPTS from Makefile
Again, this isn't used by anything and just adds complexity.
2022-04-22 13:02:15 +01:00