Commit graph

522 commits

Author SHA1 Message Date
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
udinator
c05634cfdf
[DV] Enable user-mode in DV environment, add basic tests (#471)
Signed-off-by: Udi <udij@google.com>
2019-11-14 16:11:32 -08:00
udinator
7ea79ae366
[funct_cov] Fix GPR assignment bug (#456) 2019-11-12 10:07:12 -08:00
udinator
2a3c6c6430
[funct_cov] Update Makefile options for coverage (#455) 2019-11-11 15:07:20 -08:00
udinator
23589f5a91
[funct_cov] Update Ibex log parsing (#453) 2019-11-11 13:52:47 -08:00
Greg Chadwick
31d423ae47 Added top-level shared directory
shared is to be used for RTL/Code that is used by multiple parts of the
directory tree or does not fit neatly under other places in the tree.
2019-11-09 07:48:47 +00:00
udinator
502b5a951e
[DV] clean up stale TODOs (#448) 2019-11-04 16:52:01 -08:00
udinator
098fb7d847
[DV/flow] Integrate with RISCV-DV (#446) 2019-11-04 13:22:47 -08:00
Tom Roberts
48adda0b47 [verilator] Fix a few verilator DV issues
- Speed up compile time by only optimizing hot code
- Fix some incorrect references in tb_cs_registers
- Add a comment for FST vs VCD tracing
2019-11-01 16:02:46 +00:00
udinator
e2ab24b9e3
[DV] Assert interrupt during write to MSTATUS and MIE (#435) 2019-10-31 11:14:53 -07:00
Greg Chadwick
5ce6351530 Add performance counter utils for verilator sims 2019-10-30 16:56:55 +00:00
Tom Roberts
70b53068db [DV] Add registers testbench
- Sample C++ unit testbench for system registers module
- Only tests a few PMP registers at the moment
2019-10-30 14:46:33 +00:00
udinator
edf9371c6c
[DV] Increase number of resets in reset_test (#418) 2019-10-25 14:28:06 -07:00
udinator
d3c7b887d7
[DV] Increase number of illegal instructions generated (#426) 2019-10-25 14:00:22 -07:00
udinator
8e40f65582
[DV] Enable timer interrupts (#415) 2019-10-23 09:33:50 -07:00
Tobias Wölfel
0728fb7e9f [DV] Update simulation terminate argument
Add description to usage output.
Add short option '-c'.
2019-10-21 22:19:24 +02:00
udinator
beb40d89f6
[DV] Add interrupt wfi test to address coverage hole (#410) 2019-10-21 11:44:23 -07:00
udinator
fc80203af3
[DV] Debug_ebreak test fix (#405) 2019-10-16 17:44:47 -07:00
taoliug
1b71320230
Add RV32IM test (#404) 2019-10-16 10:15:49 -07:00
udinator
6b8b3762ec
[DV] Fix bugs in mem_error test to circumvent test deadlock (#400) 2019-10-15 15:19:36 -07:00
udinator
bbb688a2aa
[DV] Fix lint warnings (#397) 2019-10-14 10:20:28 -07:00
udinator
5972c63ba8
[DV] Let time-consuming checker tasks detect failures (#395) 2019-10-11 13:48:20 -07:00
udinator
ae82d61401
[DV] Add reset test (#392) 2019-10-10 13:01:32 -07:00
udinator
2ca1a6da21
[DV] Update csr description for U-mode changes (#387) 2019-10-10 09:18:48 -07:00
udinator
9824342c03
[DV] Added unaligned memory error test (#378) 2019-10-08 09:31:49 -07:00