Commit graph

846 commits

Author SHA1 Message Date
udinator
c914ec5e6a
update testlist typo (#593)
Signed-off-by: Udi <udij@google.com>
2020-02-07 11:27:53 -08:00
udinator
d4cb1a30ae
[dv] enable PMP (#588)
Signed-off-by: Udi <udij@google.com>
2020-02-06 11:54:56 -08:00
Pirmin Vogel
2a42c23eaf [rtl] Decouple mip and mie CSRs
This commit modifies the `mip` CSR to not depend on the `mie` CSR. While
the values of both these CSRs are combined to decide whether an
interrupt shall be handled, the RISC-V spec does not state that the
content of of `mip` should depend on `mie`. This commit better aligns
Ibex with other open-source RISC-V cores.

This resolves lowRISC/ibex#567 reported by @pfmooney.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2020-02-04 16:15:38 +01:00
Tobias Wölfel
6708ba62ac Extend riscv-compliance description
Include all tests in the description which can be executed for Ibex and
riscv-compliance.
2020-02-04 14:56:40 +00:00
Luís Marques
ed8bcc0d33 [verilator] Fix ELF loading
In `VerilatorMemUtil::WriteElfToMem`, the verilator memory is written
with the ELF segment data, 4 bytes at a time . If the segment size isn't
a multiple of 4 (e.g. when using the RISC-V C extension) the last word
wouldn't be written. This patch rounds the size up to a multiple of 4,
solving that issue.
2020-02-03 08:32:13 +00:00
Greg Chadwick
639964514c [RTL] Added seperate ALU for branch target
On branches now compute target same cycle as the condition.  This
removes a stall cycle from all taken conditional branches.
2020-01-31 09:32:20 +00:00
udinator
32a69899a9
[dv] Fix a missed Riviera compile warning (#576)
Signed-off-by: Udi <udij@google.com>
2020-01-30 09:22:45 -08:00
Daniel Mlynek
6d26025019 [DV] Add support for Riviera
Add support to call Riviera for our DV code. Tested with Riviera
2019.10.
2020-01-30 09:27:14 +00:00
Daniel Mlynek
b90b1aa683 Work around Riviera 2019.10 issue
This is a Riviera issue and will be fixed in a next release. Add a
workaround in the meantime.

Riviera issue reference: DZI370
2020-01-30 09:27:14 +00:00
Daniel Mlynek
885ac78583 [DV] Use const instead of parameter
Riviera do not support parameters of dynamic/associate/queue array types.
The SV standard does not say explicitly that such code is legal.
IMHO this code is at least controversial as dynamic nature of such array
types are against static nature of parameters. It would be better to change
this "implemented_csr" from parameter to const.
2020-01-30 09:27:14 +00:00
udinator
2e258c8521
Riviera compile warnings (#572)
* [dv] fix compilation +incdir option

Signed-off-by: Udi <udij@google.com>

* [dv] Fix missing enum cast issues in Riviera compile

Signed-off-by: Udi <udij@google.com>
2020-01-28 15:32:21 -08:00
Daniel Mlynek
9a80025498 Specify boot address in decimal
Riviera cannot parse the file list if it contains a single quotation
mark (TCL parsing is used).
2020-01-28 14:46:48 +00:00
udinator
43752a6c19
[DV] Test debug requests during interrupt handler execution (#565)
Signed-off-by: Udi <udij@google.com>
2020-01-23 16:21:57 -08:00
udinator
f339f6b96b
[DV] Test nested interrupts (#560)
Signed-off-by: Udi <udij@google.com>
2020-01-23 15:11:54 -08:00
udinator
9d7b07f0f7
[DV] Add test to assert interrupts during debug execution (#524) 2020-01-16 11:43:44 -08:00
udinator
80067b077c
[DV] Add riscv-dv target for ML (#556)
Signed-off-by: Udi <udij@google.com>
2020-01-14 14:11:57 -08:00
udinator
0c55214380
Enable coverage collection and merging for Incisive sims (#552)
Signed-off-by: Udi <udij@google.com>
2020-01-10 16:46:33 -08:00
udinator
b318b96964
[DV] update ibex log parsing to match new riscv-dv csv format (#547)
Signed-off-by: Udi <udij@google.com>
2020-01-09 14:46:50 -08:00
Pirmin Vogel
25e0390733 [dv] Add performance monitor counters to CS register TB
This commit adds the performance monitor counters to the CS register
testbench. Mismatches in `mcycle(h)` are currently being ignored as the
cycle counter is expected to increment with every clock cycle (unless
deactivated).

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2020-01-06 14:21:01 +01:00
Pirmin Vogel
15ec62a356 [dv] Add WARL register class to CS register TB
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2020-01-06 14:21:01 +01:00
Tobias Wölfel
17d69d1cd6 [DV] Continue argument parsing
In case one of the arguments is '-h' the parsing of the arguments is
aborted and only `PrintHelp()` of *verilator_sim_ctrl.cc* is executed.
Do not abort at this point in order to forward the arguments to the
registered extensions. This allows to execute the respective
`PrintHelp()` function and print the help message. For example
`VerilatorMemUtil` needs to parse the arguments in order to print the
help message.
The execution of the simulation is still terminated as `exit_app` is set
and then evaluated after parsing of the registered extensions.
2020-01-02 14:15:53 +01:00
Bryan Cantrill
6885c9e937 [verilator] Fix ELF processing
As described in https://github.com/lowRISC/opentitan/issues/1245,
the Ibex Verliator ELF processing does not exactly follow the algorithm
for the "binary" target of objcopy (which it is intended to mimic).
In particular, sections as denoted by program headers are laid down
strictly sequentially, ignoring their specified p_paddr -- and
resulting in a corrupted in-memory image for ELF images that have
unordered program headers.
2019-12-31 17:05:23 +01:00
Philipp Wagner
7fe01cc283 SimCtrlExtension: Add a default destructor
This base class needs a default destructor for potential future extensions.

Signed-off-by: Philipp Wagner <phw@lowrisc.org>
2019-12-24 10:08:59 +01:00
Tom Roberts
0a2ca9a399 [verilator] Modify verilator examples for memutils
- Memory loading utilities are split out into a separate class
- Relates to #317
2019-12-23 21:35:30 +01:00
Tom Roberts
e45e314686 [verilator] Separate out memory loading utilities
- Split memory utils out of VerilatorSimCtrl
- Allows VerilatorSimCtrl to be used in systems not requiring memory loading
- Fixes #317
2019-12-23 21:35:30 +01:00
Pirmin Vogel
0778008f33 [rtl] Remove X assignments, add SVAs for selector signals
This commit replaces all X assignments in the RTL with defined
values. In addition, SystemVerilog Assertions are added to catch
invalid signal values in simulation. A new file containing the
corresponding assertion macros is added as well.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2019-12-20 10:09:09 +01:00
udinator
a28bcfa485
[DV] Fix TB read responses (#531)
Signed-off-by: Udi <udij@google.com>
2019-12-18 10:53:29 -08:00
udinator
7fef1b5afc
[DV] fix incorrect irq_seq handle name (#525)
Signed-off-by: Udi <udij@google.com>
2019-12-16 16:18:47 -08:00
udinator
74e8c3fec6
[DV] update MISA csr yaml description (#513) 2019-12-16 13:39:00 -08:00
udinator
5d66a865cd
[DV] Enable sending multiple interrupts at once (#519) 2019-12-16 13:15:12 -08:00
udinator
c246a2aeb9
[DV] update override to riscv_asm_program gen in Makefile (#520) 2019-12-16 13:13:59 -08:00
Greg Chadwick
328aabb548 [RTL] Only restore from mstack in nmi mode
Fixes #492
2019-12-16 19:51:22 +00:00
udinator
8568e6b3b5 [DV] add support_unaligned_load_store setting (#521)
Signed-off-by: Udi <udij@google.com>
2019-12-13 13:44:18 -08:00
udinator
f23b3f39fa
[DV] Fix xRET wait checks (#515)
Signed-off-by: Udi <udij@google.com>
2019-12-12 11:28:16 -08:00
Tom Roberts
088cd11593 [dbg] Add minimal hardware breakpoint support
- Add the minimum amount of trigger system to support GDB hbreak
- Only a single trigger is implemented
- Only instruction address matching
- Only break into debug mode (no native debug)
- Fixes #382

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2019-12-11 15:02:06 +00:00
Tobias Wölfel
cd39a31498 [verilator] Clarify ELF BSS handling
Add a requirement for the software loaded by the simulator for zero-ing
the BSS section.

Fixes lowRISC/ibex#496
2019-12-04 19:42:11 -05:00
Taras Dulibianyk
50682bd314 RTL simulation scripts for Cadence tool was added 2019-12-04 07:32:27 +00:00
Taras Dulibianyk
9c981b198e Pluseargs parsing was corrected 2019-12-03 16:23:50 +00:00
Tom Roberts
4a3abee9b2 [ci] Add CS registers TB to CI
Add a return code to TB which Verilator sims can check
Build and run TB, checking for failures

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2019-12-03 15:38:56 +00:00
Philipp Wagner
82e0faf50b Make VerilatorSimCtrl class a singleton
The VerilatorSimCtrl class was always intended to be used only once in
an application, since it sets up a global signal handler and needs to be
accessible from DPI modules. This accessibility was achieved through a
global variable `simctrl`.

With this commit the VerilatorSimCtrl is switched to a singleton class.
The instance is accessible through `VerilatorSimCtrl::GetInstance()`.
The downside of that approach is that we loose the constructor
arguments, and need to deal with a class which potentially hasn't top or
the clock and reset signals set.
2019-12-02 10:57:24 +00:00
Philipp Wagner
71a635ec6b Reverse return code of simutil_verilator_set_mem()
All functions in simutil_verilator return booleans to indicate
success/failure, where 1 == true, and 0 == false.
simutil_verilator_set_mem() returns an int due to DPI interface
restrictions. Before, 0 meant success, and 1 meant error.

To keep things nice and consistent, turn things around and align with
the bool meaning.
2019-11-28 18:45:11 +00:00
Tobias Wölfel
ce7e38351e [DV] Add Verilator memory initialization from ELF
Support initialization of memory by loading content from ELF files.
All segments of the ELF file with the type `PT_LOAD` are merged into a
temporary buffer and then forwarded to a predefined memory.
This is an addition for setting the memories with VMEM files.

Memories must implement `simutil_verilator_set_mem` to support the
setting of values with a width of 32 bits. A return value of 0 must
indicate a successful operation and 1 an error.

Memories are defined by a call to `RegisterMemoryArea()` before the
execution of the simulation, at which point the arguments are parsed and
the initialization is started. The memories are identified by unique
name. The design specific location is used to set the SystemVerilog
scope.

Registered memories can be printed by using `-l list`. The unique name
is used for `-l name,file.elf` together with the file path.
An optional part of the argument is the type of the file, `elf` or
`vmem`, and if not provided it is attempted to detect the type by
looking at the file extension.
The memory specific arguments which already existed accept now also ELF
files. They use predefined names and are included to keep the interface
stable.

Contents of an ELF segment which has a bigger memory size than file size
are not set. This is typically required for BSS sections for zero-ing
the memory.
2019-11-27 11:35:07 +00:00
udinator
1a2270ce40
[DV] streamline Makefile gen flow (#488)
Signed-off-by: Udi <udij@google.com>
2019-11-21 16:51:41 -08:00
udinator
1040d5e7e9 [DV] Update flow to match RISCV-DV changes (#487)
Signed-off-by: Udi <udij@google.com>
2019-11-21 16:22:49 -08:00
udinator
2a01d1ce4c [DV] Test accesses to higher privileged CSRs (#483)
Signed-off-by: Udi <udij@google.com>
2019-11-21 11:18:39 -08:00
Tom Roberts
0b87370ee0 [dv] Prepare CS registers TB for CI
- Switch from Makefile calling fusesoc to fusesoc calling Makefile
- Pass parameters through DPI rather than as env variables

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2019-11-21 09:55:40 +00:00
udinator
8112ba5a24
[DV] umode_tw test (#481)
Signed-off-by: Udi <udij@google.com>
2019-11-18 13:43:02 -08:00
Tobias Wölfel
21f2a842d8 [DV] Add exit check for setup call
Check the return value and exit program execution.
2019-11-18 12:31:38 +01:00
Tom Roberts
88158e6fa8 [csr tb] Declare registers as a macro list
All CSR addresses supported by the TB are now delared as an X
macro list. This list is then used to autogenerate the enum
type, string print helper and an array of all addresses.

The array of addresses can now be used by the randomize generator
to turn an arbitrary integer index into an address. This removes
the restriction on only generating contiguous address ranges noted
in #443.

Add missing signal csr_restore_dtret_i

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2019-11-18 09:16:42 +00:00
Pirmin Vogel
40d6368983 [dv] Remove clock gating primitive in dv/uvm/tb
This commit removes a copy of the dummy clock gating primitive from
tree previously used for UVM-based DV. There is another, identical copy
of the same primitive in `shared/rtl` that can be used instead.

This resolves lowRISC/ibex#213.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2019-11-16 00:25:32 +01:00