diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-06-25 00:32:03 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-06-25 00:32:03 -0500 |
commit | beb6e57c6f6141ad959bb97b49daad7f1fa54af3 (patch) | |
tree | 3221c7605fee55dc272fc4ba86ad384db9ad41ca /src/mem/slicc/ast | |
parent | beee57070a1fecfe4b854af0c525b454a472202f (diff) | |
download | gem5-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/ast')
-rw-r--r-- | src/mem/slicc/ast/MachineAST.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mem/slicc/ast/MachineAST.py b/src/mem/slicc/ast/MachineAST.py index d494cb7ce..5d14f7688 100644 --- a/src/mem/slicc/ast/MachineAST.py +++ b/src/mem/slicc/ast/MachineAST.py @@ -29,10 +29,11 @@ from slicc.ast.DeclAST import DeclAST from slicc.symbols import StateMachine, Type class MachineAST(DeclAST): - def __init__(self, slicc, ident, pairs_ast, config_parameters, decls): + def __init__(self, slicc, idents, pairs_ast, config_parameters, decls): super(MachineAST, self).__init__(slicc, pairs_ast) - self.ident = ident + self.ident = idents[0] + self.machine_types = idents self.pairs_ast = pairs_ast self.config_parameters = config_parameters self.decls = decls @@ -71,10 +72,18 @@ class MachineAST(DeclAST): def findMachines(self): # Add to MachineType enumeration - machine_type = self.symtab.find("MachineType", Type) - if not machine_type.addEnum(self.ident, self.pairs_ast.pairs): - self.error("Duplicate machine name: %s:%s" % (machine_type, - self.ident)) + for mtype in self.machine_types: + machine_type = self.symtab.find("MachineType", Type) + pairs = self.pairs_ast.pairs + + if mtype == self.ident: + pairs["Primary"] = True + else: + pairs["Primary"] = False + + if not machine_type.addEnum(mtype, pairs): + self.error("Duplicate machine name: %s:%s" % ( + machine_type, mtype)) # Generate code for all the internal decls self.decls.findMachines() |