summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-06-25 00:32:03 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-06-25 00:32:03 -0500
commitbeb6e57c6f6141ad959bb97b49daad7f1fa54af3 (patch)
tree3221c7605fee55dc272fc4ba86ad384db9ad41ca /src/mem/slicc/symbols
parentbeee57070a1fecfe4b854af0c525b454a472202f (diff)
downloadgem5-beb6e57c6f6141ad959bb97b49daad7f1fa54af3.tar.xz
ruby: profiler: lots of inter-related changes
The patch started of with removing the global variables from the profiler for profiling the miss latency of requests made to the cache. The corrresponding histograms have been moved to the Sequencer. These are combined together when the histograms are printed. Separate histograms are now maintained for tracking latency of all requests together, of hits only and of misses only. A particular set of histograms used to use the type GenericMachineType defined in one of the protocol files. This patch removes this type. Now, everything that relied on this type would use MachineType instead. To do this, SLICC has been changed so that multiple machine types can be declared by a controller in its preamble.
Diffstat (limited to 'src/mem/slicc/symbols')
-rw-r--r--src/mem/slicc/symbols/Type.py36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index 1c2177ce1..29b68f2c5 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -477,7 +477,6 @@ ${{self.c_ident}}::print(ostream& out) const
if self.isMachineType:
code('#include "base/misc.hh"')
- code('#include "mem/protocol/GenericMachineType.hh"')
code('#include "mem/ruby/common/Address.hh"')
code('struct MachineID;')
@@ -534,23 +533,6 @@ MachineID map_Address_to_DMA(const Address &addr);
MachineID get${{enum.ident}}MachineID(NodeID RubyNode);
''')
- code('''
-inline GenericMachineType
-ConvertMachToGenericMach(MachineType machType)
-{
-''')
- for enum in self.enums.itervalues():
- genericType = self.enums[enum.ident].get('genericType',
- enum.ident)
- code('''
- if (machType == MachineType_${{enum.ident}})
- return GenericMachineType_${{genericType}};
-''')
- code('''
- panic("cannot convert to a GenericMachineType");
-}
-''')
-
if self.isStateDecl:
code('''
@@ -610,7 +592,8 @@ AccessPermission ${{self.c_ident}}_to_permission(const ${{self.c_ident}}& obj)
if self.isMachineType:
for enum in self.enums.itervalues():
- code('#include "mem/protocol/${{enum.ident}}_Controller.hh"')
+ if enum.get("Primary"):
+ code('#include "mem/protocol/${{enum.ident}}_Controller.hh"')
code('#include "mem/ruby/system/MachineID.hh"')
code('''
@@ -747,7 +730,11 @@ ${{self.c_ident}}_base_number(const ${{self.c_ident}}& obj)
code.indent()
code(' case ${{self.c_ident}}_NUM:')
for enum in reversed(self.enums.values()):
- code(' base += ${{enum.ident}}_Controller::getNumControllers();')
+ # Check if there is a defined machine with this type
+ if enum.get("Primary"):
+ code(' base += ${{enum.ident}}_Controller::getNumControllers();')
+ else:
+ code(' base += 0;')
code(' case ${{self.c_ident}}_${{enum.ident}}:')
code(' break;')
code.dedent()
@@ -771,10 +758,11 @@ ${{self.c_ident}}_base_count(const ${{self.c_ident}}& obj)
# For each field
for enum in self.enums.itervalues():
- code('''
- case ${{self.c_ident}}_${{enum.ident}}:
- return ${{enum.ident}}_Controller::getNumControllers();
-''')
+ code('case ${{self.c_ident}}_${{enum.ident}}:')
+ if enum.get("Primary"):
+ code('return ${{enum.ident}}_Controller::getNumControllers();')
+ else:
+ code('return 0;')
# total num
code('''