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.
{
''')
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");