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/sim/system.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/sim/system.hh')
-rw-r--r-- | src/sim/system.hh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/sim/system.hh b/src/sim/system.hh index eb192fb99..9d11132e5 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -229,7 +229,35 @@ class System : public MemObject uint32_t numWorkIds; std::vector<bool> activeCpus; + /** This array is a per-sytem list of all devices capable of issuing a + * memory system request and an associated string for each master id. + * It's used to uniquely id any master in the system by name for things + * like cache statistics. + */ + std::vector<std::string> masterIds; + public: + + /** Request an id used to create a request object in the system. All objects + * that intend to issues requests into the memory system must request an id + * in the init() phase of startup. All master ids must be fixed by the + * regStats() phase that immediately preceeds it. This allows objects in the + * memory system to understand how many masters may exist and + * appropriately name the bins of their per-master stats before the stats + * are finalized + */ + MasterID getMasterId(std::string req_name); + + /** Get the name of an object for a given request id. + */ + std::string getMasterName(MasterID master_id); + + /** Get the number of masters registered in the system */ + MasterID maxMasters() + { + return masterIds.size(); + } + virtual void regStats(); /** * Called by pseudo_inst to track the number of work items started by this |