enabled=True,
io=False,
action=False,
- bitspec=None):
+ bitspec=None,
+ outenmode=False):
self.name = name
self.ready = ready
self.enabled = enabled
self.io = io
self.action = action
self.bitspec = bitspec if bitspec else 'Bit#(1)'
+ self.outenmode = outenmode
def ifacefmt(self, fmtfn):
res = ' '
def ifacefmtdecfn2(self, name):
return name
+ def ifacefmtdecfn3(self, name):
+ """ HACK! """
+ return "%s_outenX" % name
+
def ifacefmtoutfn(self, name):
return "wr%s" % name
return pin.ifacefmt(self.ifacefmtdecfn)
def ifacefmtpin(self, pin):
- return pin.ifacedef(self.ifacefmtoutfn, self.ifacefmtinfn,
- self.ifacefmtdecfn2)
+ decfn = self.ifacefmtdecfn2
+ outfn = self.ifacefmtoutfn
+ print pin, pin.outenmode
+ if pin.outenmode:
+ decfn = self.ifacefmtdecfn3
+ outfn = self.ifacefmtoutenfn
+ return pin.ifacedef(outfn, self.ifacefmtinfn,
+ decfn)
def ifacedef(self, *args):
res = '\n'.join(map(self.ifacefmtpin, self.pins))
class IOInterface(Interface):
+ def ifacefmtoutenfn(self, name):
+ return "cell{0}_mux_outen"
+
def ifacefmtoutfn(self, name):
""" for now strip off io{0}_ part """
return "cell{0}_mux_out"
io_interface = IOInterface(
'io',
- [{'name': 'cell', 'enabled': False, 'bitspec': 'GenericIOType'},
+ [{'name': 'cell_out', 'enabled': False, },
+ {'name': 'cell_outen', 'enabled': False, 'outenmode': True, },
{'name': 'inputval', 'action': True, 'io': True}, ])
# == Peripheral Interface definitions == #