diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2012-02-12 16:07:38 -0600 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2012-02-12 16:07:38 -0600 |
commit | 8aaa39e93dfe000ad423b585e78a4c2ee7418363 (patch) | |
tree | 0f7b6d1efb630745bd6bf6af05a722a08c8640cb /src/mem/request.hh | |
parent | 7e104a1af235823e3d641a972ea920937f7ec67d (diff) | |
download | gem5-8aaa39e93dfe000ad423b585e78a4c2ee7418363.tar.xz |
mem: Add a master ID to each request object.
This change adds a master id to each request object which can be
used identify every device in the system that is capable of issuing a request.
This is part of the way to removing the numCpus+1 stats in the cache and
replacing them with the master ids. This is one of a series of changes
that make way for the stats output to be changed to python.
Diffstat (limited to 'src/mem/request.hh')
-rw-r--r-- | src/mem/request.hh | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/src/mem/request.hh b/src/mem/request.hh index dce68087d..b6128f450 100644 --- a/src/mem/request.hh +++ b/src/mem/request.hh @@ -50,6 +50,7 @@ class Request; typedef Request* RequestPtr; +typedef uint16_t MasterID; class Request : public FastAlloc { @@ -100,6 +101,18 @@ class Request : public FastAlloc (assigned a new address). */ static const FlagsType STICKY_FLAGS = INST_FETCH; + /** Request Ids that are statically allocated + * @{*/ + /** This request id is used for writeback requests by the caches */ + static const MasterID wbMasterId = 0; + /** This request id is used for functional requests that don't come from a + * particular device + */ + static const MasterID funcMasterId = 1; + /** This request id is used for message signaled interrupts */ + static const MasterID intMasterId = 2; + /** @} */ + private: typedef uint8_t PrivateFlagsType; typedef ::Flags<PrivateFlagsType> PrivateFlags; @@ -137,6 +150,11 @@ class Request : public FastAlloc */ int _size; + /** The requestor ID which is unique in the system for all ports + * that are capable of issuing a transaction + */ + MasterID _masterId; + /** Flag structure for the request. */ Flags _flags; @@ -182,27 +200,27 @@ 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, Flags flags) + Request(Addr paddr, int size, Flags flags, MasterID mid) { - setPhys(paddr, size, flags); + setPhys(paddr, size, flags, mid); } - Request(Addr paddr, int size, Flags flags, Tick time) + Request(Addr paddr, int size, Flags flags, MasterID mid, Tick time) { - setPhys(paddr, size, flags, time); + setPhys(paddr, size, flags, mid, time); } - Request(Addr paddr, int size, Flags flags, Tick time, Addr pc) + Request(Addr paddr, int size, Flags flags, MasterID mid, Tick time, Addr pc) { - setPhys(paddr, size, flags, time); + setPhys(paddr, size, flags, mid, time); privateFlags.set(VALID_PC); _pc = pc; } - Request(int asid, Addr vaddr, int size, Flags flags, Addr pc, + Request(int asid, Addr vaddr, int size, Flags flags, MasterID mid, Addr pc, int cid, ThreadID tid) { - setVirt(asid, vaddr, size, flags, pc); + setVirt(asid, vaddr, size, flags, mid, pc); setThreadContext(cid, tid); } @@ -224,13 +242,13 @@ class Request : public FastAlloc * allocated Request object. */ void - setPhys(Addr paddr, int size, Flags flags, Tick time) + setPhys(Addr paddr, int size, Flags flags, MasterID mid, Tick time) { assert(size >= 0); _paddr = paddr; _size = size; _time = time; - + _masterId = mid; _flags.clear(~STICKY_FLAGS); _flags.set(flags); privateFlags.clear(~STICKY_PRIVATE_FLAGS); @@ -238,9 +256,9 @@ class Request : public FastAlloc } void - setPhys(Addr paddr, int size, Flags flags) + setPhys(Addr paddr, int size, Flags flags, MasterID mid) { - setPhys(paddr, size, flags, curTick()); + setPhys(paddr, size, flags, mid, curTick()); } /** @@ -248,12 +266,13 @@ class Request : public FastAlloc * allocated Request object. */ void - setVirt(int asid, Addr vaddr, int size, Flags flags, Addr pc) + setVirt(int asid, Addr vaddr, int size, Flags flags, MasterID mid, Addr pc) { assert(size >= 0); _asid = asid; _vaddr = vaddr; _size = size; + _masterId = mid; _pc = pc; _time = curTick(); @@ -369,6 +388,13 @@ class Request : public FastAlloc return _vaddr; } + /** Accesssor for the requestor id. */ + MasterID + masterId() + { + return _masterId; + } + /** Accessor function for asid.*/ int getAsid() |