diff --git a/doc/instruction_decode_execute.rst b/doc/instruction_decode_execute.rst index 92cf24bc..b15cb7df 100644 --- a/doc/instruction_decode_execute.rst +++ b/doc/instruction_decode_execute.rst @@ -67,10 +67,13 @@ Other blocks use the ALU for the following tasks: Bit Manipulation Extension Support for the `RISC-V Bit Manipulation Extension (draft version 0.92 from November 8, 2019) `_ is optional. [#B_draft]_ It can be enabled via the enumerated parameter ``RV32B`` defined in :file:`rtl/ibex_pkg.sv`. + By default, this parameter is set to "ibex_pkg::RV32BNone" to disable the bit manipulation extension. There are two versions of the bit manipulation extension available: The balanced implementation 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 "ibex_pkg::RV32BBalanced". The full implementation comprises all 32 bit instructions defined in the extension. + This version can be selected by setting the ``RV32B`` parameter to "ibex_pkg::RV32BFull". The following table lists the implemented instructions in each version. Multi-cycle instructions are completed in 2 cycles. All remaining instructions complete in a single cycle. @@ -84,7 +87,7 @@ Bit Manipulation Extension +---------------------------------+---------------+--------------------------+ | Zbp (Permutation) | Full | None | +---------------------------------+---------------+--------------------------+ - | Zbp (Bit extract/deposit) | Full | All | + | Zbe (Bit extract/deposit) | Full | All | +---------------------------------+---------------+--------------------------+ | Zbf (Bit-field place) | Balanced/Full | All | +---------------------------------+---------------+--------------------------+ diff --git a/doc/integration.rst b/doc/integration.rst index 2cfc55ca..a968f697 100644 --- a/doc/integration.rst +++ b/doc/integration.rst @@ -93,11 +93,10 @@ Parameters +------------------------------+-------------------+------------+-----------------------------------------------------------------+ | ``RV32M`` | bit | 1 | M(ultiply) extension enable | +------------------------------+-------------------+------------+-----------------------------------------------------------------+ -| ``RV32B`` | ibex_pkg::rv32b_e | RV32BNone | *EXPERIMENTAL* - B(itmanipulation) extension select: | -| | | | "RV32BNone": No B-extension | -| | | | "RV32BBalanced": Sub-extensions Zbb, Zbs, Zbf and | -| | | | Zbt | -| | | | "RV32Full": All sub-extensions | +| ``RV32B`` | ibex_pkg::rv32b_e | RV32BNone | B(itmanipulation) extension select: | +| | | | "ibex_pkg::RV32BNone": No B-extension | +| | | | "ibex_pkg::RV32BBalanced": Sub-extensions Zbb, Zbs, Zbf and Zbt | +| | | | "ibex_pkg::RV32Full": All sub-extensions | +------------------------------+-------------------+------------+-----------------------------------------------------------------+ | ``BranchTargetALU`` | bit | 0 | *EXPERIMENTAL* - Enables branch target ALU removing a stall | | | | | cycle from taken branches | diff --git a/dv/riscv_compliance/ibex_riscv_compliance.core b/dv/riscv_compliance/ibex_riscv_compliance.core index 8ce6e479..d583c250 100644 --- a/dv/riscv_compliance/ibex_riscv_compliance.core +++ b/dv/riscv_compliance/ibex_riscv_compliance.core @@ -40,7 +40,7 @@ parameters: datatype: str default: ibex_pkg::RV32BNone paramtype: vlogdefine - description: "Bitmanip implementation parameter enum. See ibex_pkg.sv (EXPERIMENTAL)" + description: "Bitmanip implementation parameter enum. See the ibex_pkg::rv32b_e enum in ibex_pkg.sv for permitted values." MultiplierImplementation: datatype: str diff --git a/dv/riscv_compliance/rtl/ibex_riscv_compliance.sv b/dv/riscv_compliance/rtl/ibex_riscv_compliance.sv index 8cb860cc..df2e4261 100644 --- a/dv/riscv_compliance/rtl/ibex_riscv_compliance.sv +++ b/dv/riscv_compliance/rtl/ibex_riscv_compliance.sv @@ -20,7 +20,7 @@ module ibex_riscv_compliance ( parameter int unsigned PMPNumRegions = 4; parameter bit RV32E = 1'b0; parameter bit RV32M = 1'b1; - parameter bit RV32B = 1'b0; + parameter ibex_pkg::rv32b_e RV32B = ibex_pkg::RV32BNone; parameter MultiplierImplementation = "fast"; parameter bit BranchTargetALU = 1'b0; parameter bit WritebackStage = 1'b0; diff --git a/examples/simple_system/ibex_simple_system.core b/examples/simple_system/ibex_simple_system.core index 4e8a93ed..45008fa5 100644 --- a/examples/simple_system/ibex_simple_system.core +++ b/examples/simple_system/ibex_simple_system.core @@ -39,7 +39,7 @@ parameters: datatype: str default: ibex_pkg::RV32BNone paramtype: vlogdefine - description: "Bitmanip implementation parameter enum. See ibex_pkg.sv (EXPERIMENTAL)" + description: "Bitmanip implementation parameter enum. See the ibex_pkg::rv32b_e enum in ibex_pkg.sv for permitted values." SRAMInitFile: datatype: str diff --git a/ibex_core.core b/ibex_core.core index 836b2744..068972e0 100644 --- a/ibex_core.core +++ b/ibex_core.core @@ -80,7 +80,7 @@ parameters: datatype: str default: ibex_pkg::RV32BNone paramtype: vlogdefine - description: "Bitmanip implementation parameter enum. See ibex_pkg.sv (EXPERIMENTAL)" + description: "Bitmanip implementation parameter enum. See the ibex_pkg::rv32b_e enum in ibex_pkg.sv for permitted values." MultiplierImplementation: datatype: str diff --git a/ibex_core_tracing.core b/ibex_core_tracing.core index f568cb17..cbc432b1 100644 --- a/ibex_core_tracing.core +++ b/ibex_core_tracing.core @@ -38,7 +38,7 @@ parameters: datatype: str default: ibex_pkg::RV32BNone paramtype: vlogdefine - description: "Bitmanip implementation parameter enum. See ibex_pkg.sv (EXPERIMENTAL)" + description: "Bitmanip implementation parameter enum. See the ibex_pkg::rv32b_e enum in ibex_pkg.sv for permitted values." MultiplierImplementation: datatype: str diff --git a/rtl/ibex_core.sv b/rtl/ibex_core.sv index 370d1a01..de9e49f9 100644 --- a/rtl/ibex_core.sv +++ b/rtl/ibex_core.sv @@ -9,10 +9,6 @@ `include "prim_assert.sv" -`ifndef RV32B - `define RV32B ibex_pkg::RV32BNone -`endif - /** * Top level module of the ibex RISC-V core */ @@ -24,7 +20,7 @@ module ibex_core #( parameter int unsigned MHPMCounterWidth = 40, parameter bit RV32E = 1'b0, parameter bit RV32M = 1'b1, - parameter ibex_pkg::rv32b_e RV32B = `RV32B, + parameter ibex_pkg::rv32b_e RV32B = ibex_pkg::RV32BNone, parameter bit BranchTargetALU = 1'b0, parameter bit WritebackStage = 1'b0, parameter MultiplierImplementation = "fast", diff --git a/rtl/ibex_core_tracing.sv b/rtl/ibex_core_tracing.sv index 4fbcde08..1d22c5e6 100644 --- a/rtl/ibex_core_tracing.sv +++ b/rtl/ibex_core_tracing.sv @@ -2,10 +2,6 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -`ifndef RV32B - `define RV32B ibex_pkg::RV32BNone -`endif - /** * Top level module of the ibex RISC-V core with tracing enabled */ @@ -18,7 +14,7 @@ module ibex_core_tracing #( parameter int unsigned MHPMCounterWidth = 40, parameter bit RV32E = 1'b0, parameter bit RV32M = 1'b1, - parameter ibex_pkg::rv32b_e RV32B = `RV32B, + parameter ibex_pkg::rv32b_e RV32B = ibex_pkg::RV32BNone, parameter bit BranchTargetALU = 1'b0, parameter bit WritebackStage = 1'b0, parameter MultiplierImplementation = "fast", diff --git a/rtl/ibex_pkg.sv b/rtl/ibex_pkg.sv index bb086ecb..00a534b0 100644 --- a/rtl/ibex_pkg.sv +++ b/rtl/ibex_pkg.sv @@ -13,9 +13,9 @@ package ibex_pkg; ///////////////////////// typedef enum integer { - RV32BNone, - RV32BBalanced, - RV32BFull + RV32BNone = 0, + RV32BBalanced = 1, + RV32BFull = 2 } rv32b_e; ///////////// diff --git a/syn/tcl/lr_synth_flow_var_setup.tcl b/syn/tcl/lr_synth_flow_var_setup.tcl index cda1cac6..b52ddcd4 100644 --- a/syn/tcl/lr_synth_flow_var_setup.tcl +++ b/syn/tcl/lr_synth_flow_var_setup.tcl @@ -15,7 +15,7 @@ set_flow_bool_var flatten 1 "flatten" set_flow_bool_var timing_run 0 "timing run" set_flow_bool_var ibex_branch_target_alu 0 "Enable branch target ALU in Ibex" set_flow_bool_var ibex_writeback_stage 0 "Enable writeback stage in Ibex" -set_flow_var ibex_bitmanip 0 "Bitmanip extenion setting for Ibex (0,1,2 - enums not supported)" +set_flow_var ibex_bitmanip 0 "Bitmanip extenion setting for Ibex (see ibex_pkg::rv32b_e for permitted values. Enum names are not supported in Yosys.)" set_flow_var ibex_multiplier "fast" "Multiplier implementation for Ibex (slow/fast/single-cycle)" source $lr_synth_config_file