Skip to content

Commit

Permalink
Enable CHERIoT Ibex ICache
Browse files Browse the repository at this point in the history
  • Loading branch information
GregAC authored and marnovandermaas committed Aug 30, 2024
1 parent d0e9987 commit 8f383b4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rtl/system/sonata_system.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,8 @@ module sonata_system #(
.HeapBase ( tl_main_pkg::ADDR_SPACE_SRAM ),
.TSMapBase ( tl_main_pkg::ADDR_SPACE_REV_TAG ),
.TSMapSize ( RevTagDepth ),
.RV32B ( ibex_pkg::RV32BFull )
.RV32B ( ibex_pkg::RV32BFull ),
.ICache ( 1'b1 )
) u_top_tracing (
.clk_i (clk_sys_i),
.rst_ni (rst_core_n),
Expand Down
5 changes: 5 additions & 0 deletions sw/cheri/boot/boot.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
.p2align 2
.type start,@function
start:
// Enable the ICache
csrsi 0x7c0, 1
// Upon reset mtdc contains the read-write root and pcc contains the execution root.
cspecialr cs0, mtdc
auipcc cs1, 0
Expand All @@ -32,6 +34,9 @@ start:
cmove ca0, cs0
ccall rom_loader_entry

// Flush ICache now we've loaded new code
fence.i

// Jump to the newly loaded binary.
csetaddr ct0, cs1, a0
cjr ct0
Expand Down
2 changes: 2 additions & 0 deletions sw/cheri/common/boot.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
.p2align 2
.type start,@function
start:
// Enable the ICache
csrsi 0x7c0, 1
// ca0 (first argument) contains the read-write root
cspecialr ca0, mtdc

Expand Down
2 changes: 2 additions & 0 deletions sw/cheri/sim_boot_stub/boot.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.p2align 2
.type start,@function
start:
// Enable the ICache
csrsi 0x7c0, 1
auipcc ct1, 0
li t0, 0x40000000
csetaddr ct1, ct1, t0
Expand Down
2 changes: 2 additions & 0 deletions sw/cheri/tests/hyperram_tests.hh
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ void write_prog(Capability<volatile uint32_t> hyperram_area, uint32_t addr) {
hyperram_area[addr + 2] = 0x00552023;
hyperram_area[addr + 3] = 0x00000517;
hyperram_area[addr + 4] = 0x8082;

asm volatile ("fence.i" : : : "memory");
}

/*
Expand Down

0 comments on commit 8f383b4

Please sign in to comment.