Commit graph

1819 commits

Author SHA1 Message Date
Pirmin Vogel
8d3d87ae53 Controller: Fix exception cause ID of fast interrupts
This commit fixes the generation of the exception cause ID for fast
interrupts. Without this commit, the core tries to handle fast
interrupts using the handlers of other interrupts like external,
software, and timer interrupts.

This commit resolves lowRISC/ibex#290 reported by @udinator.
2019-09-09 13:05:48 +01:00
Tom Roberts
b87ed7c82e [I-side] - Fix assertion error
- Assertion was added in the wrong file
2019-09-09 09:06:31 +01:00
pbing
e2110e2a46 Instruction set extensions M and C may be swapped 2019-09-07 17:54:26 +01:00
Udi
7ddee54f9f Fix syntax error 2019-09-07 10:24:27 +01:00
Rahul Behl
60de915d6b Adding Compressed Instruction support in tracer
Added compressed instruction decoder in the tracer to correctly
trace compressed instructions with their mnemonics. Fixes #197
2019-09-06 15:43:53 +01:00
Pirmin Vogel
1162b995fa CSRs: reset dcsr.XDEBUGVER to XDEBUGVER_STD instead of 0
This field is read only and should be set to the right value straight
away.

This fixes lowRISC/ibex#285.
2019-09-06 15:32:15 +01:00
Tom Roberts
16177fe8db [RTL] Fix I-side timing loop
- See issue #265 (partially fixes)
- Remove path from instr_rvalid_i to instr_req_o
- Prefetch buffer unit can now issue up to two outstanding requests
- Structure moved from state machine to request queue
- Change fetch fifo to use an unaligned flag rather than updating
  the address each time
2019-09-06 09:24:57 +01:00
Greg Chadwick
bec84ca2b1 Add core_sleep_o to ibex interface
Signals the core is totally idle (WFI with no outstanding memory
transactions).  Fixes #258
2019-09-06 08:44:48 +01:00
Tom Roberts
36db104160 [RTL] - Remove timing loop in LSU
- Relates to issue #265
- External signals data_rvalid_i and data_err_i were factored
  into the external data_req_o signal
- To improve timing, these signals are decoupled
- The second part of an unaligned transaction will now be issued
  even if the first received an error response
