Commit graph

1406 commits

Author SHA1 Message Date
Greg Chadwick
3fcede8a13 [rtl] Comment and naming tweaks 2020-01-31 09:32:20 +00:00
Greg Chadwick
86c1775a64 [rtl] Timing fix for pc_mux_o in ibex_controller 2020-01-31 09:32:20 +00:00
Greg Chadwick
b52aacf91b [rtl] Add multdiv_sel signal to decode
multdiv_sel signals the mult/div operand should be selected for the ALU
inputs. Previously the mult_en/div_en signals were used but these factor
in whether the instruction is actually happening which is not relevant
for the mux select. The dedicated select signal gives better timing.
2020-01-31 09:32:20 +00:00
Greg Chadwick
486bf45711 [rtl] Replicate instruction flops to reduce fanout
Adds a second set of instruction flops that are used to determine ALU
operation and operand selection. This reduces fanout from the
instruction flops and so helps timing.
2020-01-31 09:32:20 +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
ganoam
86979e603f [examples] Add Dual-Port Memory to Simple System
This commit adds a separate memory ports for instruction and data
fetches to the Simple System example.

* Add Dual-Port RAM with 1 cycle read/write delay, 32 bit words.

* Introduce parametric signal width definitions for bus implementation
        to work with a single host / device.

