From 56d87213aed91f7a92d49688290ce541b05f3214 Mon Sep 17 00:00:00 2001 From: Vishal Mhatre Date: Wed, 15 Jan 2025 19:05:40 -0800 Subject: [PATCH] [feat] Increase ICCM size to 256 KB This change updates the ICCM size from 128 KB to 256 KB. --- drivers/src/memory_layout.rs | 2 +- hw-model/tests/model_tests.rs | 2 +- rom/dev/src/rom.ld | 2 +- rom/dev/tests/rom_integration_tests/rv32_unit_tests.rs | 4 ++-- sw-emulator/lib/cpu/src/cpu.rs | 2 +- sw-emulator/lib/periph/src/iccm.rs | 2 +- sw-emulator/lib/periph/src/root_bus.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/src/memory_layout.rs b/drivers/src/memory_layout.rs index a2f28f4799..793ac92d49 100644 --- a/drivers/src/memory_layout.rs +++ b/drivers/src/memory_layout.rs @@ -69,7 +69,7 @@ pub const LAST_REGION_END: u32 = NSTACK_ORG + NSTACK_SIZE; pub const ROM_RELAXATION_PADDING: u32 = 4 * 1024; pub const ROM_SIZE: u32 = 96 * 1024; pub const MBOX_SIZE: u32 = 128 * 1024; -pub const ICCM_SIZE: u32 = 128 * 1024; +pub const ICCM_SIZE: u32 = 256 * 1024; pub const DCCM_SIZE: u32 = 256 * 1024; pub const ROM_DATA_SIZE: u32 = 996; pub const MAN1_SIZE: u32 = 17 * 1024; diff --git a/hw-model/tests/model_tests.rs b/hw-model/tests/model_tests.rs index 158e793753..6b64bf3dcc 100644 --- a/hw-model/tests/model_tests.rs +++ b/hw-model/tests/model_tests.rs @@ -237,7 +237,7 @@ fn test_uninitialized_iccm_read() { ); const ICCM_ADDR: u32 = 0x4000_0000; - const ICCM_SIZE: u32 = 128 * 1024; + const ICCM_SIZE: u32 = 256 * 1024; model.soc_ifc().cptra_rsvd_reg().at(0).write(|_| ICCM_ADDR); model.soc_ifc().cptra_rsvd_reg().at(1).write(|_| ICCM_SIZE); diff --git a/rom/dev/src/rom.ld b/rom/dev/src/rom.ld index 957e520008..c89eca05f3 100644 --- a/rom/dev/src/rom.ld +++ b/rom/dev/src/rom.ld @@ -33,7 +33,7 @@ CFI_STATE_ORG = 0x500003E4; */ ROM_RELAXATION_PADDING = 8k; ROM_SIZE = 96K; -ICCM_SIZE = 128K; +ICCM_SIZE = 256K; DCCM_SIZE = 256K; DATA_SIZE = 996; STACK_SIZE = 61K; diff --git a/rom/dev/tests/rom_integration_tests/rv32_unit_tests.rs b/rom/dev/tests/rom_integration_tests/rv32_unit_tests.rs index cb181cc77d..26699af70c 100644 --- a/rom/dev/tests/rom_integration_tests/rv32_unit_tests.rs +++ b/rom/dev/tests/rom_integration_tests/rv32_unit_tests.rs @@ -9,8 +9,8 @@ fn test_asm() { let mut hw = caliptra_hw_model::new( InitParams { rom: &rom, - iccm: &vec![0x55u8; 128 * 1024], - dccm: &vec![0x66u8; 128 * 1024], + iccm: &vec![0x55u8; 256 * 1024], + dccm: &vec![0x66u8; 256 * 1024], ..Default::default() }, BootParams::default(), diff --git a/sw-emulator/lib/cpu/src/cpu.rs b/sw-emulator/lib/cpu/src/cpu.rs index 9e032e7595..b4aae462c2 100644 --- a/sw-emulator/lib/cpu/src/cpu.rs +++ b/sw-emulator/lib/cpu/src/cpu.rs @@ -153,7 +153,7 @@ pub struct CoverageBitmaps<'a> { pub iccm: &'a bit_vec::BitVec, } -const ICCM_SIZE: usize = 128 * 1024; +const ICCM_SIZE: usize = 256 * 1024; const ICCM_ORG: usize = 0x40000000; const ICCM_UPPER: usize = ICCM_ORG + ICCM_SIZE - 1; diff --git a/sw-emulator/lib/periph/src/iccm.rs b/sw-emulator/lib/periph/src/iccm.rs index c6d0d7480b..e6a8f461b9 100644 --- a/sw-emulator/lib/periph/src/iccm.rs +++ b/sw-emulator/lib/periph/src/iccm.rs @@ -27,7 +27,7 @@ use std::{cell::RefCell, rc::Rc}; pub struct Iccm { iccm: Rc, } -const ICCM_SIZE_BYTES: usize = 128 * 1024; +const ICCM_SIZE_BYTES: usize = 256 * 1024; impl Iccm { pub fn lock(&mut self) { diff --git a/sw-emulator/lib/periph/src/root_bus.rs b/sw-emulator/lib/periph/src/root_bus.rs index 1864c0d714..ec8660ad6f 100644 --- a/sw-emulator/lib/periph/src/root_bus.rs +++ b/sw-emulator/lib/periph/src/root_bus.rs @@ -313,7 +313,7 @@ pub struct CaliptraRootBus { impl CaliptraRootBus { pub const ROM_SIZE: usize = 96 * 1024; - pub const ICCM_SIZE: usize = 128 * 1024; + pub const ICCM_SIZE: usize = 256 * 1024; pub const DCCM_SIZE: usize = 256 * 1024; pub fn new(clock: &Clock, mut args: CaliptraRootBusArgs) -> Self {