From c4837bd0a7853fc0c467a5921dbd76ec74e9719d Mon Sep 17 00:00:00 2001 From: Matthew Naylor Date: Thu, 27 Apr 2023 19:58:26 +0100 Subject: [PATCH] Fix shared local mem mapping issue --- apps/TestSuite/A/amoadd_w.S | 2 +- apps/TestSuite/A/amoand_w.S | 2 +- apps/TestSuite/A/amomax_w.S | 2 +- apps/TestSuite/A/amomaxu_w.S | 2 +- apps/TestSuite/A/amomin_w.S | 2 +- apps/TestSuite/A/amominu_w.S | 2 +- apps/TestSuite/A/amoor_w.S | 2 +- apps/TestSuite/A/amoswap_w.S | 2 +- apps/TestSuite/A/amoxor_w.S | 2 +- inc/MemoryMap.h | 2 +- src/Main.hs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/TestSuite/A/amoadd_w.S b/apps/TestSuite/A/amoadd_w.S index f33e24f..65585d5 100644 --- a/apps/TestSuite/A/amoadd_w.S +++ b/apps/TestSuite/A/amoadd_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amoand_w.S b/apps/TestSuite/A/amoand_w.S index 11059af..2a96770 100644 --- a/apps/TestSuite/A/amoand_w.S +++ b/apps/TestSuite/A/amoand_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amomax_w.S b/apps/TestSuite/A/amomax_w.S index c4f9604..3fc99fd 100644 --- a/apps/TestSuite/A/amomax_w.S +++ b/apps/TestSuite/A/amomax_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amomaxu_w.S b/apps/TestSuite/A/amomaxu_w.S index 472b821..9ce8e06 100644 --- a/apps/TestSuite/A/amomaxu_w.S +++ b/apps/TestSuite/A/amomaxu_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amomin_w.S b/apps/TestSuite/A/amomin_w.S index 6b527ec..f5426ef 100644 --- a/apps/TestSuite/A/amomin_w.S +++ b/apps/TestSuite/A/amomin_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amominu_w.S b/apps/TestSuite/A/amominu_w.S index 0650349..41844f0 100644 --- a/apps/TestSuite/A/amominu_w.S +++ b/apps/TestSuite/A/amominu_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amoor_w.S b/apps/TestSuite/A/amoor_w.S index f4a774f..d4a5d71 100644 --- a/apps/TestSuite/A/amoor_w.S +++ b/apps/TestSuite/A/amoor_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amoswap_w.S b/apps/TestSuite/A/amoswap_w.S index 5c58dbe..3b75aec 100644 --- a/apps/TestSuite/A/amoswap_w.S +++ b/apps/TestSuite/A/amoswap_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/apps/TestSuite/A/amoxor_w.S b/apps/TestSuite/A/amoxor_w.S index 1b74e98..27d2d8e 100644 --- a/apps/TestSuite/A/amoxor_w.S +++ b/apps/TestSuite/A/amoxor_w.S @@ -20,7 +20,7 @@ RVTEST_CODE_BEGIN #define ADDR (\ 1 << (DRAMAddrWidth + DRAMBeatLogBytes) - \ 1 << (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - \ - 1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank + 2)) + 1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank + 2)) # Use only a single thread for this test csrrw t3, 0xf14, zero diff --git a/inc/MemoryMap.h b/inc/MemoryMap.h index fd79c21..d10b526 100644 --- a/inc/MemoryMap.h +++ b/inc/MemoryMap.h @@ -19,7 +19,7 @@ NOTE("These stacks appear at the end of DRAM") NOTE("Sum of sizes of banked SRAMs") #define BANKED_SRAMS_SIZE \ - (1 << (SIMTLogLanes + SIMTLogWordsPerSRAMBank+2)) + (1 << (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank+2)) NOTE("SIMT local memory is toward the end of DRAM, before the SIMT stacks") #define LOCAL_MEM_BASE (DRAM_SIZE - SIMT_STACKS_SIZE - BANKED_SRAMS_SIZE) diff --git a/src/Main.hs b/src/Main.hs index 7bd76ad..5d6dbf2 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -310,7 +310,7 @@ makeSIMTMemSubsystem dramResps = mdo -- SRAM-related addresses simtStacksStart = 2 ^ (DRAMAddrWidth + DRAMBeatLogBytes) - 2 ^ (SIMTLogLanes + SIMTLogWarps + SIMTLogBytesPerStack) - sramSize = 2 ^ (SIMTLogLanes + SIMTLogWordsPerSRAMBank+2) + sramSize = 2 ^ (SIMTLogSRAMBanks + SIMTLogWordsPerSRAMBank+2) sramBase = simtStacksStart - sramSize -- Determine if request maps to banked SRAMs