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

Update lowrisc_ibex to lowrisc/cheriot-ibex@a745108a #125

Merged
merged 2 commits into from
Jun 17, 2024
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
4 changes: 3 additions & 1 deletion dv/verilator/sonata_verilator_lint.vlt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ lint_off -rule UNUSED -file "*usbdev.sv"

lint_off -rule GENUNNAMED

lint_off -rule UNOPTFLAT -file "*/rtl/ibex_core.sv" -match "*cheri_csr_addr*"
lint_off -rule UNOPTFLAT -file "*/rtl/ibex_core.sv" -match "*cheri_csr_*"
lint_off -rule UNOPTFLAT -file "*/rtl/cheri_ex.sv" -match "*scr_legalization*"
lint_off -rule UNOPTFLAT -file "*/rtl/ibex_decoder.sv" -match "*cheri_rf_we_dec*"
lint_off -rule UNOPTFLAT -file "*/rtl/prim_fifo_async_simple.sv"
lint_off -rule UNOPTFLAT -file "*/rtl/prim_subreg_ext.sv"
lint_off -rule BLKSEQ -file "*/rtl/ibex_tracer.sv"
Expand Down
2 changes: 1 addition & 1 deletion vendor/lowrisc_ibex.lock.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
upstream:
{
url: https://github.com/lowrisc/cheriot-ibex.git
rev: 3081de9f03af988bf2c5200b9787d81c6a2d8bc7
rev: a745108ad9ad50de3f8420ccf3dfc5909e92cbf0
}
}
6 changes: 3 additions & 3 deletions vendor/lowrisc_ibex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
Any use of third-party trademarks or logos are subject to those third-party's policies.

## Introduction
cheriot-ibex is 32-bit RISC-V microcontroller which implements the CHERIoT ISA extension in addition to RV32IMCB. Same as the original ibex core, the design can be configured either with a 2-stage or a 3-stage pipeline. It has passed preliminary simulation and FPGA validation, and is currently undergoing further verification as well as PPA analysis at Microsoft.
cheriot-ibex is 32-bit RISC-V microcontroller which implements the CHERIoT ISA extension in addition to RV32IMCB. Same as the original ibex core, the design can be configured either with a 2-stage or a 3-stage pipeline. It has passed preliminary simulation, formal verification and FPGA validation, and is currently under further verification at Microsoft.

