Skip to content

Commit 93a76b3

Browse files
Tom Robertstomeroberts
Tom Roberts
authored andcommitted
[config] Add an Opentitan configuration
This adds the configuration instantiated in Opentitan and adds missing prim support to allow the TB to run that configuration. Resolves lowRISC#1362 Signed-off-by: Tom Roberts <[email protected]>
1 parent e0b4770 commit 93a76b3

File tree

8 files changed

+60
-2
lines changed

8 files changed

+60
-2
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- small
9898
- experimental-maxperf-pmp
9999
- experimental-maxperf-pmp-bmfull
100-
- experimental-maxperf-pmp-bmfull-icache
100+
- opentitan
101101
- experimental-branch-predictor
102102

103103
# Run lint on simple system

dv/riscv_compliance/ibex_riscv_compliance.core

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ parameters:
9696
paramtype: vlogparam
9797
description: "Number of PMP regions"
9898

99+
SecureIbex:
100+
datatype: int
101+
paramtype: vlogparam
102+
default: 0
103+
description: "Enables security hardening features (EXPERIMENTAL) [0/1]"
104+
99105
targets:
100106
sim:
101107
default_tool: verilator
@@ -115,6 +121,7 @@ targets:
115121
- PMPEnable
116122
- PMPGranularity
117123
- PMPNumRegions
124+
- SecureIbex
118125
toplevel: ibex_riscv_compliance
119126
tools:
120127
verilator:

