cpu,mem,dev: Use Addr for cacheLineSize
Change-Id: I2f056571dbf35081d58afda09726c600141d5a05 Signed-off-by: Hoa Nguyen <hn@hnpl.org>
This commit is contained in:
@@ -257,8 +257,8 @@ BaseCPU::mwait(ThreadID tid, PacketPtr pkt)
|
||||
AddressMonitor &monitor = addressMonitor[tid];
|
||||
|
||||
if (!monitor.gotWakeup) {
|
||||
int block_size = cacheLineSize();
|
||||
uint64_t mask = ~((uint64_t)(block_size - 1));
|
||||
Addr block_size = cacheLineSize();
|
||||
Addr mask = ~(block_size - 1);
|
||||
|
||||
assert(pkt->req->hasPaddr());
|
||||
monitor.pAddr = pkt->getAddr() & mask;
|
||||
@@ -282,8 +282,8 @@ BaseCPU::mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseMMU *mmu)
|
||||
RequestPtr req = std::make_shared<Request>();
|
||||
|
||||
Addr addr = monitor.vAddr;
|
||||
int block_size = cacheLineSize();
|
||||
uint64_t mask = ~((uint64_t)(block_size - 1));
|
||||
Addr block_size = cacheLineSize();
|
||||
Addr mask = ~(block_size - 1);
|
||||
int size = block_size;
|
||||
|
||||
//The address of the next line if it crosses a cache line boundary.
|
||||
|
||||
@@ -143,7 +143,7 @@ class BaseCPU : public ClockedObject
|
||||
bool _switchedOut;
|
||||
|
||||
/** Cache the cache line size that we get from the system */
|
||||
const uint64_t _cacheLineSize;
|
||||
const Addr _cacheLineSize;
|
||||
|
||||
/** Global CPU statistics that are merged into the Root object. */
|
||||
struct GlobalStats : public statistics::Group
|
||||
@@ -394,7 +394,7 @@ class BaseCPU : public ClockedObject
|
||||
/**
|
||||
* Get the cache line size of the system.
|
||||
*/
|
||||
inline uint64_t cacheLineSize() const { return _cacheLineSize; }
|
||||
inline Addr cacheLineSize() const { return _cacheLineSize; }
|
||||
|
||||
/**
|
||||
* Serialize this object to the given output stream.
|
||||
|
||||
@@ -213,13 +213,13 @@ class Fetch1 : public Named
|
||||
/** Line snap size in bytes. All fetches clip to make their ends not
|
||||
* extend beyond this limit. Setting this to the machine L1 cache line
|
||||
* length will result in fetches never crossing line boundaries. */
|
||||
unsigned int lineSnap;
|
||||
Addr lineSnap;
|
||||
|
||||
/** Maximum fetch width in bytes. Setting this (and lineSnap) to the
|
||||
* machine L1 cache line length will result in fetches of whole cache
|
||||
* lines. Setting this to sizeof(MachInst) will result it fetches of
|
||||
* single instructions (except near the end of lineSnap lines) */
|
||||
unsigned int maxLineWidth;
|
||||
Addr maxLineWidth;
|
||||
|
||||
/** Maximum number of fetches allowed in flight (in queues or memory) */
|
||||
unsigned int fetchLimit;
|
||||
|
||||
@@ -548,7 +548,7 @@ class LSQ : public Named
|
||||
const unsigned int inMemorySystemLimit;
|
||||
|
||||
/** Memory system access width (and snap) in bytes */
|
||||
const unsigned int lineWidth;
|
||||
const Addr lineWidth;
|
||||
|
||||
public:
|
||||
/** The LSQ consists of three queues: requests, transfers and the
|
||||
|
||||
@@ -470,7 +470,7 @@ class Fetch
|
||||
ThreadID retryTid;
|
||||
|
||||
/** Cache block size. */
|
||||
unsigned int cacheBlkSize;
|
||||
Addr cacheBlkSize;
|
||||
|
||||
/** The size of the fetch buffer in bytes. The fetch buffer
|
||||
* itself may be smaller than a cache line.
|
||||
|
||||
@@ -142,7 +142,7 @@ class MemTest : public ClockedObject
|
||||
// store the expected value for the addresses we have touched
|
||||
std::unordered_map<Addr, uint8_t> referenceData;
|
||||
|
||||
const unsigned blockSize;
|
||||
const Addr blockSize;
|
||||
|
||||
const Addr blockAddrMask;
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ TraceCPU::ElasticDataGen::executeMemReq(GraphNode* node_ptr)
|
||||
// stat counting this is useful to keep a check on how frequently this
|
||||
// happens. If required the code could be revised to mimick splitting such
|
||||
// a request into two.
|
||||
unsigned blk_size = owner.cacheLineSize;
|
||||
Addr blk_size = owner.cacheLineSize;
|
||||
Addr blk_offset = (node_ptr->physAddr & (Addr)(blk_size - 1));
|
||||
if (!(blk_offset + node_ptr->size <= blk_size)) {
|
||||
node_ptr->size = blk_size - blk_offset;
|
||||
|
||||
@@ -286,7 +286,7 @@ class TraceCPU : public ClockedObject
|
||||
};
|
||||
|
||||
/** Cache the cache line size that we get from the system */
|
||||
const unsigned int cacheLineSize;
|
||||
const Addr cacheLineSize;
|
||||
|
||||
/** Port to connect to L1 instruction cache. */
|
||||
IcachePort icachePort;
|
||||
|
||||
Reference in New Issue
Block a user