Commit graph

1819 commits

Author SHA1 Message Date
Pirmin Vogel
d64eaad817 Rework WB FSM in ID stage, remove combinational loop 2019-07-09 09:46:48 +01:00
Pirmin Vogel
7924431144 Rework register file write data mux 2019-07-09 09:46:48 +01:00
Pirmin Vogel
9e46bc50d5 Move jump_set generation from WB FSM into decoder 2019-07-09 09:46:48 +01:00
Pirmin Vogel
24ab4ae65c Remove decoder MUX signals for jump and branch
These signals do not need to be generated by the WB FSM inside the ID
stage and be fed back into the decoder. They simply depend on whether
the instruction is new (we execute for the first cycle) or not.
2019-07-09 09:46:48 +01:00
Pirmin Vogel
7e6452ac64 Multdiv: rename state signals 2019-07-09 09:46:48 +01:00
Pirmin Vogel
1082b85ff0 Rework interaction between EX block and ID stage
The EX block actually signals when its output is valid, and not when it
is ready to accept new input. The LSU valid signal is not needed inside
the EX block and can thus be fed directly to the ID stage.
2019-07-09 09:46:48 +01:00
Pirmin Vogel
d477fbc46b Correct wrong spelling in signal name 2019-07-09 09:46:48 +01:00
Pirmin Vogel
a6c2846346 Move stall and IF-ID control from ID stage into controller 2019-07-09 09:46:48 +01:00
Pirmin Vogel
3eb147dbc2 Prevent illegal instructions from propagating out of decoder
This commit makes sure that if any instruction is detected as being
illegal inside the decoder, the decoder does not set the control
signals to let the illegal instruction affect the register file,
LSU, EX, WB, CSRs. Previously, this was only the case for some but
but not all instructions.