dv/riscv_compliance/rtl/ibex_riscv_compliance.sv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module ibex_riscv_compliance (
2727
parameter bit ICache = 1'b0;
2828
parameter bit ICacheECC = 1'b0;
2929
parameter bit BranchPredictor = 1'b0;
30+
parameter bit SecureIbex = 1'b0;
3031

3132
logic clk_sys, rst_sys_n;
3233

@@ -125,6 +126,7 @@ module ibex_riscv_compliance (
125126
.ICache (ICache ),
126127
.ICacheECC (ICacheECC ),
127128
.BranchPredictor (BranchPredictor ),
129+
.SecureIbex (SecureIbex ),
128130
.DmHaltAddr (32'h00000000 ),
129131
.DmExceptionAddr (32'h00000000 )
130132
) u_top (

dv/uvm/core_ibex/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ PMP_REGIONS := 16
6565
# PMP Granularity
6666
PMP_GRANULARITY := 0
6767

68-
IBEX_CONFIG := experimental-maxperf-pmp-bmfull-icache
68+
IBEX_CONFIG := opentitan
6969

7070
# TODO(udinator) - might need options for SAIL/Whisper/Spike
7171
ifeq (${ISS},ovpsim)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright lowRISC contributors.
2+
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
// Abstract primitives wrapper.
6+
//
7+
// This file is a stop-gap until the DV file list is generated by FuseSoC.
8+
// Its contents are taken from the file which would be generated by FuseSoC.
9+
// https://github.com/lowRISC/ibex/issues/893
10+
11+
module prim_buf (
12+
input in_i,
13+
output logic out_o
14+
);
15+
16+
if (1) begin : gen_generic
17+
prim_generic_buf u_impl_generic (
18+
.*
19+
);
20+
end
21+
22+
endmodule

dv/uvm/core_ibex/ibex_dv.f

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
${PRJ_DIR}/dv/uvm/core_ibex/common/prim/prim_ram_1p.sv
3434
${PRJ_DIR}/vendor/lowrisc_ip/ip/prim_generic/rtl/prim_generic_clock_gating.sv
3535
${PRJ_DIR}/dv/uvm/core_ibex/common/prim/prim_clock_gating.sv
36+
${PRJ_DIR}/vendor/lowrisc_ip/ip/prim_generic/rtl/prim_generic_buf.sv
37+
${PRJ_DIR}/dv/uvm/core_ibex/common/prim/prim_buf.sv
3638

3739
// ibex CORE RTL files
3840
+incdir+${PRJ_DIR}/rtl

dv/uvm/core_ibex/tb/core_ibex_tb_top.sv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ module core_ibex_tb_top;
5757
parameter bit ICache = 1'b0;
5858
parameter bit ICacheECC = 1'b0;
5959
parameter bit BranchPredictor = 1'b0;
60+
parameter bit SecureIbex = 1'b0;
6061

6162
ibex_top_tracing #(
6263
.DmHaltAddr (32'h`BOOT_ADDR + 'h0 ),
@@ -72,6 +73,7 @@ module core_ibex_tb_top;
7273
.WritebackStage (WritebackStage ),
7374
.ICache (ICache ),
7475
.ICacheECC (ICacheECC ),
76+
.SecureIbex (SecureIbex ),
7577
.BranchPredictor (BranchPredictor )
7678
) dut (
7779
.clk_i (clk ),

ibex_configs.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ small:
2020
PMPEnable : 0
2121
PMPGranularity : 0
2222
PMPNumRegions : 4
23+
SecureIbex : 0
24+
25+
# Configuration to match that used in the OpenTitan project
26+
opentitan:
27+
RV32E : 0
28+
RV32M : "ibex_pkg::RV32MSingleCycle"
29+
RV32B : "ibex_pkg::RV32BNone"
30+
RegFile : "ibex_pkg::RegFileFF"
31+
BranchTargetALU : 1
32+
WritebackStage : 1
33+
ICache : 1
34+
ICacheECC : 1
35+
BranchPredictor : 0
36+
PMPEnable : 1
37+
PMPGranularity : 0
38+
PMPNumRegions : 16
39+
SecureIbex : 1
2340

2441
# ===============================
2542
# * EXPERIMENTAL CONFIGURATIONS *
@@ -41,6 +58,7 @@ experimental-maxperf:
4158
PMPEnable : 0
4259
PMPGranularity : 0
4360
PMPNumRegions : 4
61+
SecureIbex : 0
4462

4563
# experimental-maxperf config above plus PMP enabled with 16 regions.
4664
experimental-maxperf-pmp:
@@ -56,6 +74,7 @@ experimental-maxperf-pmp:
5674
PMPEnable : 1
5775
PMPGranularity : 0
5876
PMPNumRegions : 16
77+
SecureIbex : 0
5978

6079
# experimental-maxperf-pmp config above with balanced bitmanip extension
6180
experimental-maxperf-pmp-bmbalanced:
@@ -71,6 +90,7 @@ experimental-maxperf-pmp-bmbalanced:
7190
PMPEnable : 1
7291
PMPGranularity : 0
7392
PMPNumRegions : 16
93+
SecureIbex : 0
7494

7595
# experimental-maxperf-pmp config above with full bitmanip extension
7696
experimental-maxperf-pmp-bmfull:
@@ -86,6 +106,7 @@ experimental-maxperf-pmp-bmfull:
86106
PMPEnable : 1
87107
PMPGranularity : 0
88108
PMPNumRegions : 16
109+
SecureIbex : 0
89110

90111
# experimental-maxperf-pmp-bmfull config above with icache enabled
91112
experimental-maxperf-pmp-bmfull-icache:
@@ -101,6 +122,7 @@ experimental-maxperf-pmp-bmfull-icache:
101122
PMPEnable : 1
102123
PMPGranularity : 0
103124
PMPNumRegions : 16
125+
SecureIbex : 0
104126

105127
# experimental-maxperf with branch predictor switched on. This exists to allow
106128
# easy use of Ibex with the branch predictor in particular for CI runs. The
@@ -119,4 +141,5 @@ experimental-branch-predictor:
119141
PMPEnable : 0
120142
PMPGranularity : 0
121143
PMPNumRegions : 4
144+
SecureIbex : 0
122145

0 commit comments

Comments
 (0)