Commit graph

1215 commits

Author SHA1 Message Date
Greg Chadwick
edb33cca56 Add Greg Chadwick to CREDITS.md 2019-10-17 11:07:05 +01:00
Greg Chadwick
6b1a7add5d [Doc] Added extra setup info for Verification 2019-10-17 10:31:18 +01:00
udinator
b2e36ec345
Update google_riscv-dv to google/riscv-dv@033fccf (#406)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 033fccfbd50f6412e66b448a1d04245d787004bd

* Add more ebreak generation control (google/riscv-dv#229) (udinator)
* Fix timemout, misc update to README (google/riscv-dv#228) (taoliug)
* Fix CSR test setup (Udi)
* Update spike setup instruction for commit log (google/riscv-dv#226)
  (taoliug)
* Fix spike arguments to generate commit log (google/riscv-dv#225)
  (Greg Chadwick)
* Minor README typo (google/riscv-dv#219) (Dan Petrisko)
* Add random FCSR programing, add RV32FC/DC support (google/riscv-
  dv#221) (taoliug)
* Add floating point load/store support (google/riscv-dv#220)
  (taoliug)
* Fix floating point comparison issue (google/riscv-dv#218) (taoliug)
* Add basic support for F/D extension (google/riscv-dv#217) (taoliug)
* Generate the ucdb file inside output directory (google/riscv-dv#215)
  (Hai Hoang Dang)
* cov.py: Allow coverage to run with different simulator
  (google/riscv-dv#214) (Hai Hoang Dang)
2019-10-16 17:50: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
Philipp Wagner
59fdbb517f Licensing documentation: Add commercial support info
lowRISC provides commercial support for Ibex, mention that in the
licensing page if people are looking for such an offering.

Can be extended in the future as we know of more companies offering
support.
2019-10-16 15:08:45 +01:00
Philipp Wagner
2cc282aeee Improve copyright/licensing page
Rename the page to "Licensing", and improve its contents to be more
helpful to people not familiar with open source projects and the Apache
license.
2019-10-16 15:08:45 +01:00
Greg Chadwick
cc94bc8d54 [RTL] Fix single stepping on exceptions
When we single step over an instruction that causes an exception DPC
should be set to point to the exception handler (where we would have
gone were we not single stepping).
2019-10-16 10:23:05 +01:00
Greg Chadwick
b94961402c [RTL] Fix ebreak behaviour in U-mode
Fixes #370

Whether EBREAK enters debug mode is controlled by the
ebreaku and ebreakm dcsr fields. Which is relevant depends upon the
privilege level.
2019-10-16 09:10:34 +01:00
Greg Chadwick
7aa87156d3 [RTL] Fix ebreak and cleanup debug
Fixes #393

When entering debug mode in controller need to ensure ID doesn't get
flushed until the relevant debug state can see the contents of ID and
perform the appropriate actions. ID is flushed at that point.

Also cleaned up some code replication around entering debug mode
(debug_req vs single step look very similar so can use the same code
paths).
2019-10-16 09:10:34 +01:00
udinator
6b8b3762ec
[DV] Fix bugs in mem_error test to circumvent test deadlock (#400) 2019-10-15 15:19:36 -07:00
Greg Chadwick
2bc785e7d9 [RTL] Prevent CSR write on any illegal CSR reason
Debug register access sets illegal_csr if not in debug mode but CSR
write still went ahead. This modifies the CSR write to ensure that
anything that results in an illegal CSR instruction being signalled will
prevent a CSR write.
2019-10-15 14:43:55 +01:00
udinator
bbb688a2aa
[DV] Fix lint warnings (#397) 2019-10-14 10:20:28 -07:00
Pirmin Vogel
5f0be50473 Remove non-ASCII characters from .sv and .rst files 2019-10-14 09:08:16 +01: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
566e73c352
[RTL] Enable reading mstatus.tw (#388) 2019-10-10 09:17:14 -07:00
Alex Bradbury
0abe5ccaf7 [CI] Stop pinning an old attrs version
simplesat (required by fusesoc) was broken by an update to the attrs
library. Now simplesat 0.8.2 has been released which fixes the issue, we
can remove the explicit pinning of the old attrs version.
2019-10-10 16:22:56 +01:00
Philipp Wagner
2b6a95190e Remove outdated waiver
With the introduction of U mode this signal is always read.
2019-10-09 13:35:01 +01:00
Philipp Wagner
3db46f91e0 Tie off csr_pmp_* signals for all lint tools
Our generic way of marking signals as unused is assigning them to an
unused_* signal. That works for all lint tools and avoids tool-specific
waivers.
2019-10-09 13:35:01 +01:00
Philipp Wagner
90ff45abbd Avoid self-determined bit length of signals
This works around a lint error we get; the old and the new version are
equally wrong or right, but it doesn't seem to be worth fighting with a tool.
2019-10-09 13:35:01 +01:00
Philipp Wagner
cdc8078c0f ibex_cs_registers: Add missing generate name
One condition is missing a generate label.
2019-10-09 13:35:01 +01:00
Tom Roberts
c33525ae80 [RTL LSU] Change unaligned error behaviour
- If an error is signalled in the first part of an unaligned
  transaction, the second part is issued anyway (to avoid a
  timing loop from data_err_i -> data_req_o)
- Previously, the error was signalled and an exception was taken
  as soon as the first transaction completed. This commits makes
  the core wait until both transactions have completed.
- This prevents strange behaviour caused by the lsu and controller
  being out of sync (fixes #374).
2019-10-09 10:07:07 +01:00
udinator
4a1806f16f
Update google_riscv-dv to google/riscv-dv@ad6fe56 (#385)
Update code from upstream repository https://github.com/google/riscv-
dv to revision ad6fe565a91445cc3ea3e32119360b57af4f19b2

* Workaround for dsim compile issue (google/riscv-dv#211) (taoliug)
* Add a --seed_yaml option to rerun a regression with the same seed of
  a prior regression (google/riscv-dv#210) (taoliug)
* Update questa covearge options (google/riscv-dv#209) (taoliug)
* Fix disable_compressed_instr option (google/riscv-dv#205) (taoliug)
* Fix non-compressed instruction test (google/riscv-dv#203) (taoliug)
* Debug single step functionality and config knobs (Udi)
* Fix no_branch_jump option (google/riscv-dv#200) (taoliug)
* Add more functional covergroup (google/riscv-dv#199) (taoliug)
* Allow randomly reserve GPR for TP/SP, improve functional coverage
  (google/riscv-dv#198) (taoliug)
* Allow running the coverage script with LSF (google/riscv-dv#195)
  (taoliug)
* Add support for disable_compressed_instr (google/riscv-dv#194)
  (taoliug)
* Improve coverage collection performance (google/riscv-dv#193)
  (taoliug)
* Signature_addr_reg constraint update (Udi)
* Add a debug mode for functional coverage (google/riscv-dv#191)
  (taoliug)
* Fix typo in README (google/riscv-dv#189) (taoliug)
* Constrain scratch_reg (google/riscv-dv#188) (udinator)
* Update README for the coverage flow (google/riscv-dv#187) (taoliug)
* Add basic privileged CSR cover group (google/riscv-dv#186) (taoliug)
* Fix cover point definition (google/riscv-dv#185) (taoliug)
* Fix ovpsim log compare issue (google/riscv-dv#183) (udinator)
2019-10-08 14:22:05 -07:00
udinator
9824342c03
[DV] Added unaligned memory error test (#378) 2019-10-08 09:31:49 -07:00
Tobias Wölfel
912d6da1c2 Update description for running RISC-V compliance
The RISC-V compliance test system requires an absolute path to the
executable or one which starts at `riscv-test-suite/*`.
2019-10-08 15:22:37 +02:00
Tobias Wölfel
73224d9c51 Remove reference to simulation
The testbench does not exist anymore.
2019-10-08 11:57:19 +02:00
Philipp Wagner
ee1098f9af Tracer: Reference Verilator bug for miscompilation
This miscompilation is now reported and fixed, mention it in the code to
refer back to it when we can revert back to the old code (which will
take a couple months until we can require a newer Verilator version).

Fixes #372
2019-10-06 12:55:59 +01:00
Philipp Wagner
d8e4852f76 Include rs1 and rd in trace of c.addi16sp
New output looks like this:

118         55      00000154        6121    c.addi16sp      x2,64     x2:0x00000030  x2=0x00000070

Fixes #322
2019-10-05 18:22:14 +01:00
udinator
84664077ee
[DV] Top level toggle coverage (#371) 2019-10-04 16:36:47 -07:00
Greg Chadwick
b1a0cac126 [Doc] Add more pipeline details 2019-10-04 11:36:24 +01:00
Greg Chadwick
29d66a7fa4 [Doc] Fix for table wrapping in RTD theme
This causes wide tables to wrap content within their cells rather than
producing a table with a scroll bar see
https://github.com/readthedocs/sphinx_rtd_theme/issues/117 for details.
2019-10-04 11:36:24 +01:00
Philipp Wagner
2acb497d22 Add missing enum cast
Vivado doesn't compile the design without this cast.
2019-10-03 16:56:26 +01:00
Tom Roberts
6aae5fe975 [Doc] Fix some rendering issues in cs_registers
- fixes #306
2019-10-03 10:41:29 +01:00
Tom Roberts
f35db04b7c [RTL PMP] Fix address matching bugs
- Partial matching not relevant for 32bit only accesses
- Apply region size masking correctly
2019-10-03 10:41:29 +01:00
Tom Roberts
2aacd2b98b [Priv modes] Add support for U-Mode
- General changes to suport U-mode (fixes #88)
- Update documentation
- Add priv mode flops to CSRs module
- Propagate correct priv mode to PMP module
- Implement CSR priv-mode permission checking
- Implement illegal U-mode instruction checking
- Add extra mstatus bits for U-mode (MPRV and TW)
2019-10-03 10:41:29 +01:00
Philipp Wagner
f54dfe5d4b RISC-V Compliance test: Enable tracing
Use the tracing-enabled core wrapper when executing the RISC-V
compliance test suite to help with debugging it.
2019-10-03 09:42:45 +01:00
udinator
48e604ab9e
[DV] Update ibex log regex (#366) 2019-10-02 13:16:47 -07:00
Philipp Wagner
0908817963 Tracer: Fix default file name
We document the default file name to be trace_core_00000000.log, but
actually used trace_core__00000000.log. Fix that.
2019-10-02 20:12:38 +01:00
Philipp Wagner
a121caab35 CI: Also check tracer in lint
By linting ibex_core_tracing, we lint all submodules as well: ibex_core
and ibex_tracer.
2019-10-02 18:28:26 +01:00
Philipp Wagner
1377e42a17 Lint: Enable lint for ibex_core_tracing
Add fusesoc description for core with tracing enabled, implicitly
linting the ibex_tracer as well.

Run with

$ fusesoc --cores-root=. run --target=lint lowrisc:ibex:ibex_core_tracing
2019-10-02 18:28:26 +01:00
Philipp Wagner
87c29694f0 Update gitignore to include trace log file 2019-10-02 18:28:26 +01:00
Philipp Wagner
c58e02a16b Document new tracer implementation 2019-10-02 18:28:26 +01:00
Philipp Wagner
74780e7e17 Implement Verilator-compatible tracer, and use it
The ibex_tracer module implements an execution tracer, observing the
execution flow and writing a human-readable execution trace. The trace
information is coming from the RVFI signals, as specified at
https://github.com/SymbioticEDA/riscv-formal/blob/master/docs/rvfi.md.

The existing implementation was tailored for use in ModelSim and other
commercial simulators, and used SystemVerilog features which are not
supported in Verilator or Icarus Verilog, such as classes, queues and
non-standard format specifiers (e.g. the `-` specifier for right-aligned
output). Being unable to see an execution trace when using Verilator
significantly reduced productivity and its usefulness.

This commit refactors the tracer to only use SystemVerilog constructs
which are supported in Verilator. While doing so, multiple improvements
were made for correctness and style.

Major changes:

- Improve compatibility with Verilator. Remove many non-synthesizable
  SystemVerilog constructs, such as classes and queues.
  Use casez instead of casex for better Verilator support (Verilator
  doesn't support X).
- Make the decoded output of the tracer match objdump from binutils
  exactly. Doing so is beneficial for two reasons: we can easily
  cross-check the decoded output from the tracer against the disassembly
  produced by objdump (and we did that), and users don't need to get
  used to another slighly different disassembly format.
- A plusarg "+ibex_tracer_file_base=ibex_my_trace" can be used to set a
  different basename for the trace log file.

Smaller cleanups:

- Remove decoding of reg-reg loads, which were leftover from a PULP
  extension.
- Make better use of the data available on the RVFI. Pass all of RVFI
  to the tracer, and use the provided data instead of manually
  recreating it, e.g. to get register data or the jump target.
- Rename all "instr" abbreviations to "insn". "insn" is what RVFI uses
  (and we cannot change that), so for consistency we now always use this
  abbreviation across the file.

All CSR names have been imported from binutils' riscv-opc.h file, available at
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=include/opcode/riscv-opc.h
using this small C program:

  #include <stdio.h>

  #define STR(s) #s

  int main(int argc, char **argv) {
    printf("unique case (csr_addr)\n");
  #define DECLARE_CSR(name, csraddr) \
    printf("  12'd%d: return \"%s\";\n", csraddr, STR(name));
  #include "riscv-opc.h"
    printf("  default: return $sformatf(\"0x%%x\", csr_addr);\n");
    printf("endcase\n");
    return 0;
  }

The RISC-V compliance test suite for the RV32 I, M, and C extensions has
been executed and traced. The disassembly of all traces have been
compared against traces produced by objdump to ensure identical output.

This PR is based on work by Rahul Behl <raulbehl@gmail.com> in #280.
Thank you Rahul for providing a great starting point for this work!
2019-10-02 18:28:26 +01:00
Philipp Wagner
e420688d1c Remove tracer testbench
This testbench was helpful in creating the initial tracer, but is not
fully working any more, and too limited to test the trace fully.
Extending it is inconvenient, as the creation of instruction sequences
through the bus interface is easy to get wrong.
2019-10-02 18:28:26 +01:00
Greg Chadwick
2a947c5e7f [RTL] Fix timing path around exceptions and pc_set
When an exception occurs controller goes into the flush state and then
does a pc_set to go the exception handler.  So there is no need for the
incoming signals that indicate an exception to factor directly into
pc_set_o.  This flops exc_req and illegal_insn to break long timing
paths that were occurring because of this.

Fixes #305
2019-10-02 15:46:26 +01:00
Greg Chadwick
b1155740c2 [RTL] Keep instr in ID valid for FLUSH state
When an instruction that caused an exception occurred the controller
would clear the instr_valid bit but rely on the instruction bits staying
in the ID register so it could still use them in the FLUSH state to
decide what to do. This reworks the control logic slightly so
instr_valid remains asserted when the controller goes into the FLUSH
state so relevant signals can be qualified with the instr_valid bit.

There were no known functional issues caused by the previous behaviour
however this gives a more robust approach.
2019-10-02 15:46:26 +01:00
Marek Pikuła
252874d32d Pull csr_we_int around case in CSR
`if (csr_we_int)` conditional is now outside address `unique case`.

Also add comment about `illegal_csr_*` origin.
2019-10-02 15:37:42 +01:00
Philipp Wagner
85e1d43a08 CI: Unbreak build after simplesat breakage
Tracked in https://github.com/enthought/sat-solver/issues/270
2019-10-02 14:16:26 +01:00