Commit graph

1991 commits

Author SHA1 Message Date
Greg Chadwick
357b40828f [rtl] Add MSECCFGH CSR
This is the top 32 bits of MSECCFG. It currently has no specified bits
so reads as 0 and ignores writes.
2021-03-19 10:51:49 +00:00
Greg Chadwick
d78e0d9a06 [rtl] Hard wire dcsr.stepie to 0
This indicates interrupts do not occur in single step mode.

Fixes #1279
2021-03-17 15:59:47 +00:00
Greg Chadwick
50be975226 [rtl] Fix hardware breakpoints and exceptions interaction
This change will cause the ID stage to stall if there is a potential
debug mode entry until instructions in both ID and WB have completed.
This fixes an issue with incorrect behaviour around hardware breakpoints
and exceptions that could cause exception entry to be missed, hardware
breakpoints to be triggered incorrectly or missed entirely.

In addition single step control logic is altered to work correctly with
the new debug mode entry behaviour.
2021-03-17 15:59:47 +00:00
Yusef Karim
62b1a30c7d Fix spacing for bullet points to appear
Bullet points now appear properly for the last paragraph under the Data Independent Timing section.
2021-03-16 07:49:18 +00:00
Udi Jonnalagadda
6576247a1e [ci/ibex] temporarily remove pmp_full_random_test
this test is arbitrarily failing in regressions on a Spike timeout,
temporarily remove this to avoid blocking.

@udinator to fix this in the near future.

Signed-off-by: Udi Jonnalagadda <udij@google.com>
2021-03-14 20:11:34 +00:00
Tom Roberts
42827fc9cd [rtl/icache] Switch ECC granularity to 32bits
Changes the ECC granularity in the data RAMs from 64bit to 32bit. This
is to align with an upcoming change in bus ECC. Relates to
lowRISC/opentitan#5450

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-03-12 17:27:52 +00:00
Tom Roberts
2c75c2b2ec Update lowrisc_ip to lowRISC/opentitan@1ae03937f
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
1ae03937f0bb4b146bb6e736bccb4821bfda556b

* [prim/fifo_async] Add assertions on pointers (Tom Roberts)
* [prim/fifo_async] Add support for Depth <= 2 (Tom Roberts)
* [prim/fifo_async] Code tidy-up (Tom Roberts)
* [top / ast] Continued ast integration (Timothy Chen)
* [dvsim] Use bash when running make underneath (Srikrishna Iyer)
* [prim] Increase maximum width for prim_util_memload to 312 (Greg
  Chadwick)
* [sram_ctrl] Fix potential back-to-back partial write bug (Michael
  Schaffner)
* [dvsim] Fix for lowRISC/opentitan#5527 (Srikrishna Iyer)
* [lint] Waive Verilator UNUSED warnings for packages (Rupert
  Swarbrick)
* [uvmdvgen] Update DV doc path and terminology (Srikrishna Iyer)
* [clkmgr] Fix dft issues (Timothy Chen)
* [util] add `dec` types to prim_secded_pkg (Udi Jonnalagadda)
* [util] minor updates to secded_gen (Udi Jonnalagadda)
* [lint] Fix a bunch of lint warnings related to long lines (>100
  chars) (Michael Schaffner)
* [dv] Update common intr_test seq (Weicai Yang)
* [util] Slight refactor of secded_gen.py (Timothy Chen)
* [tlul] Add memory transmission integrity checks (Timothy Chen)
* [dvsim] Move clean_odirs to `util.py` (Srikrishna Iyer)
* [dvsim] Split Deploy into Deploy and Launcher (Srikrishna Iyer)
* [dvsim] Add utils.TS_FORMAT* vars (Srikrishna Iyer)
* [dv/lock_reg] Update IPs to adopt the lock_reg changes (Cindy Chen)
* [dv/enable_regs] Support enable registers have more than one field
  (Cindy Chen)
