From d857faf073895dcfde97141bd6346fe5d4317f8e Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Sun, 2 Nov 2008 21:57:07 -0500 Subject: Add in Context IDs to the simulator. From now on, cpuId is almost never used, the primary identifier for a hardware context should be contextId(). The concept of threads within a CPU remains, in the form of threadId() because sometimes you need to know which context within a cpu to manipulate. --- src/mem/request.hh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/mem/request.hh') diff --git a/src/mem/request.hh b/src/mem/request.hh index 613655ea4..da0d9c7e0 100644 --- a/src/mem/request.hh +++ b/src/mem/request.hh @@ -115,10 +115,10 @@ class Request : public FastAlloc * store conditional or the compare value for a CAS. */ uint64_t extraData; - /** The cpu number (for statistics, typically). */ - int cpuNum; - /** The requesting thread id (for statistics, typically). */ - int threadNum; + /** The context ID (for statistics, typically). */ + int _contextId; + /** The thread ID (id within this CPU) */ + int _threadId; /** program counter of initiating access; for tracing/debugging */ Addr pc; @@ -129,8 +129,8 @@ class Request : public FastAlloc bool validAsidVaddr; /** Whether or not the sc result is valid. */ bool validExData; - /** Whether or not the cpu number & thread ID are valid. */ - bool validCpuAndThreadNums; + /** Whether or not the context ID is valid. */ + bool validContextAndThreadIds; /** Whether or not the pc is valid. */ bool validPC; @@ -138,7 +138,7 @@ class Request : public FastAlloc /** Minimal constructor. No fields are initialized. */ Request() : validPaddr(false), validAsidVaddr(false), - validExData(false), validCpuAndThreadNums(false), validPC(false) + validExData(false), validContextAndThreadIds(false), validPC(false) {} /** @@ -146,13 +146,13 @@ class Request : public FastAlloc * just physical address, size, flags, and timestamp (to curTick). * These fields are adequate to perform a request. */ Request(Addr _paddr, int _size, int _flags) - : validCpuAndThreadNums(false) + : validContextAndThreadIds(false) { setPhys(_paddr, _size, _flags); } Request(int _asid, Addr _vaddr, int _size, int _flags, Addr _pc, - int _cpuNum, int _threadNum) + int _context_id, int _thread_id) { - setThreadContext(_cpuNum, _threadNum); + setThreadContext(_context_id, _thread_id); setVirt(_asid, _vaddr, _size, _flags, _pc); } @@ -160,11 +160,11 @@ class Request : public FastAlloc /** * Set up CPU and thread numbers. */ - void setThreadContext(int _cpuNum, int _threadNum) + void setThreadContext(int _context_id, int _thread_id) { - cpuNum = _cpuNum; - threadNum = _threadNum; - validCpuAndThreadNums = true; + _contextId = _context_id; + _threadId = _thread_id; + validContextAndThreadIds = true; } /** @@ -261,10 +261,10 @@ class Request : public FastAlloc void setExtraData(uint64_t _extraData) { extraData = _extraData; validExData = true; } - /** Accessor function for cpu number.*/ - int getCpuNum() { assert(validCpuAndThreadNums); return cpuNum; } - /** Accessor function for thread number.*/ - int getThreadNum() { assert(validCpuAndThreadNums); return threadNum; } + /** Accessor function for context ID.*/ + int contextId() { assert(validContextAndThreadIds); return _contextId; } + /** Accessor function for thread ID. */ + int threadId() { assert(validContextAndThreadIds); return _threadId; } /** Accessor function for pc.*/ Addr getPC() { assert(validPC); return pc; } -- cgit v1.2.3