- The state machine will service the abandoned requests
- pmp_err_q fixed to only update at specific times
2019-09-05 08:35:54 +01:00
udinator
e9c2b2ecb3
Added dret and ebreak tests (#281) 2019-09-04 16:14:41 -07:00
Greg Chadwick
d14312c3cc Replace cluster_id/core_id with hart_id (#29)
If you're migrating from the previous interface you can use

logic [31:0] hart_id;
assign hart_id = {21'b0, cluster_id_i[5:0], 1'b0, core_id_i[3:0]};

...

ibex_core #(
  ...
) u_core (
  ...

  // replace core_id_i and cluster_id_i
  .hart_id_i(hart_id),

  ...
);
2019-09-03 14:18:39 +01:00
Rahul Behl
9b51b1143a CSR: Access checks on Debug CSRs
- The RISC-V Debug Spec v.0.13.2 (p.41) mandates that the core
    debug CSRs dcsr, dpc, dscratch0 and dscratch1 must not be
    accessible if not in debug mode. Fixes #275
2019-09-03 12:14:49 +01:00
Tom Roberts
892ad8a621 [RTL] - Add PMP module
- Instantiate generic PMP module
- Wire up I-side and D-side PMP faults
- The output of the PMP check is used to gate external bus requests from the
  I-side and LSU
- Each of those units progresses with their request as-if it was granted
  externally and registers the PMP error
- The error is then sent to the controller at the appropriate time to trigger
  an exception
2019-08-29 17:43:37 +01:00
Pirmin Vogel
6ecf83124a Register file: update comments
This commit updates the comments inside the latch-based register file.
Some of them were outdated or just wrong.
2019-08-29 15:24:18 +01:00
Pirmin Vogel
d79722ba47 Controller: change behavior of DRET instruction
Executing a DRET instruction outside of debug mode now causes an
illegal instruction exception as mandated by the Debug Spec v0.13.2
p.41.

This resolves lowRISC/ibex#270.
2019-08-29 11:59:04 +01:00
udinator
68b170638a
Update interrupt mode, add debug mode WFI test (#268) 2019-08-28 10:00:36 -07:00
Philipp Wagner
2b93475864 Lint: Update Verilator waiver file
PR #236 broke the Verilator lint since lines changed. Fix that.
2019-08-27 21:32:28 +01:00
taoliug
6a88d1ed03
Update google_riscv-dv to 102791d (#266)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 102791dbb7eb992d3bc22336d2e4e5f0d688e761

* Merge pull request #104 from google/flow (taoliug)
* Remove debug print (Tao Liu)
* Merge pull request #103 from google/flow (taoliug)
* Improve randomization performance (Tao Liu)
* Merge pull request #102 from udinator/debug (taoliug)
* Prevent x0 from being used as load adress register (Udi)
2019-08-27 11:23:31 -07:00
Philipp Wagner
7eee24c094 Mention CREDITS.md in license header 2019-08-27 18:10:02 +01:00
Philipp Wagner
14b8f88957 Replace author credits in files with CREDITS.md
We currently have a documentation block at the beginning of each file,
containing author credits and module-level documentation. The
module-level documentation is retained for historic reasons and
duplicated with the newer comments below it.

For the authors, maintaining author credits in the file is error-prone,
as this information gets outdated very soon. A more reliable way to see
who modified a file is to use the history information in git.
Additionally, we now have the CREDITS.md file, which lists all
contributors, even the ones which don't appear in the git history (e.g.
because the code was copied and commited by someone else).
2019-08-27 18:10:02 +01:00
Philipp Wagner
c98ab65df2 Add link to CREDITS.md from README.md 2019-08-27 18:10:02 +01:00
Philipp Wagner
1cf11dcf8c Add CREDITS.md file
This file lists all code contributors to Ibex as of today, and
acknowledges the great work done by the PULP team at ETH Zürich.

The names in this file have been compiled from the git history, and all
authors which are named in the individual source files.
2019-08-27 18:10:02 +01:00
udinator
2421472395
Integrate risc-v stream generator handshake into Ibex sim flow (#264) 2019-08-26 15:18:30 -07:00
udinator
ce8be4f2fd
Update google_riscv-dv to google/riscv-dv@faddfa4 (#263)
Update code from upstream repository https://github.com/google/riscv-
dv to revision faddfa49f456f3f8ef8c4231865994b7b13aa96d

* Obsolete test clean up (Tao Liu)
* Remove the old flow (Tao Liu)
* minor fix, update README for A extension support (Tao Liu)
* Add basic atomic instruction test (Tao Liu)
* Add RV32A/RV64A instructions (google/riscv-dv#95) (Tao Liu)
* Fix the missing GPR save operations for exception handling (Tao Liu)
* Generate handshake sequence to communicate with testbench (Udi)
* Fix compare error (Tao Liu)
* Fix compare error (Tao Liu)
* Initial signature enum for handshake protocol (Udi)
2019-08-26 11:41:37 -07:00
Felix Yan
5d1f8e16bc Correct a typo in doc/verification.rst 2019-08-23 09:02:06 +01:00
Philipp Wagner
399f0b7e77 Update documentation how to run riscv-compliance
Upstream has now included ibex support, we don't need to use a custom
fork any more. Update the documentation for that.

Fixes #214
2019-08-22 23:27:13 +01:00
Philipp Wagner
cfb6fc4963 CI: Run the compliance tests for all ISA variants
rv32imc doesn't include all i and m tests, we need to call the test
suite on these extensions separately.
2019-08-22 23:27:13 +01:00
taoliug
e2b9c17c0b
Update google_riscv-dv to e81acc9 (#257)
Update code from upstream repository https://github.com/google/riscv-
dv to revision e81acc9ab4f692ff205a207c2dc3d9f2b0284d39

* Merge pull request #89 from google/dev (taoliug)
* Fix mtvec alignement (Tao Liu)
2019-08-21 18:22:58 -07:00
taoliug
03df591266
Make mtvec writable, remove previous workaround (#256) 2019-08-21 18:16:51 -07:00
taoliug
2601e8d898
Test cleanup (#255) 2019-08-21 17:19:16 -07:00
taoliug
a752277247
Update google_riscv-dv to 73274f2 (#254)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 73274f227000f1316cb201a8503aad437e427948

* Merge pull request #88 from google/dev (taoliug)
* Fix spike log processing issue (Tao Liu)
* Merge pull request #87 from google/dev (udinator)
* Add vectored interrupt support (Tao Liu)
* Merge pull request #85 from udinator/debug (udinator)
* Add debug sub-programs, and extra options to generator (Udi)
* Merge pull request #84 from imphil/fix-apache-urls (taoliug)
* Fix license URLs in comments (Philipp Wagner)
2019-08-21 17:14:15 -07:00
udinator
9311b25fdb
Consolidate some debug generation options, and make the signature_addr handshake optional (#253) 2019-08-21 11:00:17 -07:00
udinator
3bc83365ef
Add more debug tests (#251) 2019-08-20 11:03:15 -07:00
Pirmin Vogel
221e46d0ea src_files.yml: Add ibex_core_tracing.sv
This file is needed when using the tracer.
2019-08-20 15:29:53 +01:00
Pirmin Vogel
501cc2bb62 ram_1p.sv: Fix rvalid_o generation
This signal must also be set in case of write transactions as it is
a request valid and not a read valid.
2019-08-20 14:59:28 +01:00
Ivan Ribeiro
2a47344dd1 Remove unused signal data_reg_offset 2019-08-20 14:45:47 +01:00
Philipp Wagner
e97931c8c7 Add Azure Pipelines build badge to README.md
This badge shows if our CI builds/tests complete successfully.
2019-08-19 17:26:09 +02:00
Philipp Wagner
78c16f90e9 CI: Use Azure Pipelines to run lint and some DV
This sets up Azure Pipelines to run the following two tasks:

- Run Verilator lint on the SystemVerilog code.
- Run the RISC-V compliance test suite for RV32IMC
2019-08-19 17:26:09 +02:00
udinator
6ccd2b698d Update google_riscv-dv to google/riscv-dv@7cce16c (#246)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 7cce16c0a212c8713a82516fbf8f2570d3dc4505

* Update spike log processing script to include full trace information
  (Tao Liu)
* Add new tests (Tao Liu)
* Add basic debug test functionality (Udi)
* fix spelling error, fix output directory arg (Udi)
* Add shorten option (dang hai)
* Support SAIL-RISCV ISSi, update README (Tao Liu)
* Fix CSR map copy issue (Tao Liu)
2019-08-16 09:43:27 -07:00
Pirmin Vogel
e1a7dcf37f ID stage: rework CSR-related pipeline flushes
This commit clarifies why CSR-related pipeline flushes are needed
(e.g. when enabling interrupts), only introduces them when doing the
critical modifications (write/set bits in `mstatus` and `mie` CSRs
for enabling interrupts, reads and clears are uncritical for these
CSRs), and makes sure the controller is actually able to start
handling interrupts while doing a CSR-related pipeline flush.

This resolves lowrisc/ibex#6.
2019-08-16 13:28:52 +01:00
Pirmin Vogel
396d6fa68a Adapt Verilator lint waiver
This commit updates some line numbers in the Verilator lint waiver file.
2019-08-16 12:58:34 +01:00
udinator
e4260dd075
Add basic debug test and modify sim flow (#243) 2019-08-15 11:18:07 -07:00
taoliug
0e91a30496 [DV] Enable aligned load/store test (#242)
* Add unaligned load/store test

* Enable unaligned load/store test, remove obsolete files
2019-08-14 17:41:13 -07:00
taoliug
7eecbd1b05
Update google_riscv-dv to 63fa0ca (#241)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 63fa0ca922ecf10f3cd733d15a0a79a7937a591e

* Merge pull request #74 from google/dev (taoliug)
* Add gcc compile options, fix unaligned load/store (Tao Liu)
* Merge pull request #72 from google/dev (taoliug)
* Properly disable branch instruction in push/pop stack operations
  (Tao Liu)
2019-08-14 17:16:44 -07:00
udinator
e087e32490 Update google_riscv-dv to google/riscv-dv@07599f6 (#240)
Update code from upstream repository https://github.com/google/riscv-
dv to revision 07599f689a385794cb73932922008bdbe8131d82

* Fix introduced TypeError in run.py (Udi)
2019-08-13 15:03:12 -07:00
taoliug
9309621f04 Fix the verbose logging issue, fix coverage/waveform options (#235) 2019-08-13 10:23:07 -07:00
udinator
97105f42b1 Update google_riscv-dv to google/riscv-dv@e905e9f (#234)
Update code from upstream repository https://github.com/google/riscv-
dv to revision e905e9f134e0b7cf7da491218d1a30c75ce8649a

* add pass_val and fail_val into csr test flow for EOT correctness
  checking (Udi)
* Support unaligned load/store (Tao Liu)
* refactored test generation logic (Udi)
* refactored test generation logic (Udi)
* Give error when mutually exclusive between -co, and -so argument
  (dang hai)
* documentation, and small fixes (Udi)
* no_iss bug (Udi)
* no_iss/no_post_compare optional, CSR read_only is now only specified
  at field level granularity (Udi)
* made no_iss optional (Udi)
* rm print (Udi)
* setup_logging call (Udi)
* undo overriding --verbose in run.py, comment cleanup in csr gen
  script (Udi)
* missed verbose arguments (Udi)
* verbose arg (Udi)
* updated csr description, integrated csr test into flow (Udi)
* updated csr description, integrated csr test into flow (Udi)
* Enhance verbose information by logging instead of using print (dang
  hai)
* Report date time for output directory (dang hai)
* Add main entry point for run.py (dang hai)
* Separate command line parser by function (dang hai)
* Skip generating S/U mode program for machine mode test (Tao Liu)
* minor update to README.md (Tao Liu)
* Update the README.md to match command reference from --help (Tao
  Liu)
* Ignore untrack file from python script (dang hai)
* Make questa work for new YAML based regression flow (dang hai)
* Fix typo in README (Tao Liu)
* Fix README google/riscv-dv#54 (Tao Liu)
* changed formatting of generator option table (Udi)
2019-08-12 16:22:07 -07:00
udinator
9a231c9ba6
update ibex testbench (#232) 2019-08-12 13:14:07 -07:00
udinator
27bd4e73d9 update ibex simulation flow (#233) 2019-08-09 15:49:46 -07:00
Tom Roberts
44b033cf8b [rtl] Add support for instruction fetch errors
- Add required signals to top-level
- Propagate error through fetch stages
- Add new exception type
- Update documentation for new exception type
- Resolves issue #109
2019-08-09 10:44:37 +01:00