* [dv/base_reg] use m_field instead of accessing field (Cindy Chen)
* [dv/sram] add SRAM scrambling model for DV (Udi Jonnalagadda)
* [dv/tools] Updated Coverage flow for xcelium (Rasmus Madsen)

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-03-12 16:15:22 +00:00
Greg Chadwick
50f09b71a9 [rtl] Fix lint issues 2021-03-11 16:10:32 +00:00
Udi Jonnalagadda
70c3702421 [dv/ibex] filter out tests on a per-config basis
This PR adds functionality to filter out tests during regressions for a
particular config.

e.g. if a full regression is kicked off using the `small` config, we
don't want to attempt to run any PMP and bitmanip tests as the RTL
parameter-set will not support it.

To do this, a new YAML field called `rtl_params` is added to relevant
test entries, to indicate what parameters (if any) are required to be
able to run the particular test, along with the required value of said
parameters.

`sim.py` will then parse this field (if it exists), and using
information from `ibex_configs.yaml` pertaining to the current config,
will remove tests from being run on-the-fly.

This also gives us the convenient side effect of not having to re-run
instruction generation if there is a parameter/config mismatch, we can
just rerun the RTL compilation and simulation stages safely.

Signed-off-by: Udi Jonnalagadda <udij@google.com>
2021-03-10 19:00:52 +00:00
Tom Roberts
6d9e1aca8a [rtl] Minor lint fix in ibex_core.sv
Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-03-04 12:32:04 +00:00
Vladimir Rozic
5363499190 [rtl] Add MCOUNTEREN CSR
This commit adds the MCOUNTEREN CSR as required by the RISC-V spec.
The register is defined as WARL. At the moment, Ibex doesn't enable U-mode
access to the performance montiors. Consequently, writes to the register are
ignored and it reads as zero which is okay according to the spec.

This resolves lowRISC/Ibex#1278 .
2021-03-04 12:00:59 +00:00
Tom Roberts
5ef18f0b78 Update lowrisc_ip to lowRISC/opentitan@6cc5c164b
NOTE this commit includes various changes to align the Ibex repo with
changes upstream in OT!

Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
6cc5c164ba96d339f06cbcede0d17d2c96ce3c05

* [dv] Add SV_FCOV_SVA back (Srikrishna Iyer)
* [DV][FCOV] Minor updates to lowRISC/opentitan#5414 (Srikrishna Iyer)
* [dvsim] Fix --cov + --build|run-only bugs (Srikrishna Iyer)
* [lint] Waivers for rv_core_ibex lint (Greg Chadwick)
* [lint] Allow one branch in unique case (Greg Chadwick)
* [dv/macros] Add fcov macros from Ibex (Tom Roberts)
* [dvsim/verilator] Fix pre-build cmd failure when hw/foundry is
  absent (Michael Schaffner)
* [verilator/otp] Enable OTP preloading in verilator (Michael
  Schaffner)
* [dvsim] Use builtins wherever possible (Srikrishna Iyer)
* [prim] Avoid an apparent combinatorial loop in prim_secded_*_dec.sv
  (Rupert Swarbrick)
* [dv/shadow_reg] Fix aes shadow reg error (Cindy Chen)
* [lint] Remove comportable waivers from non-comportable IPs (Michael
  Schaffner)
* [dv] Fix VPD dumping (Srikrishna Iyer)
* [prim] Waive Verilator lint warning in prim_lfsr.sv (Pirmin Vogel)
* [dv] Hard code various dv connections until full hook-up (Timothy
  Chen)
* [tlul] Add payload checker and generator on device side only.
  (Timothy Chen)
* [prim_packer] Silence verilator width warnings (Rupert Swarbrick)
* [dvsim] lint fixes to FlowCfg (Srikrishna Iyer)
* [dvsim] Minor improvement to FlowCfg (Srikrishna Iyer)
* [dvsim] lint fixes to Scheduler (Srikrishna Iyer)
* [dvsim] Very small update to Timer. (Srikrishna Iyer)
* [lint] Update Verible lint parser to detect Verible syntax errors
  (Michael Schaffner)
