From d4273cc9a6f3c00566e97ebcd71509ed14477b37 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 18 Jul 2013 08:31:16 -0400 Subject: mem: Set the cache line size on a system level This patch removes the notion of a peer block size and instead sets the cache line size on the system level. Previously the size was set per cache, and communicated through the interconnect. There were plenty checks to ensure that everyone had the same size specified, and these checks are now removed. Another benefit that is not yet harnessed is that the cache line size is now known at construction time, rather than after the port binding. Hence, the block size can be locally stored and does not have to be queried every time it is used. A follow-on patch updates the configuration scripts accordingly. --- src/cpu/simple/atomic.cc | 8 ++------ src/cpu/simple/timing.cc | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/cpu/simple') diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 1dd9675f9..ffd1c4d43 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -287,14 +287,12 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, traceData->setAddr(addr); } - //The block size of our peer. - unsigned blockSize = dcachePort.peerBlockSize(); //The size of the data we're trying to read. int fullSize = size; //The address of the second part of this access if it needs to be split //across a cache line boundary. - Addr secondAddr = roundDown(addr + size - 1, blockSize); + Addr secondAddr = roundDown(addr + size - 1, cacheLineSize()); if (secondAddr > addr) size = secondAddr - addr; @@ -375,14 +373,12 @@ AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size, traceData->setAddr(addr); } - //The block size of our peer. - unsigned blockSize = dcachePort.peerBlockSize(); //The size of the data we're trying to read. int fullSize = size; //The address of the second part of this access if it needs to be split //across a cache line boundary. - Addr secondAddr = roundDown(addr + size - 1, blockSize); + Addr secondAddr = roundDown(addr + size - 1, cacheLineSize()); if(secondAddr > addr) size = secondAddr - addr; diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index 1f453ca63..87a5245b2 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -404,7 +404,7 @@ TimingSimpleCPU::readMem(Addr addr, uint8_t *data, const int asid = 0; const ThreadID tid = 0; const Addr pc = thread->instAddr(); - unsigned block_size = dcachePort.peerBlockSize(); + unsigned block_size = cacheLineSize(); BaseTLB::Mode mode = BaseTLB::Read; if (traceData) { @@ -473,7 +473,7 @@ TimingSimpleCPU::writeMem(uint8_t *data, unsigned size, const int asid = 0; const ThreadID tid = 0; const Addr pc = thread->instAddr(); - unsigned block_size = dcachePort.peerBlockSize(); + unsigned block_size = cacheLineSize(); BaseTLB::Mode mode = BaseTLB::Write; if (traceData) { -- cgit v1.2.3