+ def mk_pincon(self, name, count):
+ # TODO: really should be using bsv.interface_decl.Interfaces
+ # pin-naming rules.... logic here is hard-coded to duplicate
+ # it (see Interface.__init__ outen)
+ ret = []
+ for p in self.peripheral.pinspecs:
+ typ = p['type']
+ pname = p['name']
+ #n = "{0}{1}".format(self.name, self.mksuffix(name, count))
+ n = name # "{0}{1}".format(self.name, self.mksuffix(name, count))
+ ret.append(" //%s %s" % (n, str(p)))
+ sname = self.peripheral.pname(pname).format(count)
+ ps = "pinmux.peripheral_side.%s" % sname
+ if typ == 'out' or typ == 'inout':
+ ret.append(" rule con_%s%d_%s_out;" % (name, count, pname))
+ fname = self.pinname_out(pname)
+ if fname:
+ if p.get('outen'):
+ ps_ = ps + '_out'
+ else:
+ ps_ = ps
+ n_ = "{0}{1}".format(n, count)
+ ret.append(" {0}({1}.{2});".format(ps_, n_, fname))
+ fname = None
+ if p.get('outen'):
+ fname = self.pinname_outen(pname)
+ if fname:
+ if isinstance(fname, str):
+ fname = "{0}{1}.{2}".format(n, count, fname)
+ fname = self.pinname_tweak(pname, 'outen', fname)
+ ret.append(" {0}_outen({1});".format(ps, fname))
+ ret.append(" endrule")
+ if typ == 'in' or typ == 'inout':
+ fname = self.pinname_in(pname)
+ if fname:
+ if p.get('outen'):
+ ps_ = ps + '_in'
+ else:
+ ps_ = ps
+ ret.append(
+ " rule con_%s%d_%s_in;" %
+ (name, count, pname))
+ n_ = "{0}{1}".format(n, count)
+ ret.append(" {1}.{2}({0});".format(ps_, n_, fname))
+ ret.append(" endrule")
+ return '\n'.join(ret)
+
+ def mk_cellconn(self, *args):
+ return ''
+
+ def mkslow_peripheral(self, size=0):