* [lint] Spot errors in the lint flow that we weren't expecting
  (Rupert Swarbrick)
* [lint] Remove Fusesoc-related message waivers (Michael Schaffner)
* [top / rst] Adjust the way rst_ni is used in design (Timothy Chen)
* [dvsim/syn] Update parsing script and area reporting (Michael
  Schaffner)
* [dv/regwen] update REGWEN conventions (Cindy Chen)
* [dv/tools] Bug fix to common.tcl tb_top section. (Eitan Shapira)
* [dv] Fix stress_all with reset (Weicai Yang)
* [prim] Add a new slow to fast clock synchronizer (Tom Roberts)
* [prim] Minor lint fix (Tom Roberts)
* [tlul] Add instruction type to tlul (Timothy Chen)
* [top] Ast updates (Timothy Chen)
* [lint] Increase threshold for max number of bits in an array
  (Michael Schaffner)
* [dv] add dv_base_reg_pkg to env_pkg template (Udi Jonnalagadda)
* [dv/verilator] Ignore foundry dir (Srikrishna Iyer)
* [dv] Provide license diagnostic info for VCS (Srikrishna Iyer)
* [prim/otp_ctrl] Fix ECC correctable bug in generic OTP wrapper
  (Michael Schaffner)
* [prim_ram_1p_scr] Make parity and diffusion layer settings more
  flexible (Michael Schaffner)
* [prim] fix flash sram adapter use for configuration space (Timothy
  Chen)
* [dv] Make CSR fields randomizable by default. (Srikrishna Iyer)
* [dv/prim] minor updates (Udi Jonnalagadda)
* [top] Minor lint fixes (Timothy Chen)
* [prim_flash] Flash port alignments (Michael Schaffner)
* [prim_util_pkg] Fix DC warning in _clog2() (Philipp Wagner)
* Add missing full_o output signal of prim_fifo_sync (Philipp Wagner)
* [dv] Gracefully kill simulation (Srikrishna Iyer)
* [dv] Minor updates to prim tbs (Srikrishna Iyer)
* [flash / top] Minor edits based on reviews (Timothy Chen)
* [flash_ctrl / top] Various functional updates to flash (Timothy
  Chen)
* [dv/otp_ctrl] regwen sequence (Cindy Chen)
* [prim] Wire up full_o sync fifo output port in prim_sram_arbiter
  (Rupert Swarbrick)
* [dvsim] Generate FUSESOC_IGNORE at top of scratch root (Rupert
  Swarbrick)
* Revert "[lint] Remove Fusesoc-related message waivers" (Michael
  Schaffner)
* Revert "[lint] Rename tool warnings to flow warnings and reduce
  their severity" (Michael Schaffner)
* Revert "[lint] Provision syntax error filter for Verible lint"
  (Michael Schaffner)
* [prim] Update fifo behavior during reset (Timothy Chen)
* [dv] Move cip related macros to cip_macros (Weicai Yang)
* [dv/dvsim] Fix when next_item does not have dependency (Cindy Chen)
* [prim_packer_fifo/rtl] reset to disable output controls (Mark
  Branstad)
* [lint] Provision syntax error filter for Verible lint (Michael
  Schaffner)
* [lint] Rename tool warnings to flow warnings and reduce their
  severity (Michael Schaffner)
* [lint] Remove Fusesoc-related message waivers (Michael Schaffner)
* [dv/dvsim] collect coverage in scheduler (Cindy Chen)
* [dvsim] Fix Syn class (Michael Schaffner)
* [dv/shadow_reg] move get_shadow_regs function to dv_base_ral_block
  (Cindy Chen)
