Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep bit-manipulation extension control option as localparam #55

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions doc/02_user/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Instantiation Template
.MHPMCounterWidth ( 40 ),
.RV32E ( 0 ),
.RV32M ( cve2_pkg::RV32MFast ),
.RV32B ( cve2_pkg::RV32BNone ),
.RegFile ( cve2_pkg::RegFileFF ),
.ICache ( 0 ),
.ICacheECC ( 0 ),
Expand Down Expand Up @@ -101,12 +100,6 @@ Parameters
| | | | "cve2_pkg::RV32MFast": 3-4 cycle multiplier, iterative divider |
| | | | "cve2_pkg::RV32MSingleCycle": 1-2 cycle multiplier, iterative divider |
+------------------------------+---------------------+------------+-----------------------------------------------------------------------+
| ``RV32B`` | cve2_pkg::rv32b_e | RV32BNone | B(itmanipulation) extension select: |
| | | | "cve2_pkg::RV32BNone": No B-extension |
| | | | "cve2_pkg::RV32BBalanced": Sub-extensions Zba, Zbb, Zbs, Zbf and Zbt |
| | | | "cve2_pkg::RV32BOTEarlGrey": All sub-extensions except Zbe |
| | | | "cve2_pkg::RV32BFull": All sub-extensions |
+------------------------------+---------------------+------------+-----------------------------------------------------------------------+
| ``RegFile`` | cve2_pkg::regfile_e | RegFileFF | Register file implementation select: |
| | | | "cve2_pkg::RegFileFF": Generic flip-flop-based register file |
| | | | "cve2_pkg::RegFileFPGA": Register file for FPGA targets |
Expand Down Expand Up @@ -143,7 +136,7 @@ Parameters

Any parameter marked *EXPERIMENTAL* when enabled is not verified to the same standard as the rest of the Ibex core.

Note that Ibex uses SystemVerilog enum parameters e.g. for ``RV32M`` and ``RV32B``.
Note that Ibex uses SystemVerilog enum parameters e.g. for ``RV32M``.
This is well supported by most tools but some care is needed when overriding these parameters at the top level:

* Synopsys VCS does not support overriding enum and string parameters at the top level via command line.
Expand Down
9 changes: 5 additions & 4 deletions doc/03_reference/instruction_decode_execute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ Other blocks use the ALU for the following tasks:

Bit-Manipulation Extension
Support for the `RISC-V Bit-Manipulation Extension version 1.0.0 <https://github.com/riscv/riscv-bitmanip/releases/download/1.0.0/bitmanip-1.0.0-38-g865e7a7.pdf>`_ and `draft version 0.93 from January 10, 2021 <https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.93.pdf>`_ is optional. [#B_draft]_
It can be enabled via the enumerated parameter ``RV32B`` defined in :file:`rtl/cve2_pkg.sv`.
It can be enabled via the enumerated local parameter ``RV32B`` defined in :file:`rtl/cve2_pkg.sv`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should say that we as OpenHW Group do not maintain the RVB extensions, therefor users are responsible to fork the core and enable the parameter at their own risk in their fork, so that it is clear that these ISA extensions won't be at high TRL, nor maintained by OpenHW Group

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

By default, this parameter is set to "cve2_pkg::RV32BNone" to disable the bit-manipulation extension.
RVB is currently not maintained and activation should be done at the users responsibility.

There are three versions of the bit-manipulation extension available:
The balanced version comprises a set of sub-extensions aiming for good benefits at a reasonable area overhead.
It can be selected by setting the ``RV32B`` parameter to "cve2_pkg::RV32BBalanced".
It can be selected by setting the ``RV32B`` local parameter to "cve2_pkg::RV32BBalanced".
The OTEarlGrey version comprises all sub-extensions except for the Zbe.
This version can be selected by setting the ``RV32B`` parameter to "cve2_pkg::RV32BOTEarlGrey".
The full version comprises all sub-extensions and can be selected by setting the ``RV32B`` parameter to "cve2_pkg::RV32BFull".
This version can be selected by setting the ``RV32B`` local parameter to "cve2_pkg::RV32BOTEarlGrey".
The full version comprises all sub-extensions and can be selected by setting the ``RV32B`` local parameter to "cve2_pkg::RV32BFull".
The following table gives an overview of which sub-extensions are implemented in each version and of which instructions are implemented as multi-cycle instructions.
Multi-cycle instructions are completed in 2 cycles.
All remaining instructions complete in a single cycle.
Expand Down
4 changes: 3 additions & 1 deletion rtl/cve2_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module cve2_top import cve2_pkg::*; #(
parameter int unsigned MHPMCounterWidth = 40,
parameter bit RV32E = 1'b0,
parameter rv32m_e RV32M = RV32MFast,
parameter rv32b_e RV32B = RV32BNone,
parameter regfile_e RegFile = RegFileFF,
parameter bit WritebackStage = 1'b0,
parameter bit ICache = 1'b0,
Expand Down Expand Up @@ -148,6 +147,9 @@ module cve2_top import cve2_pkg::*; #(
localparam bit DbgTriggerEn = 1'b1;
localparam int unsigned DbgHwBreakNum = 1;

// Bit manipulation extension
localparam rv32b_e RV32B = RV32BNone;

// Clock signals
logic clk;
logic core_busy_d, core_busy_q;
Expand Down