Commit graph

2495 commits

Author SHA1 Message Date
Miguel Escobar
d1aff2f1a4 [dv] get ibex dv co-sim to run w questa
This resolves lowRISC/Ibex#1280.
2021-10-25 19:47:07 +02:00
Tom Roberts
cfeef7e864 [doc] Update DIT documentation for unaligned ld/st
Relates to #1414

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-10-19 14:06:53 +01:00
Henner Zeller
a345da3bad Change use of blocking assignment to non-blocking inside always_ff
Fixes #1457

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2021-10-16 16:46:34 +01:00
Greg Chadwick
416ecb10df [dv] Add co-simulation environment support to UVM testbench 2021-10-15 11:30:35 +01:00
Greg Chadwick
c03cc91a5d [rtl] RVFI changes and extensions for co-simulation
This adds some new `rvfi_ext` signals that are needed by the
co-simulation environment.

It also fixes/alters `rvfi_trap`. Previously it wouldn't work correctly
in various cases. Now it is fully functional, though it's meaning
includes more trap cases than the RVFI spec strictly includes. It is now
set for any instruction that produces a synchronous trap (everything bar
interrupts).
2021-10-15 11:30:35 +01:00
Greg Chadwick
648fadb34a [dv] Add co-simulation framework 2021-10-15 11:30:35 +01:00
Greg Chadwick
f4e3eefcfb [rtl,dv,doc] Flip priority of fast interrupts
This matches the priority used in Spike.

This also fixes an issue in the DV where the priority of
external/software/timer interrupts wasn't calculated correctly.
2021-10-15 11:30:35 +01:00
Udi
ff6797b26f [ibex/ml] add CSR/mem_error tests to ml_testlist
Signed-off-by: Udi <udij@google.com>
2021-10-07 16:54:46 -07:00
Zachary Snow
0aa02b0f3f [syn] Use read_verilog -defer in yosys_run_synth.tcl
Newer versions of sv2v carry through elaboration system tasks like
$fatal. ibex_top_tracing uses $fatal, but isn't actually used in the
syn_yosys flow. By using -defer, unused modules like ibex_top_tracing
are not elaborated in Yosys.
2021-10-07 12:29:16 +01:00
zeeshanrafique23
873e2281cf remove unused RD in branch insn from tracer 2021-10-01 17:51:18 +01:00
Rupert Swarbrick
305f0a80ea Add missing parameters to ibex_top_tracing 2021-09-27 11:06:04 +01:00
Wojciech Sipak
45f727dfc6 set verible action version to 'main' 2021-09-23 11:55:50 +01:00
Wojciech Sipak
ac8934459b bump verible action version 2021-09-21 16:22:17 +01:00
Greg Chadwick
31b2f6c863 [rtl] Fix retired instruction counters
When the writeback stage is present the retired instruction counter
(minstret) and the retired compressed instruction counter could see an
off by one error when an instruction was in the writeback stage when
reading the counters. With this fix the ID stage observes the
incremented value of the counters when an instruction that would
increment them is in writeback.
2021-09-17 12:28:10 +01:00
Greg Chadwick
75c030b776 [rtl] Factor ID exceptions into instruction kill
Without this an instruction taking an exception will enter WB whilst
simultaneously remaining in ID. This didn't cause any known functional
issues as in the scenarios it occurred the RF write was disabled and the
WB stage eventually gets flushed. However it's still bad behaviour and
could lead to functional issues when RTL changes. It also eases the
co-simulation DV implementation.
2021-09-17 12:28:10 +01:00
Wojciech Sipak
31c5b5eefd [ci] Add GHA workflows to review PRs using Verible
Any activity regarding a Pull Request will trigger
workflows that create automatic code review
using outputs from Verible linter
2021-09-16 12:40:25 +02:00
Greg Chadwick
6cbd7d21c5 [dv] Fix transaction ordering in ibex_mem_intf_monitor
Previously the monitor would emit write transactions the cycle the
request is seen and emit read transactions the cycle the response is
seen. This allowed later write transactions to be emitted before earlier
reads (where a new write transaction is started the cycle a read
response returns).