* [lc_ctrl] Switch ECC to standard Hamming code (Michael Schaffner)
* [prim_ram_*p_adv/prim_otp] Add option to use standard Hamming ECC
  (Michael Schaffner)
* [secded_gen] Fix template bug that results in lint error (Michael
  Schaffner)
* [prim/fifo_async] Disallow non-power-of-two depths (Tom Roberts)
* [dv/alert] update shadow_reg alert naming in DV (Cindy Chen)
* [dv] Align csr::reset_asserted to actual reset pin (Weicai Yang)
* [prim_secded*_fpv] Generate FPV testbenches (Michael Schaffner)
* [prim_secded*] Regenerate all SECDED primitives (Michael Schaffner)
* [secded_gen] Add ability to generate FPV TB's and correct Hamming
  code (Michael Schaffner)
* [dvsim] Run cov_merge / cov_report as part of the main set of jobs
  (Rupert Swarbrick)
* [dvsim] Get rid of Deploy's static dispatch_counter (Rupert
  Swarbrick)
* [dvsim] Make the scheduling logic per-target (Rupert Swarbrick)
* [dvsim] Remove "status" from Deploy items (Rupert Swarbrick)
* [dvsim] Create jobs with dependencies instead of sub-jobs (Rupert
  Swarbrick)
* [dvsim] Simplify SimCfg._gen_results (Rupert Swarbrick)
* [dvsim] Factor deploy method out of Deploy object (Rupert Swarbrick)
* [dvsim] Move time tracking into its own class in Deploy.py (Rupert
  Swarbrick)
* [dvsim] Fix printing of Deploy objects (Rupert Swarbrick)
* [dv] make dv_macros.svh more UVM_agnostic (Srikrishna Iyer)
* [dv/prim] reduce smoke test iterations (Udi Jonnalagadda)
* [dv/hmac] reduce runtime for sha_vector test in smoke regression
  (Cindy Chen)
* [DV] Enable cov comp creation iff cov is enabled (Srikrishna Iyer)
* [prim_alert] Fix xcelium compile error (Cindy Chen)
* [alert_rxtx/fpv] Update alert sender FPV testbenches (Michael
  Schaffner)
* [alert_rxtx] Add option to latch fatal alert in alert sender
  (Michael Schaffner)
* [kmac/dv] KMAC smoke test (Udi Jonnalagadda)
* [dv/str_utils_pkg] add byte_to_str function (Udi Jonnalagadda)
* [prim] - Add new prim_lc_dec (Jacob Levy)
* [util] Move design-related helper scripts to util/design (Michael
  Schaffner)
* [prim-flash] Add missing deps (Srikrishna Iyer)
* [dv] Define SIMULATION during DV sims (Michael Schaffner)
* [dv] Fix a typo in tb.sv.tpl (Weicai Yang)
* Cleanup: Remove executable bits from source files (Philipp Wagner)
* [dv] Use separate clock for EDN (Weicai Yang)
* [dv] Add macro DV_EDN_IF_CONNECT to simplify EDN connect in TB
  (Weicai Yang)
* [dv] Fix typo in clk_rst_if (Weicai Yang)

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-03-04 09:56:36 +00:00
Tom Roberts
6e617c4097 [vendor] Remove fcov patch from dv_utils
This code is now upstream in the source repository.
Also amend dv_utils patch to apply cleanly.

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-03-04 09:56:36 +00:00
Udi Jonnalagadda
eaa7bb6eb4 [dv/ibex] update how coverage is merged
Currently, the `cov` step in the DV Makefile will only merge coverage
databases emitted directly from Ibex simulations, and will not pick up
any coverage databases generated by the RISCV-DV functional coverage
flow.

This PR updates the `gen_cov()` function in `sim.py` to recursively
search for any generated coverage directories and then merges them all.

Resultant coverage reports include all code coverage, Ibex functional
coverage, and RISCV-DV functional coverage.

The coverage-related targets in the Makefile have also been renamed to
improve clarity.