![image](https://github.com/microsoft/cheriot-ibex/assets/116126768/51b768f5-a528-4d93-bce4-392ac2fe1488)

## CHERIoT ISA support

cheriot-ibex supports all instructions listed in the [CHERIoT ISA specification](https://github.com/microsoft/cheriot-sail/tree/main/archdoc), including

- To query or test capabilities: cgetaddr, cgetbase, cgetlen, cgetperm, cgettag, cgettop, cgettype, ctestsubset, csetequalexact, csub
- To query or test capabilities: cgetaddr, cgetbase, cgethigh, cgetlen, cgetperm, cgettag, cgettop, cgettype, ctestsubset, csetequalexact, csub, csethigh
- To modify or derive capabilities: auicgp, auipcc, candperm, ccleartag, cincaddr, cincaddrimm, cmove, cram, crrl, csetaddr, csetbounds, csetboundsexact, csetboundsimm, cseal, cunseal
- To load/store capabilities from memory: clc, csc
- To control the program flow: cjal, cjalr
Expand Down Expand Up @@ -120,7 +120,7 @@ A PPA study conducted at Microsoft shows that cheriot-ibex is similar to the ori

cheriot-ibex (configured as 3-stage pipeline) has been synthesized successfully using Synopsys DC-topo at 250MHz using TSMC 28nm (28LP) libraries (ss 1.03v) and 550MHz using TSMC 5nm (N5) libraries (ss 0.6v). Timing is mostly limited by TCM read access time (which approaches 1.6ns in the N5 case).

The design area is ~60k gate equivalents (~25% more the original ibex design). Both dynamic and leakage power are shown as similar to the original ibex design.
The design area is ~60k gate equivalents. Both dynamic and leakage power are shown as similar to the original ibex design.


## Build the design for simulation and emulation
Expand Down
1 change: 1 addition & 0 deletions vendor/lowrisc_ibex/dv/cheriot/run/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj_dir/
11 changes: 8 additions & 3 deletions vendor/lowrisc_ibex/dv/cheriot/run/all.f
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-Wno-WIDTHEXPAND
-Wno-WIDTHTRUNC
-Wno-WIDTH
-Wno-USERFATAL
-Wno-UNOPTFLAT
-Wno-IMPLICIT
Expand All @@ -8,6 +7,7 @@
-Wno-UNSIGNED
-Wno-INITIALDLY
-Wno-CASEX
--timing
+incdir+$rtlRoot
+incdir+$primRoot
+incdir+$dvutilsRoot
Expand All @@ -18,6 +18,7 @@
$rtlRoot/cheri_pkg.sv
$rtlRoot/ibex_pkg.sv
$rtlRoot/ibex_tracer_pkg.sv
$verifRoot/tb/cheriot_dv_pkg.sv
$rtlRoot/cheri_decoder.sv
$rtlRoot/cheri_ex.sv
$rtlRoot/cheri_regfile.sv
Expand Down Expand Up @@ -48,5 +49,9 @@
$rtlRoot/ibexc_top.sv
$rtlRoot/ibex_tracer.sv
$rtlRoot/ibexc_top_tracing.sv
$verifRoot/tb/mem_model.sv
$verifRoot/tb/data_mem_model.sv
$verifRoot/tb/dii_if.sv
$verifRoot/tb/instr_mem_model.sv
$verifRoot/tb/mem_monitor.sv
$verifRoot/tb/mem_obi_if.sv
$verifRoot/tb/tb_cheriot_top.sv
3 changes: 3 additions & 0 deletions vendor/lowrisc_ibex/dv/cheriot/run/ibexc.vcs.f
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@
$rtlRoot/ibexc_top.sv
$rtlRoot/ibex_tracer.sv
$rtlRoot/ibexc_top_tracing.sv
$verifRoot/tb/cheriot_dv_pkg.sv
$verifRoot/tb/mem_obi_if.sv
$verifRoot/tb/instr_mem_model.sv
$verifRoot/tb/data_mem_model.sv
$verifRoot/tb/mem_monitor.sv
$verifRoot/tb/dii_if.sv
$verifRoot/tb/intr_gen.sv
$verifRoot/tb/cap_err_gen.sv
$verifRoot/tb/tbre_bg_gen.sv
$verifRoot/tb/tb_cheriot_top.sv
$verifRoot/tb/module_dv_ext.sv
$verifRoot/tb/core_ibex_fcov_if.sv
Expand Down
3 changes: 1 addition & 2 deletions vendor/lowrisc_ibex/dv/cheriot/run/vcscomp2
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ export primRoot=../../../vendor/lowrisc_ip/ip/prim/rtl
export dvutilsRoot=../../../vendor/lowrisc_ip/dv/sv/dv_utils
export verifRoot=..

#vnc run -Ir -wl -r vcs RAM/64000 x86_64 redhat7 -- vcs -full64 -sverilog +systemverilogext+sv -timescale=1ns/1ps -debug_acc+all -f ibexc.vcs.f
vcs -full64 -sverilog +systemverilogext+sv -timescale=1ns/1ps -debug_acc+all -f ibexc.vcs.f
vcs -full64 -sverilog -xlrm uniq_prior_final +systemverilogext+sv -timescale=1ns/1ps -debug_acc+all -f ibexc.vcs.f $*
46 changes: 46 additions & 0 deletions vendor/lowrisc_ibex/dv/cheriot/scripts/build_coremark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

set -e

source ../scripts/common_setup.sh
mkdir -p work
cd work

pwd

export TESTNAME=coremark
export CSRC=../csrc_cheri
export SRC=../coremark
export S_FILES="$CSRC/startup.S"
export OBJ_FILES="startup.o"
export C_COMMON="$CSRC/cstart.c $CSRC/util.c"
export C_FILES="$C_COMMON $SRC/core_main.c $SRC/core_list_join.c $SRC/core_matrix.c $SRC/core_util.c $SRC/core_state.c $SRC/cheri/core_portme.c $SRC/cheri/ee_printf.c $SRC/cheri/cheri_atest.S"
export LD_FILE="../link_coremark.ld"
export ELF_OUTPUT=$TESTNAME.elf
export BIN_OUTPUT=$TESTNAME.bin
export HEX_OUTPUT=$TESTNAME.vhx

# run the compile
BASE_FLAGS="-target riscv32-unknown-unknown -mcpu=cheriot -mabi=cheriot -mxcheri-rvc -Oz -g -nostdlib"
ADDON_CFLAGS="-DNDEBUG -DCOREMARK -I$SRC -I$CSRC -I$SRC/cheri"

#RUN_CFLAGS="-DVALIDATION_RUN=1 -DITERATIONS=1 -DCLOCKS_PER_SEC=10000000"
RUN_CFLAGS="-DPERFORMACE_RUN=1 -DITERATIONS=1 -DCLOCKS_PER_SEC=10000000"
CLANG_FLAGS="$BASE_FLAGS $ADDON_CFLAGS $RUN_CFLAGS"

echo "compile and linking.."
echo $CLANG_FLAGS
$CLANG $BASE_FLAGS -c $S_FILES
$CLANG $CLANG_FLAGS -DFLAGS_STR="\"$CLANG_FLAGS\"" -T$LD_FILE -o $ELF_OUTPUT $C_FILES $OBJ_FILES

$GCC_OBJCOPY -O binary -S $ELF_OUTPUT $BIN_OUTPUT

$BIN2HEX $BIN_OUTPUT > $HEX_OUTPUT

echo "Generating disassembled text.."
$LLVM_HOME/llvm-objdump -xdCS --mcpu=cheriot $ELF_OUTPUT > $TESTNAME.dis

echo "Copying binaries to run area.."
cp $HEX_OUTPUT ../../run/bin
cp $ELF_OUTPUT ../../run/bin

Loading