Now both read and write transactions are emitted when their response is
seen.

In addition the error field from the response is copied into the
transaction.
2021-09-01 09:43:37 +01:00
Greg Chadwick
6815e7b714 [rtl] Implement mvendorid/marchid/mimpid CSRs 2021-08-31 17:39:01 +01:00
Philipp Wagner
b99da424ff [style] Indent package bodies
The style guide requires the package body to be indented with two
spaces.
2021-08-31 15:30:28 +02:00
Philipp Wagner
a25790abf9 [style] Indent module header with two spaces
Both the parameter and the port list in a module header should be
indented with two spaces, according to our style guide.
2021-08-31 15:30:28 +02:00
Philipp Wagner
87bcd13a12 [style] Use logical operators for reset 2021-08-31 15:30:28 +02:00
Philipp Wagner
be27bc8bcf [style] Fix whitespace issues around operators
Our style guide typically require a single whitespace around operators.
2021-08-31 15:30:28 +02:00
Philipp Wagner
b5011ecec6 [style] Format module instantiations in tabular format
The style guide mandates tabular format in port expressions in module
instantiations
(https://github.com/lowRISC/style-guides/blob/master/VerilogCodingStyle.md#module-instantiation).

The style guide also mandates a two-space indentation for ports and
parameters in module instantiations.

Apply the formatting produced by verible-format to match our style
guide.
2021-08-31 15:30:28 +02:00
Tom Roberts
48f11c6733 [rtl] Add bus integrity checking
Extra bits are added alongside read/write data for the instruction and
data buses to facilitate data integrity checking.

Ibex testbench extended to generate the expected bits.

All other top-levels modified to add the new signals (which are mostly
ignored).

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-08-26 16:55:26 +01:00
Pirmin Vogel
14115ea3a8 [util] Document minimal requirement for Xilinx Vivado
This is related to lowRISC/Ibex#1425.
2021-08-26 14:42:26 +02:00
Greg Chadwick
3f9022a16d [rtl] Fix mtval for unaligned accesses
Previously the raw incremented address was used which is the calculated
address + 4. This is confusing as it refers to a byte that wouldn't be
accessed (e.g. a lw at 0x8000009e which faults on the access to
0x8000000a0, would report an mtval of 0x8000000a2). With this change
mtval will refer to the first byte on the other half of the word
boundary the unaligned access crosses.
2021-08-13 15:45:29 +01:00
Tom Roberts
65bf9c94f9 [rtl] Add LFSR permutation option
Random constants are sent through the hierarchy as parameters in-line
with other OpenTitan modules.

Further detail on this mechanism can be found in lowrisc/opentitan#2229

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-08-10 16:13:02 +01:00
Greg Chadwick
dbc2b6f5dc [rtl/doc] Update ePMP CSR addresses and documentation
mseccfg and mseccfgh have changed their addresses. This updates to the
newly allocated values.

The ePMP specification is now available as a versioned PDF,
documentation is updated to point to that removing the local PDF copy.
2021-08-05 08:01:56 +01:00
Canberk Topal
9af580f6d9 [fpga] Add power analysis scripts to FPGA example
This commit adds power analysis scripts to the Arty A7
example design. They can be used by setting the newly
added `FPGAPowerAnalysis` parameter to 1.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2021-08-03 16:51:16 +01:00
Canberk Topal
1b1247e1de [fpga] Changed to 2p_ram for FPGA top level
1-Port RAM is removed because of both execution and performance
issues. CLKIN1_PERIOD parameter is defined in clkgen module
for Vivado simulations.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2021-08-03 16:51:16 +01:00
Canberk Topal
4b54d79fb4 [sw/fpga] coremark/link.ld update for FPGA sim
This commit updates link.ld RAM length to include max BRAM capacity
for Arty A7-35. It also changes coremark makefile to include a .vmem
output, which then can be used for FPGA implementations.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2021-08-03 16:51:16 +01:00
Tom Roberts
7c0b1ff160 [rtl] Add register slice on output of shadow core
This decouples the shadow core from any timing paths and so should ease
implementation.

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-08-03 13:47:00 +01:00
Tom Roberts
4d729e20e5 [rtl] Buffer cleanup in top-level
A minor change to use the Width parameter of prim_buf. No functional
impact but stops the hierarchy from being cluttered with hundreds of
generate contexts in the top level.

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-08-03 13:47:00 +01:00
Dawid Zimonczyk
d44966373e Added cast to enum 2021-07-26 09:48:41 +01:00
Tom Roberts
a1902004f9 [rtl] Add ResetAll parameter
This parameter forces a reset of all registers inside the core. This is
required to guarantee a common starting point for lockstep and thus
prevent spurious lockstep failure alerts.

Another minor change in this commit rearranges the writeback stage
multiplexing to gate incoming lsu write data when not valid. This stops
any X values from the data bus propagating to the register file
signalling (and thus to the lockstep comparison) which would cause the
lockstep alert to be X. It has the side effect of possibly reducing
power consumption in the register file.

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-07-22 16:53:27 +01:00
Philipp Wagner
44777dc16d Copy verible-format configuration from OpenTitan
This configuration is the closest we can get to our style guide right
now, so let's go with that.
2021-07-22 13:17:21 +01:00
Philipp Wagner
d003d479ff Update lowrisc_ip to lowRISC/opentitan@da3ac7c4e
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
da3ac7c4eb23a92194874ad2daf2e5f9e3330572

* [memutil] Allow use without scrambled memories (Philipp Wagner)
* [prim_prince] Fix comment (Philipp Wagner)
* [memutil] Fix width mismatch (Philipp Wagner)
* [prim] Allow disabling SVAs ensuring REQ is held until ACK at run
  time (Pirmin Vogel)
* [prim] Fix typo that caused fifo_async to get stuck (Timothy Chen)
* [prim] Add a missing ROM_CFG_DEFAULT to prim_rom_pkg.sv (Rupert
  Swarbrick)
* [dvsim] Do not assume the build failed if "ERROR" is printed
  (Philipp Wagner)
* [prim_subreg_shadow] Invert meaning of SWACCESS in shadow/stage regs
  (Michael Schaffner)
* [prim_arb_tree/rv_plic_target] Remove TODOs due to a Vivado tool bug
  (Michael Schaffner)
* [primgen] Remove unused import (Philipp Wagner)
* [primgen] Add shebang (Philipp Wagner)
* [primgen] Make primgen "portable" again (Philipp Wagner)
* [dv] Small optimization in memutil (Philipp Wagner)
* [tools/ascent] updated ascent to use the --job-prefix option (Rasmus
  Madsen)
* [otp_ctrl] Remove invalid command error (Michael Schaffner)
* [tlul] Add some missing dependencies (Michael Schaffner)
* [otbn/otp_ctrl] Replicate dmem scrambling keystream (Michael
  Schaffner)
* [adc_ctrl] Various preparation steps for d2 (Timothy Chen)
* [tools/dvsim] Fix some VCS flags (Guillermo Maturana)
* Revert "[prim] Do remove prim_esc.core from the dependencies"
  (Rupert Swarbrick)
* [prim] Remove dependency of prim:esc on a hardware block (Rupert
  Swarbrick)
* [lint] prim_ram_1p_scr verilator lint fixes (Greg Chadwick)
* [dv] Add scrambled_ecc32_mem_area for memutils (Greg Chadwick)
* [dv] Add C++ memory scrambling model (Greg Chadwick)
* [tools/dsim] Fix non-LRM compliant code (Guillermo Maturana)
* [prim] Do remove prim_esc.core from the dependencies (Michael
  Schaffner)
* [dv/dv_utils] Improvement on `max` function (Cindy Chen)
* [alert_handler] Implement reverse ping feature (Michael Schaffner)
* [prim_esc] Split the prims into their own core file (Michael
  Schaffner)
* [dvsim] Fix GUI mode and launcher creation fixes (Srikrishna Iyer)
* [dv/common] Stress_all_with_rand_reset apply reset concurrently
  (Cindy Chen)
* [dv/all] update scoreboard `csr_addrs` accesses (Udi Jonnalagadda)
* [dv/csr_utils] update unmapped_addr calculation (Udi Jonnalagadda)
* [dv] Update intg alert names (Weicai Yang)
* [dv, flash_ctrl] Fix the intr test (Srikrishna Iyer)
* [prim_fifo_async] Fix a width calculation issue in case of Depth = 1
  (Michael Schaffner)
* [dv] Update VCS opt for uvm_hdl_* (Weicai Yang)
* [dv, util] Make poll_for_stop() opt-in (Srikrishna Iyer)
* [dvsim] Separate publish report option [PART1] (Cindy Chen)
* [dv/kmac/sram] reduce iterations of smoke test (Udi Jonnalagadda)
* [dv/stress_all_with_reset] Revert back IPs that uses apply_reset
  (Cindy Chen)
* [dv/edn_reset] Fix apply_reset to concurrently deassert resets
  (Cindy Chen)
* [dv] Update VCS cov merge opts (Srikrishna Iyer)
* [dv] Add TL integrity error test for CSR (Weicai Yang)
* [dv, chip] Remove USB clk driver (Srikrishna Iyer)
* [script/dvsim] Update output folder (Cindy Chen)
* [dv/edn_reset] Update IPs that overrides apply_reset task (Cindy
  Chen)
* [dv/edn_reset] Fix stress_all_with_rand_reset error (Cindy Chen)
* [dv/dv_base_scoreboard] remove duplicated code (Cindy Chen)
* [otbn,dv] Teach otbn_memutil to track expected end address (Rupert
  Swarbrick)
* [dv, dv_utils_pkg] Fix common int typedefs (Srikrishna Iyer)
* [prim_lfsr] Fix spyglass lint warnings (Michael Schaffner)
* [prim_clock_gating] Target 7series Xilinx devices (Philipp Wagner)
* [dv/edn_rst] Add coverage to collect edn reset and dut reset (Cindy
  Chen)
* [otp_ctrl/lc_ctrl] Add LC TAP register to control OTP test
  mechanisms (Michael Schaffner)
* [prim_alert*/prim_esc*] Rework placement of size_only bufs/flops
  (Michael Schaffner)
* [dv] fix a typo in tl_device_access_types_testplan (Weicai Yang)
* [prim_otp] Rework generic model to match new error behavior (Michael
  Schaffner)
* [dv/tlul_common_test] Add a testplan for TLUL integrity check (Cindy
  Chen)
* [dvsim] Allow recursive testplan import (Srikrishna Iyer)
* [primgen] Use verible-verilog-syntax for parsing (Mariusz Glebocki)
* [prim] Break always_comb block to avoid apparent loop (Rupert
  Swarbrick)
* [dvsim] Fix testplan bugs (Srikrishna Iyer)
* [fpv] update secded_gen (Cindy Chen)
* [dv/template] small fixes on index.md format (Cindy Chen)
* [prim_otp] Add a waiver for power signal unused in generic prim
  (Michael Schaffner)
* [simutil_verilator] Improve timeout handling (Rupert Swarbrick)
* [testplans] Rename entries with testpoints (Srikrishna Iyer)
* [dvsim/testplan] Fix the rendered testplan (Srikrishna Iyer)
* [dv/cov] exclude prim_lfsr and prim_prince (Udi Jonnalagadda)

Signed-off-by: Philipp Wagner <phw@lowrisc.org>
2021-07-20 13:44:11 +01:00
Philipp Wagner
270cd91b38 Fix the verible-format CI job
The toplevel core file got renamed, but the experimental verible-format
CI job wasn't updated in sync. Fix that.
2021-07-15 15:47:57 +01:00
Philipp Wagner
ed46a5c9f5 [ci] Update dependencies to match OpenTitan
Use the same dependencies as we use in OpenTitan to make it easier to
diagnose potential issues. No change in behavior expected.
2021-07-14 11:12:09 +01:00
Tobias Wölfel
7032df0d8b [formal] Read Verilog files in Yosys
All files read at this point should be Verilog and not SystemVerilog.
Do not use the SystemVerilog specifier for reading files.
2021-07-14 11:02:46 +01:00
Tobias Wölfel
e1eaa1c804 [formal] Switch to new top level
Use `ibex_top` instead of `ibex_core`.
2021-07-14 11:02:46 +01:00
Rupert Swarbrick
594c2368c3 Get riscv-formal flow working again
No guarantees that this actually does anything useful, but at least
the Makefile works again.
2021-07-14 11:02:46 +01:00
Leon Woestenberg
7506d4da2a [sw] Fix GNU GCC toolchain component substitution for file path case.
This invocation would break:

make -C examples/sw/led/ CC=/opt/lowrisc-toolchain-gcc-rv32imc-20210412-1/bin/riscv32-unknown-elf-gcc

because the "-gcc" occurence inside the directory name would also be replaced.

Fix by first deriving CROSS_COMPILE from CC, then conditionally build other tool file names/paths.

Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
2021-07-12 12:53:53 +01:00
Dawid Zimonczyk
a0582afb4e Avoid premailer 3.9.0 due to API breakage
From OpenTitan pull request #6769
2021-07-12 10:27:29 +01:00
Rupert Swarbrick
90ff7ca6c3 [dv,core_ibex] Only write sim.log once
We're already redirecting stdout to sim.log in run_rtl.py. Specifying
'-l' as well meant that VCS opened sim.log in a separate FD.
Suprisingly enough, this mostly worked, but not always! Just write
once :-)
2021-06-29 14:55:22 +01:00
Greg Chadwick
8ec65d02f8 [dv] Newline tweaks for regression logging 2021-06-29 14:08:01 +01:00
Greg Chadwick
ef545a8bd8 [dv] Improve results reporting
This commits adds a yaml based intermediate format for test results.
compare.py serialises a TestRunResult (a named tuple type) into this
format for each test run it checks. collect_results.py reads them all
back in to produce reports.

