self.param_strings = param_strings
self.body = body
self.isInternalMachineFunc = False
+ self.c_ident = ident
- if machine is None:
- self.c_ident = ident
- elif "external" in self or "primitive" in self:
- self.c_ident = ident
+ if machine is None or "external" in self or "primitive" in self:
+ pass
else:
self.machineStr = str(machine)
- # Append with machine name
- self.c_ident = "%s_%s" % (self.machineStr, ident)
self.isInternalMachineFunc = True
def __repr__(self):
${{self.body}}
}
''')
- code.write(path, "%s.cc" % self.c_ident)
+ if self.isInternalMachineFunc:
+ code.write(path, "%s_%s.cc" % (self.machineStr,self.c_ident))
+ else:
+ code.write(path, "%s.cc" % self.c_ident)
__all__ = [ "Func" ]
{
''')
if self.TBEType != None and self.EntryType != None:
- code('${ident}_State state = ${ident}_getState(m_tbe_ptr, m_cache_entry_ptr, addr);')
+ code('${ident}_State state = getState(m_tbe_ptr, m_cache_entry_ptr, addr);')
elif self.TBEType != None:
- code('${ident}_State state = ${ident}_getState(m_tbe_ptr, addr);')
+ code('${ident}_State state = getState(m_tbe_ptr, addr);')
elif self.EntryType != None:
- code('${ident}_State state = ${ident}_getState(m_cache_entry_ptr, addr);')
+ code('${ident}_State state = getState(m_cache_entry_ptr, addr);')
else:
- code('${ident}_State state = ${ident}_getState(addr);')
+ code('${ident}_State state = getState(addr);')
code('''
${ident}_State next_state = state;
CLEAR_TRANSITION_COMMENT();
''')
if self.TBEType != None and self.EntryType != None:
- code('${ident}_setState(m_tbe_ptr, m_cache_entry_ptr, addr, next_state);')
+ code('setState(m_tbe_ptr, m_cache_entry_ptr, addr, next_state);')
code('set_permission(m_cache_entry_ptr, ${ident}_State_to_permission(next_state));')
elif self.TBEType != None:
- code('${ident}_setState(m_tbe_ptr, addr, next_state);')
+ code('setState(m_tbe_ptr, addr, next_state);')
elif self.EntryType != None:
- code('${ident}_setState(m_cache_entry_ptr, addr, next_state);')
+ code('setState(m_cache_entry_ptr, addr, next_state);')
code('set_permission(m_cache_entry_ptr, ${ident}_State_to_permission(next_state));')
else:
- code('${ident}_setState(addr, next_state);')
+ code('setState(addr, next_state);')
code('''
} else if (result == TransitionResult_ResourceStall) {