Note that this is not sufficient to prevent instructions detected
as illegal elsewhere from affecting the processor state. For example,
when using RV32E, an instruction can be detected to use unavailable
registers outside the decoder in the ID stage. But it is cleaner to
handle all illegal instructions detected in the decoder similarly.
2019-07-09 09:46:48 +01:00
Pirmin Vogel
d973618ce8 Move logic to ignore decoder output out of decoder into ID stage
The decoder shall decode the instruction only. The handling of stalls
is not related to instruction decoding.
2019-07-09 09:46:48 +01:00
taoliug
6d09fb1060
Add interrupt agent (#116) 2019-07-01 18:25:37 -07:00
Pirmin Vogel
c86f71e724 Switch to new signal name in tracer instantiation
This got forgotten when renaming the signal inside ID stage in
commit b22a6a10de.
2019-07-01 17:56:59 +01:00
taoliug
2d66834f14
Integrate riscv-dv upstream changes (#107)
* Remove all local patches

* Update google_riscv-dv to 00739df

Update code from upstream repository https://github.com/google/riscv-
dv to revision 00739df0ec744986934097bebcde3ebf5a4fdf81

* Merge pull request #30 from google/dev (taoliug)
* Fix LSF options (Tao Liu)
* Refactoring to make extension easier (Tao Liu)
* Merge pull request #29 from google/dev (taoliug)
* Add a sample program (Tao Liu)
* Merge pull request #28 from google/dev (taoliug)
* Move riscv_core_setting to a separate folder (Tao Liu)
* Merge pull request #27 from google/dev (taoliug)
* Add ebreak/wfi test, more regression control (Tao Liu)
* Merge pull request #26 from google/dev (taoliug)
* Add support for GPR based comparison (Tao Liu)

* Add ibex extensions for riscv_dv
2019-07-01 08:59:31 -07:00
Tobias Wölfel
08f535ebb2 Fix updated signal name 2019-07-01 14:34:02 +01:00
Tobias Wölfel
b8be998978 Fix RVFI rd write enable 2019-07-01 14:09:34 +01:00
Pirmin Vogel
ca7bbddd4e Doc: remove draft when mentioning RISC-V Priv Spec v.1.11
This version of the spec has been ratified in the meantime.
2019-06-28 18:55:26 +01:00
Pirmin Vogel
2c0aabb6bb Doc: use `csr_num`.FIELD_NAME syntax when discussing CSR fields 2019-06-28 18:55:26 +01:00
Pirmin Vogel
9749120f05 Add mscratch CSR 2019-06-28 18:55:26 +01:00
Pirmin Vogel
2967113edd Mask LSB of mepc CSR to 0 for writes initiated by software 2019-06-28 18:55:26 +01:00
Pirmin Vogel
07214f626d Switch to RISC-V spec compliant trap handling
For exceptions, the Ibex always jumps to the trap vector base address
specified in `mtvec`. The exception cause is specified in `mcause` with
possibly additional information in `mtval`.

Interrupts are handled in vectored mode as before.
2019-06-28 18:55:26 +01:00
Pirmin Vogel
e9bdbaddd6 Make mtvec CSR compliant to spec
The LSBs indicate the vector mode. They are set to vectored for Ibex.
2019-06-28 18:55:26 +01:00
Pirmin Vogel
8ed9ff5bde Reduce width of mcause CSR 2019-06-28 18:55:26 +01:00
Pirmin Vogel
b22a6a10de Add mtval CSR
`mtval` can provide additional information to trap handlers.
In case of load/store errors, it holds the failing address.
For illegal instruction exceptions, it holds the illegal instruction.
2019-06-28 18:55:26 +01:00
Pirmin Vogel
5171ee79f0 Rework AGU mux for misaligned loads/stores
This operation only depends on the LSU detecting a misaligned address.
Previously, the mux control was scattered across ID stage, controller
and decoder. With this commit, all the relevant code for this operation
is moved into the ID stage and also streamlined.
2019-06-28 18:55:26 +01:00
Pirmin Vogel
71a1ccc08d Order CSR assignments according to their address 2019-06-28 18:55:26 +01:00
Philipp Wagner
d00db65227 Avoid WIDTH lint warnings in Verilator
Verilator displays the following lint warnings:

%Warning-WIDTH: ../src/lowrisc_ibex_ibex_0.1/rtl/ibex_cs_registers.sv💯 Operator SHIFTL expects 32 bits on the LHS, but LHS's VARREF 'RV32E' generates 1 bits.
                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.
%Warning-WIDTH: ../src/lowrisc_ibex_ibex_0.1/rtl/ibex_cs_registers.sv:103: Operator SHIFTL expects 32 bits on the LHS, but LHS's VARREF 'RV32M' generates 1 bits.
%Warning-WIDTH: ../src/lowrisc_ibex_ibex_0.1/rtl/ibex_cs_registers.sv:108: Operator SHIFTL expects 32 bits on the LHS, but LHS's VARREF 'MXL' generates 2 bits.
%Warning-WIDTH: ../src/lowrisc_ibex_ibex_0.1/rtl/ibex_register_file_ff.sv:63: Operator EQ expects 32 bits on the LHS, but LHS's VARREF 'waddr_a_i' generates 5 bits.

It's not quite clear (to me) from reading the SV spec if this is a bug
in Verilator lint, or if this is actually a code bug.

Alternative proposal for #92
2019-06-27 17:54:11 +01:00
Pirmin Vogel
4f928b3ad0 Doc: Fix typos 2019-06-26 14:09:23 +01:00
Pirmin Vogel
2ed71a499a Make dummy clock gating module compatible with latch-based reg file
The latch-based register file needs a clock gating cell that is
transparent for the clock enable signal only during the low clock
phase.
2019-06-26 14:09:23 +01:00
Pirmin Vogel
89b0d3a200 Clarify application scenarios of register file versions 2019-06-26 14:09:23 +01:00
Pirmin Vogel
d8cf729c21 Rename ibex_register_file.sv to ibex_register_file_latch.sv 2019-06-26 14:09:23 +01:00
Philipp Wagner
d811c04cce Disable performance counters by default
Performance counters are an optional feature. Disable them by default to
avoid users having them enabled unknowingly and paying the (rather
large) area price for it.
2019-06-25 17:46:07 +01:00
Pirmin Vogel
37d9322785 Change format of assertions and add display output 2019-06-24 21:37:53 +02:00
Pirmin Vogel
b3c6c7ddbf Correct LSU assertion
Errors are signaled with `rvalid` and not with `gnt`.
2019-06-24 21:37:53 +02:00
Pirmin Vogel
6306436465 Add assertions for instruction and data address alignment 2019-06-24 21:37:53 +02:00
Pirmin Vogel
b7919a7bd3 Make sure instr address output is word aligned
The core handles unaligned instruction fetches by doing two separate
word-aligned instruction fetches. Without this commit, the core can
still output addresses which are not word aligned and relies on the
memory to ignore the LSBs of the address. This is not safe.
2019-06-24 21:37:53 +02:00
Pirmin Vogel
182e10048b Make sure data address output is word aligned
The core handles unaligned accesses by doing two separate word-aligned
accesses. Without this commit, the core can still output addresses
which are not word aligned and relies on the memory to ignore the LSBs
of the address. This is not safe.
2019-06-24 21:37:53 +02:00
Pirmin Vogel
0ecf71e8e1 Correct performance counter increment
Prior to this commit, the next counter value was not based on the
current value.
2019-06-24 21:34:56 +02:00
Pirmin Vogel
157eb5bc11 Fix performance counters
Without this commit, the performance counters mhpmcounter3(h)-
mhpmcounter31(h) are optimized away during synthesis due to
`X`-values in the address decoder masks. This commit replaces
these masks with offsets and instead masks the input address
before comparison.

To enable the synthesizer optimizing away unused counters,
the masks for these counters are set to zero.
2019-06-24 21:34:56 +02:00
Pirmin Vogel
92803bb8e5 Make sure CSR set/clear/write op only change the CSR during one cycle
Without this change, the core can continue to write CSRs during multiple
subsequent clock cycles when being stalled. This can corrupt CSR (e.g.
performance counters).
2019-06-24 17:02:40 +02:00
Pirmin Vogel
dfc475ea4a README.md: Add reference to our own Verilog coding style guide 2019-06-21 14:42:41 +01:00
Pirmin Vogel
ec3b246f16 Doc: Add debug_req_i to blockdiagram 2019-06-21 14:42:41 +01:00
Tobias Woelfel
826da1522f Fix vim setting suggestion 2019-06-19 14:39:41 +02:00
Pirmin Vogel
d363a3d3b6 Fix linting errors 2019-06-18 13:43:16 +01:00
Tobias Wölfel
8bada6a0b9 Fix RVFI signal name 2019-06-18 00:08:24 +01:00
taoliug
cc8aed4ed2
Fix tcl path (#73) 2019-06-07 15:01:19 -07:00
taoliug
52bc23cc39
Add coverage dump options (#71) 2019-06-07 13:58:06 -07:00
Pirmin Vogel
05d00737b2 README.md: Update, include additional references
This commit helps to make the README.md the main entry point into the
Ibex world. It does so by updating it and including additional
references to a style guide, a guide on how to write commit messages,
references to our Zulip chat and the original Zero-riscy paper.
2019-06-07 13:49:12 +01:00
Pirmin Vogel
d2fd88dc67 Doc: Add new top-level block diagram 2019-06-07 13:49:12 +01:00
Pirmin Vogel
d7810941e3 Doc: Adapt RVFI section, add connection in intro 2019-06-07 13:49:12 +01:00
Pirmin Vogel
b32078138c Doc: Adjust upper left corner: background color, logo etc. 2019-06-07 13:49:12 +01:00