Three reports are output:
- regr.log - plain text report much like the one previously produced
- regr_junit.xml, regr_junit_merged.xml - JUnit report format, the
  _merged version batches together multiple tests to appear to be a
  single test case under a test suite. This gives better results with
  Azure's JUnit reporting.
2021-06-25 18:31:21 +01:00
Tom Roberts
6daae3509a [rtl] Modify fetch_en_i behavior
This signal used to be a one shot enable out of reset. We need an option
to pause execution for OpenTitan, so fetch_enable is extended to cover
that.

The signal is already driven low by the testbench at the end of test.
This is moved after the performance counter reads to ensure they can
complete.

Fixes #1105

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-06-23 09:16:27 +01:00
Tom Roberts
8a4c1b9e6d [dv/uvm/core] Fix a minor reset issue
Fix the reset polarity in the irq driver (clears irq signals to zero
on reset rather than them being x) plus remove an unused signal.

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-06-23 09:16:27 +01:00
Tom Roberts
62aa2bcab8 [dv/uvm/core_ibex] Fix timeout issue in wfi tests
The test loops around waiting for the core to sleep then sending
interrupts to wake it. In some cases, the sequence sends an interrupt
that isn't enabled. It never gets back to try again with a new interrupt
since the test is waiting to see wfi first. This change removes that
requirement since it is redundant anyway (have to see wfi to sleep).

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-06-18 17:36:38 +01:00