* Modify Simple System top module to instantiate the new dual-port RAM.
2020-01-29 16:50:52 +01:00
udinator
230c282c36
Update google_riscv-dv to google/riscv-dv@f7e35d7 (#573)
Update code from upstream repository https://github.com/google/riscv-
dv to revision f7e35d7939a27ae17b0481eb070e9a36ea335d1f

* remove deprecated code (google/riscv-dv#460) (udinator)
* Integrate directed C test with yaml flow (google/riscv-dv#455) (Hai
  Hoang Dang)
* Qrun is missing -access=wrc option (google/riscv-dv#457) (Hai Hoang
  Dang)

Signed-off-by: Udi <udij@google.com>
2020-01-28 15:45:41 -08: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
Philipp Wagner
799940162f Verilator: Remove unused waivers
These waivers aren't needed any more and can be removed.
2020-01-28 14:46:48 +00:00
Daniel Mlynek
9d232d1cde Include assert macros when they are used
prim_assert.sv is a file containing assertion macros (defines).
Previously, prim_assert.sv was compiled as normal SystemVerilog file.
This made the defines available for the whole compilation unit as soon
as they were defined. Since all cores using prim_assert depended (in
fusesoc) on the lowrisc:prim:assert core, prim_assert was always
compiled first, and the defines were visible in subsequent files.

All of that is only true if all files end up in one comilation unit. The
SV standard states that what makes up a compilation unit is
tool-defined, but also states that typically, passing multiple files (or
a file list/.f file) to a single tool invocation means that all files
end up in one compilation unit; if the tool is called multiple times,
then the files end up in separate compilation units.

Edalize (the fusesoc backend) doesn't guarantee either behavior, and so
it happens that for Vivado, Verilator, Cadence and Synopsys simulators,
all files are compiled into a single compilation unit. But for Riviera,
each file is a separate compilation unit.

To avoid relying on the definition of compilation units, and to do the
generally right thing (TM), this commit changes the code to always
include the prim_assert.sv file when it is used in a source file.
Include guards are introduced in the prim_assert.sv file to avoid
defining things twice.
2020-01-28 14:46:48 +00:00
Daniel Mlynek
183ae4ad4f Simple System: Correctly tie-off unused signals
Two unused bits of device_err were only assigned in an initial block,
and it not in Verilator. They should have been tied off always to avoid
mixed blocking/nonblocking assignments to the same signal.
2020-01-28 14:46:48 +00: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
Stefan Tauner
0f0571f0ee FPGA example: add support for the Arty A7-35 2020-01-27 20:18:17 +00:00
Stefan Tauner
07f288a961 sw-led: do not hardcode CC in makefile 2020-01-27 20:18:17 +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
3d8089c235
Update google_riscv-dv to google/riscv-dv@a655f34 (#564)
Update code from upstream repository https://github.com/google/riscv-
dv to revision a655f34eb5058da442b38ca010b0d008291c11b5

* Support running C test (google/riscv-dv#453) (Hai Hoang Dang)
* run.py: Do not compare csv file when specified -debug switch
  (google/riscv-dv#451) (Hai Hoang Dang)
* adjust location of nested interrupt mstatus.mie enable
  (google/riscv-dv#444) (udinator)
* Implement storing the commands that would be executed as a script
  (google/riscv-dv#450) (Hai Hoang Dang)
* Move document from README to docs, add HTML preview for the new doc
  (google/riscv-dv#448) (taoliug)
* Use single HTML format (google/riscv-dv#447) (taoliug)
* Update HTML document (google/riscv-dv#446) (taoliug)
* Add framework for custom extensions (google/riscv-dv#442) (taoliug)

Signed-off-by: Udi <udij@google.com>
2020-01-23 15:10:14 -08:00
Philipp Wagner
f95518a46e Improve wording in README of simple system
Small editorial fixes.
2020-01-23 17:52:31 +00:00
Greg Chadwick
2ef34b6d05 [syn] Feed ABC faster clock for better results
Adds an 'uprate' clock period which is subtracted off the desired period
and given to ABC as the target clock period. This gives better overal
timing results with minimal area impact.
2020-01-23 17:41:52 +00:00
ganoam
0f9e2e33e0 [rtl] Fix Typo in FPGA Register File
* Line 46: baddr_b_i > raddr_b_i.
2020-01-20 17:01:30 +00: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
ganoam
7969cb722b [rtl] Add FPGA Register File
This commit adds a register file designed to be synthesized into FPGA
synchronous-write / asynchronous-read design elements.

For the artya7-100 example, the register file is implemented by 12
RAM32M primitives, conserving approximately 600 Logic LUTs and 1000
flip-flops at the expense of 48 LUTRAMs.

Signed-off-by: ganoam <gnoam@live.com>
2020-01-14 16:21:58 +01: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
Michael Schaffner
4b291f31df
[lint] Delete outdated comment in lint target (#551)
Signed-off-by: Michael Schaffner <msf@google.com>
2020-01-10 16:37:53 -08:00
Michael Schaffner
ce5e7dd122
[rtl] Update prim assert with OpenTitan version (#546)
Signed-off-by: Michael Schaffner <msf@google.com>
2020-01-10 11:20:57 -08:00
Tom Roberts
5bb41957ef [examples] Add timer example to simple system
Not particularly useful in the current system, but gives an example of
how to handle interrupts.
2020-01-10 10:18:09 +00:00
udinator
790fab927a
exclude tar.gz compressed file from vendoring, and remove from vendor directory (#550) 2020-01-09 15:50:34 -08:00
udinator
8ce399dbe6
Update google_riscv-dv to google/riscv-dv@d23da38 (#549)
* update vendor.hjson to exclude generated pdf file

* Update google_riscv-dv to google/riscv-dv@d23da38

Update code from upstream repository https://github.com/google/riscv-
dv to revision d23da3862f95954e6374aaec787e0fb0c1878a16

* fix matched_list and directed_list size comparisons (Udi
  Jonnalagadda)
* Add run_cmd_output for reporting all debug command lines
  (google/riscv-dv#436) (Hai Hoang Dang)
*  Resolve: missing pass gcc_opts from YAML for GCC compile command
  (google/riscv-dv#435) (Hai Hoang Dang)
* Sphinx: Add generating pdf file (google/riscv-dv#431) (Hai Hoang
  Dang)
* integrate directed asm_tests with yaml flow (Udi Jonnalagadda)
* Fix running cov without arguments (google/riscv-dv#433) (Hai Hoang
  Dang)
* Add setup Travis CI for tracking build docs, and install
  (google/riscv-dv#430) (Hai Hoang Dang)
* Add handling KeyboardInterrupt for run_cmd and run_parallel_cmd
  (google/riscv-dv#424) (Hai Hoang Dang)
* Sphinx: add basic page for structure of the document (google/riscv-
  dv#428) (Hai Hoang Dang)
* README.md: Update the information relating to usage (google/riscv-
  dv#426) (Hai Hoang Dang)
* Add initial Sphinx docs (google/riscv-dv#427) (Hai Hoang Dang)
* Fix typo in the testlist (google/riscv-dv#423) (taoliug)
* Add try-except for handling KeyboardInterrupt (google/riscv-dv#421)
  (Hai Hoang Dang)
* Update information about instruction for running scripts
  (google/riscv-dv#420) (Hai Hoang Dang)
* Add vector permutation, reduction, mask instructions (google/riscv-
  dv#422) (taoliug)
* Python package (google/riscv-dv#419) (Hai Hoang Dang)
* Refactor the code for cov.py (google/riscv-dv#416) (Hai Hoang Dang)
* Update ovpsim config for vector extesion (google/riscv-dv#415)
  (taoliug)
* Fix coverage flow issue (google/riscv-dv#414) (taoliug)
* Add missing license header (google/riscv-dv#412) (taoliug)
* Fix typo in cov_test (google/riscv-dv#410) (taoliug)
* Add vector floating point instructions (google/riscv-dv#409)
  (taoliug)
* Add fixed point arithmetic vector instruction (google/riscv-dv#408)
  (taoliug)
* cov.py: Generate error when it cannot find spike_sim directory
  (google/riscv-dv#407) (Hai Hoang Dang)
* Add vector CSR initialization routine (google/riscv-dv#405)
  (taoliug)
* Create vector extension target, add basic enums (google/riscv-
  dv#404) (taoliug)
* Fix qrun sim warning (google/riscv-dv#402) (taoliug)
* Try fix qrun constraint solver issue (google/riscv-dv#401) (taoliug)
* Fix simulation warning (google/riscv-dv#400) (taoliug)
* run.py: Generate error for gcc compile when it cannot find assembly
  files (google/riscv-dv#398) (Hai Hoang Dang)
* Add numeric corner case test, misc coverage fixes (google/riscv-
  dv#396) (taoliug)
* Switch to new CSV format (google/riscv-dv#395) (taoliug)
* misc fixes for the coverage model (google/riscv-dv#394) (taoliug)
* Fix new CSV coverage flow issue (google/riscv-dv#392) (taoliug)
* Integrate new trace CSV format with coverage flow (google/riscv-
  dv#390) (taoliug)
* Add experimental script for the new CSV format (google/riscv-dv#389)
  (taoliug)
* Support flexible running directed assembly tests (google/riscv-
  dv#386) (Hai Hoang Dang)
* run.py: Enhance passing argument for gen function (google/riscv-
  dv#382) (Hai Hoang Dang)
* Fix qrun issue, take 2 (google/riscv-dv#384) (taoliug)
* Attempt to fix qrun issue (google/riscv-dv#383) (taoliug)
* Fix (google/riscv-dv#381) (taoliug)
* Fix typo (google/riscv-dv#380) (taoliug)
* Fix qrun simulation issue (google/riscv-dv#379) (taoliug)
* Cleaning the output directory by default. Using exist output
  directory (google/riscv-dv#377) (Hai Hoang Dang)
* Fix ius compilation error temporarily (google/riscv-dv#378)
  (taoliug)
* Functional coverage improvement (google/riscv-dv#376) (taoliug)
* Add unaligned jump instruction support (google/riscv-dv#375)
  (taoliug)
* move handcoded asm_test generation into separate output directory
  (Udi Jonnalagadda)
* Ignore return code for ovpsim sim (google/riscv-dv#371) (taoliug)
* Fix mie compare mismatch (google/riscv-dv#370) (taoliug)
* Fix directory/file name for assembly test flow (google/riscv-dv#369)
  (taoliug)
* Fix error in README (google/riscv-dv#368) (taoliug)
* Add sample rv32imc test (google/riscv-dv#367) (taoliug)
* Fix typo (google/riscv-dv#366) (taoliug)
* Support running regression with hand-coded assembly tests
  (google/riscv-dv#365) (taoliug)

Signed-off-by: Udi <udij@google.com>
2020-01-09 15:04:39 -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
Greg Chadwick
79bb6c7832 [syn] Synth flow improvements
Adds significant functionality to synthesis flow. Timing reports are
generated using OpenSTA and an area report is generated. Flow supports
open Nangate45 library from OpenROAD.
2020-01-07 14:09:17 +00:00
Greg Chadwick
9c6ddae626 [rtl] Don't elaborate unused mhpmcounter flops
Refactors performance counters so only flops that are required from the
given parameters are explicitly elaborated without relying on
optimization to remove unused flops.

Fixes #473
2020-01-07 10:23:12 +00: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
Pirmin Vogel
7e2283056b [rtl] Trigger C decoder assertions only if instr valid
This commit ensures that the assertions in the compressed decoder do
not fire if the compressed decoder sees invalid data from the prefetch
buffer.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2020-01-03 09:36:16 +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
Tom Roberts
f1683e3f3c [ci] Add clang-format checking to CI
- Only checks changed C source files
- Also add a note on C/C++ style to README
- Fixes #304

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2020-01-02 13:20:35 +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
Tobias Wölfel
347b80f631 [make] Fix target reference 2019-12-21 10:05:39 +01:00
Pirmin Vogel
e9a6295e57 [rtl] By default, forward incoming instruction in C decoder
This commit modifies the compressed decoder to forward the incoming
instruction to the output. It is marked as legal, unless:
1) the decoder cannot determine if the instruction is compressed (e.g.
   because of unknown selector bits), or
2) the instruction is compressed but
    a) it cannot be successfully decompressed (e.g. because of unknown
       selector bits), or
    b) it is indeed illegal.

In the case of 2b) the compressed decoder may output an illegal
decompressed instruction instead of the incoming instruction.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2019-12-20 10:09:09 +01:00
Pirmin Vogel
29923e6679 [rtl] Use macros for all SystemVerilog assertions
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2019-12-20 10:09:09 +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
Pirmin Vogel
b10039c4ef [rtl] Consistently use data_offset signal in LSU
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2019-12-20 10:09:09 +01:00