Signed-off-by: Udi Jonnalagadda <udij@google.com>
2021-03-03 01:01:28 -08:00
Rupert Swarbrick
82d0654c97 Don't automatically generate disassembly in the example Makefile
Anyone who needs to disassemble their generated ELF can probably just
call objdump directly and the precise set of flags have already
confused at least one potential contributor[1].

We're keeping the canned objdump command for "engineers that know
where to look" because some have said they find it useful. Run it with
e.g.

    make -C examples/sw/simple_system/hello_test disassemble

[1] https://github.com/lowRISC/ibex/issues/1263
2021-03-02 09:21:09 +00:00
Greg Chadwick
faa1e98a6e [dv] Fix bug in sim.py and type in testlist 2021-03-01 10:19:55 +00:00
Tom Roberts
ee8d1051bb [rtl] Add crash dump outputs
Relates to lowrisc/opentitan#4618

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2021-03-01 10:12:04 +00:00
Greg Chadwick
3e7720e403 [rtl] Lint fixes for Ascent lint issues 2021-03-01 09:52:57 +00:00
Greg Chadwick
c3bd4fa7ef [rtl] Remove paths between dmem and imem signals
Prior to this change Ibex had multiple feedthrough paths from the data
memory interface to the instruction memory interface. This existed
because Ibex would hold off doing a instruction fetch for a jump or
branch if there was a outstanding memory request. It would wait for the
response to be available so either the jump or branch would occur or an
exception was taken.

With this change the branch or jump will speculatively begin the
instruction fetch whilst there is an outstanding memory request. Should
an exception result from the memory request the fetch will be discarded
and the exception taken as normal.

An alternative fix would not factor the data error response
(data_err_i) directly into the controller logic for branches and jumps.
With this option new stall cycles would be introduced anywhere a branch
or jump immediately follows a memory instruction which would have an
adverse impact on performance.
2021-02-26 17:32:34 +00:00
Rupert Swarbrick
6ebc6bcb9f [simple_system] Fix type for mhpmcounter_get
It's probably clearer if this 64-bit counter is treated as a uint64_t,
not an int64_t (the code using it downstream expects non-negative
values).
2021-02-25 15:34:02 +00:00
Greg Chadwick
99b8f61223 [rtl] Debug mode controller changes
* `if` in `DBG_TAKEN_IF` is needless as the conditions it checks will be
  true if controller enters `DBG_TAKEN_IF` state

* flop `enter_debug_mode` so `FLUSH` state looks at what
  `enter_debug_mode` was when it was seen in `DECODE` state rather than
  what it has become. In particular the controller could enter `FLUSH`
  on the basis of performing a WFI then divert down the debug control
  path due to a new debug request being raised. In this instance it is
  preferable for the WFI to complete entering `SLEEP` before the debug
  request wakes the core back up.
2021-02-18 17:34:17 +00:00
Philipp Wagner
65287f7d7b Fix deprecated sphinx html_context usage in conf.py
We were using the old html_context which has been deprecated
for a while. This PR switches to html_css_files instead.
See sphinx-doc/sphinx#8885 for more information.
2021-02-18 12:06:38 +00:00
Greg Chadwick
7cee76bf05 [dv] Reorder checks in sim.py
The UVM log should be checked for failures before attempting to process
the core trace log. A simulation failure could mean the trace log
doesn't exist and is is preferable to report the simulation error from
the log rather than trace not found as a failure cause.
2021-02-15 17:52:35 +00:00
Greg Chadwick
0cb2afffa9 Update google_riscv-dv to google/riscv-dv@0b62525
Update code from upstream repository https://github.com/google/riscv-
dv to revision 0b625258549e733082c12e5dc749f05aefb07d5a

