Skip to content

Commit

Permalink
Fix shared local mem mapping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Naylor committed Apr 27, 2023
1 parent a8c35d7 commit c4837bd
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amoadd_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amoand_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amomax_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amomaxu_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amomin_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amominu_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amoor_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amoswap_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/TestSuite/A/amoxor_w.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion inc/MemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4837bd

Please sign in to comment.