Skip to content

Commit 8f383b4

Browse files
GregACmarnovandermaas
authored andcommitted
Enable CHERIoT Ibex ICache
1 parent d0e9987 commit 8f383b4

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

rtl/system/sonata_system.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,8 @@ module sonata_system #(
11741174
.HeapBase ( tl_main_pkg::ADDR_SPACE_SRAM ),
11751175
.TSMapBase ( tl_main_pkg::ADDR_SPACE_REV_TAG ),
11761176
.TSMapSize ( RevTagDepth ),
1177-
.RV32B ( ibex_pkg::RV32BFull )
1177+
.RV32B ( ibex_pkg::RV32BFull ),
1178+
.ICache ( 1'b1 )
11781179
) u_top_tracing (
11791180
.clk_i (clk_sys_i),
11801181
.rst_ni (rst_core_n),

sw/cheri/boot/boot.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
.p2align 2
88
.type start,@function
99
start:
10+
// Enable the ICache
11+
csrsi 0x7c0, 1
1012
// Upon reset mtdc contains the read-write root and pcc contains the execution root.
1113
cspecialr cs0, mtdc
1214
auipcc cs1, 0
@@ -32,6 +34,9 @@ start:
3234
cmove ca0, cs0
3335
ccall rom_loader_entry
3436

37+
// Flush ICache now we've loaded new code
38+
fence.i
39+
3540
// Jump to the newly loaded binary.
3641
csetaddr ct0, cs1, a0
3742
cjr ct0

sw/cheri/common/boot.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
.p2align 2
88
.type start,@function
99
start:
10+
// Enable the ICache
11+
csrsi 0x7c0, 1
1012
// ca0 (first argument) contains the read-write root
1113
cspecialr ca0, mtdc
1214

sw/cheri/sim_boot_stub/boot.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
.p2align 2
66
.type start,@function
77
start:
8+
// Enable the ICache
9+
csrsi 0x7c0, 1
810
auipcc ct1, 0
911
li t0, 0x40000000
1012
csetaddr ct1, ct1, t0

sw/cheri/tests/hyperram_tests.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ void write_prog(Capability<volatile uint32_t> hyperram_area, uint32_t addr) {
217217
hyperram_area[addr + 2] = 0x00552023;
218218
hyperram_area[addr + 3] = 0x00000517;
219219
hyperram_area[addr + 4] = 0x8082;
220+
221+
asm volatile ("fence.i" : : : "memory");
220222
}
221223

222224
/*

0 commit comments

Comments
 (0)