* Add a knob to use rounding mode from the instruction (google/riscv-
  dv#767) (taoliug)
* Add rounding mode support for floating point arithmetic instructions
  (google/riscv-dv#766) (taoliug)
* Fix syntax issue (google/riscv-dv#765) (taoliug)
* Add riscv_amo_instr (aneels3)
* convert string to enum type (ishita71)
* Remove unintended errors in the coverage flow (google/riscv-dv#757)
  (taoliug)
* Fix c_test handling in the YAML testlist (google/riscv-dv#756)
  (taoliug)
* Add support for new Spike trace format (google/riscv-dv#755) (Daniel
  Bates)
* Fix google/riscv-dv#751 for floating point coverage (Weicai Yang)
* Fix issues with implemented TODO's (aneels3)
* fix randomize_gpr (aneels3)
* Add file riscv_b_instr.py (ishita71)
* add std_randomize todo (pvipsyash)
* Add todo for floating_point test (ShraddhaDevaiya)
* Add scripts to integrate with Metrics regression platform (Aimee
  Sutton)

Includes a fix to dv/uvm/core_ibex/sim.py to use `asm_test` rather than
`asm_tests` due to changes in RISCV-DV

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2021-02-04 08:37:00 +00:00
Greg Chadwick
860b085e25 [dv] Add RISCV-DV patch to fix csr_test
The assembly for the  CSR test is generated by a script from RISCV-DV. A
.org directive is required to put the generated code at the correct
start address for the instantiated Ibex core.
2021-02-04 08:37:00 +00:00
Greg Chadwick
aa3067cf43 [dv] Fix MISA CSR reset value
MISA reset value now indicates B extension support
2021-02-04 08:37:00 +00:00
Greg Chadwick
d8b2cb0a68 [dv] Fix issues with timeout on WFI
riscv_interrupt_instr_test and riscv_debug_instr_test aim to produce
interrupt and debug requests once per unique instruction they've seen.
One exception to this is WFI instructions, as these always require an
interrupt or debug request to wake the core. This fixes two timeout
issues with WFI instructions.

1. The return value of `decode_instruction` is used to determine whether
   an instruction should have an interrupt or debug request generated
   for it. For WFI this must always happen or the test will hang.

2. Before calling check_stimulus in a test the testbench waits for 50
   clock cycles. For the riscv_interrupt_instr_test and
   riscv_debug_instr_test if a WFI is executed during these 50 cycles
   the test will hang. This adds a check to see if the core has gone to
   sleep in those tests and if so sends interrupt/debug stimulus to wake
   it up.
2021-02-04 08:37:00 +00:00
Greg Chadwick
e749d8fe3d [dv] Add ePMP support to cs_registers testbench 2021-02-01 12:22:49 +00:00
Greg Chadwick
c8c3c55071 [dv] Fix race condition in cs_registers testbench
The `driver_tick` DPI call drove inputs directly but was being scheduled
in an undefined order with other always_ff blocks.  This results in a
race condition where some always_ff blocks see old inputs and others see
new in the same clock tick. Instead use values from `driver_tick` to
perform NBA updates and avoid the race condition.
2021-02-01 12:22:49 +00:00
Greg Chadwick
8defdc4d6c [doc] Add ePMP information 2021-02-01 12:22:49 +00:00
Greg Chadwick
374e05ec65 [rtl] Add ePMP support to Ibex
This implemements the RISC-V Trusted Execution Environment (TEE) working
group proposal 'PMP Enhancements for memory access and execution
prevention on Machine mode'. The proposal is awaiting ratification and
is not expected to change beyond minor tweaks before it becomes part of
the RISC-V priviledged specification.

No seperate 'classic' PMP only mode is provided as different PMP
behaviour only occurs when the MSECCFG CSR is written to. This CSR is
introduced by the proposal and has no specified function in the current
RISC-V priviledged specification.
2021-02-01 12:22:49 +00:00
Greg Chadwick
373212ee89 [dv] Improve sim.py error reporting
* Handle missing log files with error messages rather than terminating
  on unhandled exceptions
* Output potential failure causes from sim log file into regression log
* Alter per test output to make it clearer what line corresponds to what
  test
* Only output [PASSED] or [FAILED] a single time per test
* Don't output [PASSED] where sim log is good but ISS comparison is not
2021-01-29 16:58:26 +00:00
Rupert Swarbrick
f291d1beb9 [dv] Rename stored copy of run phase
In UVM 1.2, at least, uvm_component (a base class of
core_ibex_base_test) still has a method called run(). Ironically, this
has been renamed to "run_phase" to avoid conflicting with user names,
but the old-style phase names still exist at the moment.

Rename our copy of the phase object to cur_run_phase, which doesn't
conflict. Also, set it back to null at the end of the run_phase()
task. We shouldn't ever use it afterwards, and it's probably a good
idea to explode with a null object error if we do.
2021-01-29 08:14:51 +00:00
Rupert Swarbrick
8d43b854ab [dv] Be explicit about the target priv_mode in wait_ret test
The previous code contained

    wait (dut_vif.dut_cb.priv_mode === select_mode())

and VCS warns that this wait block will only trigger on changes to
explicit arguments. That is, if the in_nested_trap field changes, so
the return value of the select_mode() method would change to match
priv_mode, the wait statement won't finish.

This patch explicitly stores a snapshot of the value of select_mode()
just before the wait line. I think this is the intended behaviour, and
will no longer trigger warnings from VCS.
2021-01-29 08:14:21 +00:00
Rupert Swarbrick
6ab3e4a993 [dv] Wire up alerts to dut probe interface
This silences VCS warnings about the DUT having missing port
connections. It doesn't add any actual testing for these signals.

The patch also re-orders the signals to match the order in
ibex_core_tracing.sv, to make it easier to spot what's going on by
eye.
2021-01-27 17:04:12 +00:00
Rupert Swarbrick
e318cd8dd5 Specify boot address in hex to avoid 32-bit signed overflow
I wonder whether we could use some form of quoting to allow
"32'h8000_0000" to get through Riviera's TCL, but we don't have any
way to test, so let's go with the easy option.
2021-01-27 14:30:58 +00:00
Rupert Swarbrick
05b9f51403 [syn] Fail a bit more gracefully if something goes wrong 2021-01-27 10:43:28 +00:00
Rupert Swarbrick
b295f07b2d [doc] Update dependency descriptions for Spike/OVPsim
This should match what's going on a bit more accurately. The link to
OVPsim now points at the (free of cost) commercial tool: riscv-ovpsim
doesn't support the bitmanip specification that we're using at the
moment.
2021-01-25 17:41:40 +00:00
Greg Chadwick
77b9e9c78c [syn] Add missing include path
With the introduction of dv_fcov_macros.svh we need to add it as an
included path for sv2v.
2021-01-25 17:37:18 +00:00
Rupert Swarbrick
fbe4e9da08 [verilator] Remove clock gating waiver and add extra warning
The -Wwarn-IMPERFECTSCH flag is suggested in the Verilator docs (to
help spot if we get a clock gating hint wrong). The waiver is no
longer needed because we now add the relevant hint in the
RTL (vendored in prim_generic_clock_gating.sv from OpenTitan).
2021-01-25 10:25:26 +00:00
Rupert Swarbrick
07b65abbd0 [rtl] Fix lint "fix" with DbgTriggerEn
The previous change was wrong: it was trying to define a signal with
DbgHwNumLen bits that contained DbgHwBreakNum - 1. Unfortunately, '1
is *not* the same as a zero-extended version of 1'b1.
2021-01-22 15:26:27 +00:00
Rupert Swarbrick
7624481972 [rtl] Fix lint warning when DbgTriggerEn parameter is set
DbgHwBreakNum - 1 is an int, so generates a warning if it's assigned
to tselect_d (of type logic [DbgHwNumLen-1:0]). Explicitly generate
the value we need as a localparam.

This lint warning doesn't appear by default in the Ibex repository,
because DbgTriggerEn is disabled. It does, however, appear in
OpenTitan because we enable it there.
2021-01-22 13:01:07 +00:00
Greg Chadwick
794d865f56 [dv] Ibex uarch functional coverage
This adds a framework for gathering functional coverage for Ibex
microarchitecture along with a selection of initial coverpoints.
2021-01-22 11:12:08 +00:00
Greg Chadwick
d717e2385e Update lowrisc_ip to lowRISC/opentitan@7aa5c2b89
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
7aa5c2b890fa5d4e3d0b43e0f5e561cb7743a01d

* [flash] updated flash wrapper md file (Dana Agur)
* [flash / top / ast] functional updates (Timothy Chen)
* [ralgen, dv] Associated changes to ralgen (Srikrishna Iyer)
* [prim_sync_reqack_data] Fix SVA checking DST-to-SRC data stability
  (Pirmin Vogel)
* [dv/keymgr] temp disable alert checking in scb (Cindy Chen)
* [dvsim] Fix a wrong path in print message (Weicai Yang)
* [prim] Teach verilator to recognise a clock gate (Rupert Swarbrick)
* [prim_lc_sync] Add AsyncOn parameter to enable/disable the sync
  flops (Michael Schaffner)
* [clkmgr / top] Add clock divider step down to support lc_ctrl
  transition (Timothy Chen)
* [prim_sync_reqack] Use NRZ protocol internally for increased
  throughput (Pirmin Vogel)
* [prim] correct interface documentation. (Timothy Chen)
* [flash_ctrl] Add tlul configuration interface to prim_flash (Timothy
  Chen)
* [flash_ctrl] Use hamming code for 64b ECC (Timothy Chen)
* [prim/edn] Fix lint error (width mismatch) (Eunchan Kim)

Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2021-01-22 11:12:08 +00:00
Greg Chadwick
698cf93183 [dv] Patch for fcov macros in dv_utils 2021-01-22 11:12:08 +00:00
Pirmin Vogel
c69fc8b6f2 [rtl] Fix overlapping encodings of immediate instructions in tracer package
This commit modifies the encoding of SROI, RORI, SBEXTI, GREVI and GORCI by
forcing Bit 26 to zero to prevent overlapping encodings with FSRI.

The bitmanip draft spec doesn't explicitly state that Bit 26 for those
instructions must be zero. However, those instructions only ever use
log2(XLEN) LSBs of the immediate. This means they don't use Bit 26 in RV32.
Instead, whenever Bit 26 is set, these instructions are instead decoded as
FSRI.
2021-01-21 17:11:47 +01:00
Pirmin Vogel
e64f94e798 [rtl] Fix encoding of ZIP/UNZIP pseudo-instrcutions in tracer package
Just like for the corresponding base instructions SHFLI/UNSHFLI the MSBs of
all these pseudo-instructions must be 6'b0000_10.
2021-01-21 17:11:47 +01:00
Pirmin Vogel
760baa1eb2 [rtl] Fix encoding for ORC16/REV16 instructions in tracer package
This bug was originally found by @micprog.
2021-01-19 15:05:07 +01:00
Greg Chadwick
75e1c28107 [syn] Fix timing reports in synthesis flow
This fixes a bug where .csv.rpt files weren't being generated properly.
OpenSTA was outputting a simple 'Q' or 'D' for start and end path points
where the full instance name was required (which is then fed to yosys to
translate to a human readable name). The issue was in the `timing_report`
proc in syn/tcl/sta_utils.tcl which needed to request the full name of
the start and end points.

The syn README is updated to note which tool versions have been used to
test the flow.

Fixes #1193
2021-01-19 10:24:53 +00:00
Greg Chadwick
6a61e0ec0c [rtl] Fix PMP NAPOT matching for 0 PMPGranularity 2021-01-19 10:24:32 +00:00