Skip to content

Commit 9377420

Browse files
committed
Update lowrisc_ibex to lowRISC/ibex@0c233f54
Update code from upstream repository https://github.com/lowRISC/ibex.git to revision 0c233f54361d769f370889223acc456f2ac19d46 * [formal] Disable the Zc* extensions for formal verification (Samuel Riedel) * [rtl] Make Zcmp state registers resettable (Samuel Riedel) * [rtl] Compute `gets_expanded_o` only if the instruction is valid (Samuel Riedel) * [rtl] Add assertion to ensure the push/pop FSM only advances if valid (Samuel Riedel) * [rtl] Only start the push/pop FSM if the instruction is valid (Samuel Riedel) * [rtl] Optimize the Zcmp FSM (Samuel Riedel) * [rtl] Add explanations to the Zcmp state machine (Samuel Riedel) * [rtl] Fix handshake on compressed decoder (Samuel Riedel) * [rtl] Annotate traces with expanded instruction information (Samuel Riedel) * [rvfi] Track expanded instruction in rvfi (Samuel Riedel) * [rtl] Track last expanded instruction (Samuel Riedel) * [doc] Add Zcb and Zcmp extension to documentation (Samuel Riedel) * [rtl] Parametrize Zcb and Zcmp extensions (Samuel Riedel) * [rvfi] Output expanded instructions (except for the last one) (Andreas Kurth) * [rtl] Implement Zcmp extension (Andreas Kurth) * [rtl] Implement the Zcb extension (Elias Christen) Signed-off-by: Samuel Riedel <sriedel@lowrisc.org>
1 parent 8607531 commit 9377420

14 files changed

Lines changed: 1082 additions & 253 deletions

File tree

hw/vendor/lowrisc_ibex.lock.hjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
upstream:
1010
{
1111
url: https://github.com/lowRISC/ibex.git
12-
rev: 246849ed1063828355cae8a22c6f1aa95250c3b6
12+
rev: 0c233f54361d769f370889223acc456f2ac19d46
1313
}
1414
}

hw/vendor/lowrisc_ibex/doc/01_overview/compliance.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ In addition, the following instruction set extensions are available.
4747
- 2.0
4848
- always enabled
4949

50+
* - **Zcb**: Simple Code-Size Saving Instructions
51+
- 1.0.0
52+
- optional
53+
54+
* - **Zcmp**: Push/Pop/Move Code-Size Saving Instructions
55+
- 1.0.0
56+
- optional
57+
5058
* - **Smepmp** - PMP Enhancements for memory access and execution prevention on Machine mode
5159
- 1.0
5260
- always enabled in configurations with PMP see :ref:`PMP Enhancements<pmp-enhancements>`

hw/vendor/lowrisc_ibex/doc/02_user/integration.rst

Lines changed: 73 additions & 66 deletions
Large diffs are not rendered by default.

hw/vendor/lowrisc_ibex/doc/03_reference/pipeline_details.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ Read the description for more information.
9393
| | | jump (which does the required flushing) so it has the same |
9494
| | | stall characteristics (see above). |
9595
+-----------------------+--------------------------------------+-------------------------------------------------------------+
96+
| Zcmp Push/Pop | 2 - N | The cm.push/pop instructions as defined in 'Zcmp' of the |
97+
| | | RISC-V specification. Internally, they expand to multiple |
98+
| | | register load/store operations combined with stack pointer |
99+
| | | adjustments, so their latency corresponds to the total |
100+
| | | number of instructions issued and the memory latency. |
101+
+-----------------------+--------------------------------------+-------------------------------------------------------------+
102+
| Zcmp Move | 2 | The `cm.mvsa01` and `cm.mva01s` instruction as defined in |
103+
| | | 'Zcmp' of the RISC-V specification. Internally, they are |
104+
| | | implemented as two `addi rd, rs1, 0` instructions. |
105+
+-----------------------+--------------------------------------+-------------------------------------------------------------+

hw/vendor/lowrisc_ibex/dv/formal/check/top.sv

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module top import ibex_pkg::*; #(
4040
parameter bit SecureIbex = 1'b0,
4141
parameter bit WritebackStage = 1'b1,
4242
parameter bit RV32E = 1'b0,
43+
parameter rv32zc_e RV32ZC = RV32Zca,
4344
parameter int unsigned PMPNumRegions = 4
4445
) (
4546
// Clock and Reset
@@ -131,6 +132,7 @@ ibex_top #(
131132
.SecureIbex(SecureIbex),
132133
.WritebackStage(WritebackStage),
133134
.RV32E(RV32E),
135+
.RV32ZC(RV32ZC),
134136
.BranchTargetALU(1'b1),
135137
.PMPEnable(1'b1),
136138
.PMPNumRegions(PMPNumRegions),
@@ -441,25 +443,35 @@ assign ex_is_checkable_csr = ~(
441443

442444
logic [31:0] decompressed_instr;
443445
logic decompressed_instr_illegal;
444-
ibex_compressed_decoder decompression_assertion_decoder(
446+
ibex_compressed_decoder #(
447+
.RV32ZC(RV32ZC),
448+
.ResetAll(SecureIbex)
449+
) decompression_assertion_decoder (
445450
.clk_i,
446451
.rst_ni,
447452
.valid_i(1'b1),
453+
.id_in_ready_i(1'b1),
448454
.instr_i(ex_compressed_instr),
449455
.instr_o(decompressed_instr),
450456
.is_compressed_o(),
457+
.gets_expanded_o(),
451458
.illegal_instr_o(decompressed_instr_illegal)
452459
);
453460

454461
logic [31:0] decompressed_instr_2;
455462
logic decompressed_instr_illegal_2;
456-
ibex_compressed_decoder decompression_assertion_decoder_2(
463+
ibex_compressed_decoder #(
464+
.RV32ZC(RV32ZC),
465+
.ResetAll(SecureIbex)
466+
) decompression_assertion_decoder_2(
457467
.clk_i,
458468
.rst_ni,
459469
.valid_i(1'b1),
470+
.id_in_ready_i(1'b1),
460471
.instr_i(wbexc_instr),
461472
.instr_o(decompressed_instr_2),
462473
.is_compressed_o(wbexc_is_compressed),
474+
.gets_expanded_o(),
463475
.illegal_instr_o(decompressed_instr_illegal_2)
464476
);
465477

0 commit comments

Comments
 (0)