Commit graph

1385 commits

Author SHA1 Message Date
udinator
24315515f6
Reorganize ibex dv files (#618)
Signed-off-by: Udi <udij@google.com>
2020-02-20 15:56:40 -08:00
udinator
0af48120ba
VCS compile fix (#616)
Signed-off-by: Udi <udij@google.com>
2020-02-20 15:12:50 -08:00
udinator
f98cd607af
Update google_riscv-dv to google/riscv-dv@6bd3233 (#617)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 6bd323385d454858ea5e50dedd42a563b37931fe

* VCS compile option fix (Udi Jonnalagadda)
* Improve pmp config object - enable cmdline args (Udi Jonnalagadda)
* Fix ovpsim setting (google/riscv-dv#478) (taoliug)
* IUS - enable rand structs in simulation (google/riscv-dv#477)
  (udinator)
* fix macro definition compile issue (Udi Jonnalagadda)
* add ISS command line options (google/riscv-dv#474) (udinator)
* Add style check (Weicai Yang)

Signed-off-by: Udi <udij@google.com>
2020-02-20 15:07:12 -08:00
Tobias Wölfel
77c93f1e54 [doc] Fix reference link 2020-02-20 15:50:53 +00:00
Philipp Wagner
aab15bc922 CI: Pin riscv-compliance repo to specific commit
Recently changes in the RISC-V compliance repo have caused our tests to
fail. That indicent highlighted the issue that we use the latest master
version of the compliance suite without pinning the version.

This PR fixes that by pinning to a specific version where our tests
still succeeded.

Upstream PR to fix actual failure: https://github.com/riscv/riscv-compliance/pull/92
Works around #608
2020-02-20 15:45:51 +00:00
Tobias Wölfel
7c9c7599d2 [rtl] Change misa for RV32E
Following RISC-V privileged architecture version 1.11,
the "E" bit of misa should return the complement of the "I" bit.

Set the "I" bit only if RV32E is not used.

Closes lowRISC/ibex#612.
2020-02-20 14:29:32 +00:00
Greg Chadwick
f90faa6ca3 [rtl] Alter multdiv to better match style guide
Use of case inside in always_ff block does not meet style guide
recomendations. Refactored to remove this.

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2020-02-17 13:41:55 +00:00
Philipp Wagner
dfd7f9e437 Doc: Fix broken table in integration docs 2020-02-12 15:57:40 +00:00
Philipp Wagner
b1af9174dc Doc: Documented supported tool versions
Add a section on supported tools to the Ibex documentation. Populate it
with my knowledge about tools we've tried. That's a starting point: we
need to add more version numbers and other information as we collect
more data points.

The Verilator version is taken from the new tool_requirements.py file
and inserted into Sphinx.
2020-02-12 15:57:40 +00:00
Philipp Wagner
3a078865c8 Check for supported tool versions
Define supported tool versions in tool_requirements.py, and check them
in a fusesoc run. If an unsupported tool version is found, fusesoc
outputs an error like this:

```
$ fusesoc --cores-root . run --target=lint lowrisc:ibex:ibex_core
INFO: Preparing lowrisc:ibex:check_tool_requirements:0.1
INFO: Preparing lowrisc:prim:assert:0.1
INFO: Preparing lowrisc:ibex:sim_shared:0
INFO: Preparing lowrisc:ibex:ibex_core:0.1
INFO: Setting up project

INFO: Running pre_build script check_tool_requirements
ERROR: verilator is too old: found version 4.010, need at least 4.028
ERROR: Tool requirements not fulfilled. Please update the tools and retry.
ERROR: Failed to build lowrisc:ibex:ibex_core:0.1 : pre_build script 'check_tool_requirements' exited with error code 1
```

The only version checked at this point is Verilator, which is set
somewhat arbitrarily to the version used by me (and I know it works). CI
uses a slightly newer version. As we are about to merge changes soon
which require a newer Verilator version, there's not much point in
finding the oldest supported version right now.
2020-02-12 15:57:40 +00:00
Philipp Wagner
db62f5b0c2 Doc: Cleanup Sphinx config file
- Add a license header
- Explicitly specify language
- Remove unused HTML help section
- Reorganize some commands around the version number generation
2020-02-12 15:57:40 +00:00
ganoam
48c4b6a5ea [rtl] Add Single Cycle Multiplier targeting FPGA
* Integrate option to implement a multiplier using 3 parallel 17 bit
        multipliers in order to compute MUL instructions in 1 cycle
        MULH in 2 cycles.

* Add parameter SingleCycleMultiply to select single cycle
        multiplication.

The single cycle multiplication capability is intended for FPGA
targets. Using three parallel multiplication units improves performance
of multiplication operations at the cost of DSP primitives. For ASIC
targets, the area consumed by the multiplication structure will grow
approximately 3-4x.

The functionality is selected within the module using the parameter
`SingleCycleMultiply`. From the top level it can be chosen by setting
the parameter `MultiplierImplementation` to 'single_cc'.

Signed-off-by: ganoam <gnoam@live.com>
2020-02-11 16:09:41 +01:00
Stefan Mach
ba2240f138 Reduce latency of slow multiplier
- The slow multiplier is modified to terminate iterations early instead
  of always going the full 32 iterations for `MUL` instructions.
- Multiplications now terminate early after clog2(`op_b`) iterations.
- The slow multiplier can be further optimized by swapping the smaller
  operand into `op_b` when in the `MD_IDLE` state.
2020-02-10 18:28:14 +01:00
udinator
fc2fb22a7d
[dv] add command line PMP option configurability (#599)
Signed-off-by: Udi <udij@google.com>
2020-02-10 09:24:06 -08:00
Greg Chadwick
8e28ba0b9e [syn] Fix synthesis script
* prim_assert now an include so add appropriate include dir
* remove FPGA reg file from synthesised files
2020-02-10 17:01:50 +00:00
Greg Chadwick
24cbc32249 [rtl] Fix assertion issues
Fixes #548
2020-02-10 17:01:38 +00:00
Philipp Wagner
f24ffa5657 Update setuptools and pip to parse more metadata
The Ubuntu xenial-provided versions of setuptools and pip don't parse
all metadata present in Python packages, especially not the "minimum
required Python version" bit. More and more packages are using this
information to limit Python 3.5-support to older versions of their
packages. In this case, the problem was caused by the "zipp" package,
which is a very remote dependency of fusesoc.

Fixes #597
2020-02-10 15:10:57 +00:00
Greg Chadwick
5d16a5b104 [rtl] Introduce default clk/reset to prim_assert
This mirrors the change made in OpenTitan
(https://github.com/lowRISC/opentitan/pull/1485)
2020-02-10 09:42:52 +00:00
udinator
c914ec5e6a
update testlist typo (#593)
Signed-off-by: Udi <udij@google.com>
2020-02-07 11:27:53 -08:00
udinator
a97b7b7b15
Update google_riscv-dv to google/riscv-dv@6e2bc2e (#589)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 6e2bc2e01fb20799c9eff29a26852eb1917b977a

* fix a missed syntax error in pmp_cfg (Udi Jonnalagadda)

Signed-off-by: Udi <udij@google.com>
2020-02-06 13:37:00 -08:00
udinator
d4cb1a30ae
[dv] enable PMP (#588)
Signed-off-by: Udi <udij@google.com>
2020-02-06 11:54:56 -08:00
udinator
2be7413ac8
Update google_riscv-dv to google/riscv-dv@e63c542 (#587)
Update code from upstream repository https://github.com/google/riscv-
dv to revision e63c5427b0bf543aebb9c62bba8217065b029a76

* Add pmp configuration object (Udi Jonnalagadda)
* add path for the prebuilt document (google/riscv-dv#469) (taoliug)
* Update document for directed assembly/C test (google/riscv-dv#467)
  (taoliug)
* Fix broken document link (google/riscv-dv#466) (taoliug)
* Add a runtime option to fix stack pointer (google/riscv-dv#465)
  (taoliug)
* Fix LR/SC instruction issue for RV32A (google/riscv-dv#464)
  (taoliug)

Signed-off-by: Udi <udij@google.com>
2020-02-06 11:03:22 -08:00
Greg Chadwick
3f0b730d57 [doc] Riviera-PRO instructions for Simple System
Fixes #578

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2020-02-05 11:40:01 +00: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
dalance
36eec8e41a Fix incdirs of src_files.yml 2020-02-03 08:33:11 +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
Stephano Cetola
bfba13bbf3 Fix FPGA part number for Arty A7-100T
For some reason the part number between the Arty A7-35T and the Arty
A7-100T differs by 1 letter (TICSG vs TCSG). This patch fixes the part
number for the Arty A7-100T to remove the "i".

Signed-off-by: Stephano Cetola <scetola@linuxfoundation.org>
2020-02-02 11:47:59 +01:00
Pirmin Vogel
b22fca7bbe Ignore all interrupts in NMI mode, clarify interrupt documentation
This is related to lowRISC/ibex#557, lowRISC/ibex#469 and
lowRISC/ibex#434.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2020-01-31 13:09:09 +01:00
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