diff --git a/CHANGELOG.md b/CHANGELOG.md index 75b11fcbf..db4bdd91a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Add Channel Estimation application and kernels - Update Bender to version 0.27.3 - Update default Questasim version to 2022.3 +- Decrease stack size to 128 words ### Fixed - Fix type issue in `snitch_addr_demux` diff --git a/config/config.mk b/config/config.mk index 0b424a1be..0691071c8 100644 --- a/config/config.mk +++ b/config/config.mk @@ -28,17 +28,20 @@ include $(MEMPOOL_DIR)/config/$(config).mk # Boot address (in dec) boot_addr ?= 2684354560 # A0000000 -# L2 memory configuration (in hex) +# L2 memory configuration (in dec) l2_base ?= 2147483648 # 80000000 l2_size ?= 4194304 # 400000 l2_banks ?= 4 +# L1 size per bank (in dec) +l1_bank_size ?= 1024 + # Size of sequential memory per core (in bytes) # (must be a power of two) -seq_mem_size ?= 1024 +seq_mem_size ?= 512 # Size of stack in sequential memory per core (in bytes) -stack_size ?= 1024 +stack_size ?= 512 ######################### ## AXI configuration ## diff --git a/config/systolic.mk b/config/systolic.mk index 9eb404740..27f67be66 100644 --- a/config/systolic.mk +++ b/config/systolic.mk @@ -26,7 +26,7 @@ axi_masters_per_group ?= 1 # Size of sequential memory per core (in bytes) # (must be a power of two) -seq_mem_size ?= 2048 +seq_mem_size ?= 1024 ############################# ## Xqueues configuration ## diff --git a/hardware/Makefile b/hardware/Makefile index 45ccd1274..2faf4d255 100644 --- a/hardware/Makefile +++ b/hardware/Makefile @@ -89,6 +89,7 @@ vlog_args += -work $(library) # Defines vlog_defs += -DNUM_CORES=$(num_cores) -DNUM_CORES_PER_TILE=$(num_cores_per_tile) -DNUM_GROUPS=$(num_groups) -DBANKING_FACTOR=$(banking_factor) vlog_defs += -DL2_BASE=$(l2_base) -DL2_SIZE=$(l2_size) -DL2_BANKS=$(l2_banks) +vlog_defs += -DL1_BANK_SIZE=$(l1_bank_size) vlog_defs += -DBOOT_ADDR=$(boot_addr) -DXPULPIMG=$(xpulpimg) vlog_defs += -DSNITCH_TRACE=$(snitch_trace) vlog_defs += -DAXI_DATA_WIDTH=$(axi_data_width) diff --git a/hardware/src/mempool_pkg.sv b/hardware/src/mempool_pkg.sv index 5ba3234f4..de8449b99 100644 --- a/hardware/src/mempool_pkg.sv +++ b/hardware/src/mempool_pkg.sv @@ -37,7 +37,7 @@ package mempool_pkg; localparam integer unsigned ByteOffset = $clog2(BeWidth); localparam integer unsigned BankingFactor = `ifdef BANKING_FACTOR `BANKING_FACTOR `else 0 `endif; localparam bit LrScEnable = 1'b1; - localparam integer unsigned TCDMSizePerBank = 1024; // [B] + localparam integer unsigned TCDMSizePerBank = `ifdef L1_BANK_SIZE `L1_BANK_SIZE `else 0 `endif; localparam integer unsigned NumBanks = NumCores * BankingFactor; localparam integer unsigned NumBanksPerTile = NumBanks / NumTiles; localparam integer unsigned NumBanksPerGroup = NumBanks / NumGroups; diff --git a/software/runtime/arch.ld.c b/software/runtime/arch.ld.c index 093e7c36b..8d003388b 100644 --- a/software/runtime/arch.ld.c +++ b/software/runtime/arch.ld.c @@ -5,7 +5,7 @@ /* This file will get processed by the precompiler to expand all macros. */ MEMORY { - l1 (R) : ORIGIN = 0x00000000, LENGTH = (NUM_CORES * 0x1000) /* NUM_CORES * 4 * 1KiB per bank */ + l1 (R) : ORIGIN = 0x00000000, LENGTH = (NUM_CORES * BANKING_FACTOR * L1_BANK_SIZE) l2 : ORIGIN = L2_BASE , LENGTH = L2_SIZE rom (R): ORIGIN = BOOT_ADDR , LENGTH = 0x00001000 } diff --git a/software/runtime/runtime.mk b/software/runtime/runtime.mk index ba70da78c..739f64b45 100644 --- a/software/runtime/runtime.mk +++ b/software/runtime/runtime.mk @@ -72,6 +72,7 @@ DEFINES += -DNUM_CORES_PER_GROUP=$(shell awk 'BEGIN{print $(num_cores)/$(num_gro DEFINES += -DNUM_TILES_PER_GROUP=$(shell awk 'BEGIN{print ($(num_cores)/$(num_groups))/$(num_cores_per_tile)}') DEFINES += -DLOG2_NUM_CORES_PER_TILE=$(shell awk 'BEGIN{print log($(num_cores_per_tile))/log(2)}') DEFINES += -DBOOT_ADDR=$(boot_addr) +DEFINES += -DL1_BANK_SIZE=$(l1_bank_size) DEFINES += -DL2_BASE=$(l2_base) DEFINES += -DL2_SIZE=$(l2_size) DEFINES += -DSEQ_MEM_SIZE=$(seq_mem_size)