diff options
author | Joel Hestness <jthestness@gmail.com> | 2013-04-09 16:25:29 -0500 |
---|---|---|
committer | Joel Hestness <jthestness@gmail.com> | 2013-04-09 16:25:29 -0500 |
commit | e98c3c227da0b7c4a3e11e64eb80386727b3fa1c (patch) | |
tree | 4e2a26f2663aa1b4d0f0af27c761fe21803299a5 /src/mem/slicc/symbols | |
parent | b936619ab44de2ad51376737db9b8c9c6121e8ca (diff) | |
download | gem5-e98c3c227da0b7c4a3e11e64eb80386727b3fa1c.tar.xz |
Ruby: Add field to slicc machine for generic type
This allows you to have (i.e.) an L2 cache that is not named "L2Cache"
but is still a GenericMachineType_L2Cache. This is particularly
helpful if the protocol has multiple L2 controllers.
Diffstat (limited to 'src/mem/slicc/symbols')
-rw-r--r-- | src/mem/slicc/symbols/Type.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index 6ee48ba8b..1c2177ce1 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -540,9 +540,11 @@ 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_${{enum.ident}}; + return GenericMachineType_${{genericType}}; ''') code(''' panic("cannot convert to a GenericMachineType"); |