template = " interface {0}{3} = {2}{1};"
return template.format(pname, sname, prefix, suffix)
+ def extifinstance2(self, name, count):
+ return ''
+
def extifinstance(self, name, count):
return self._extifinstance(name, count, "",
"pinmux.peripheral_side.")
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
- 'extfastifinstance', 'extifinstance', 'extifdecl',
+ 'extfastifinstance',
+ 'extifinstance2', 'extifinstance', 'extifdecl',
'slowifdecl', 'slowifdeclmux',
'fastifdecl',
'mkslow_peripheral',
ret.append(self.data[name].extfastifinstance(name, i))
return '\n'.join(list(filter(None, ret)))
+ def extifinstance2(self, *args):
+ ret = []
+ for (name, count) in self.ifacecount:
+ for i in range(count):
+ iname = self.data[name].iname().format(i)
+ ret.append(self.data[name].extifinstance2(name, i))
+ return '\n'.join(list(filter(None, ret)))
+
def extifinstance(self, *args):
ret = []
for (name, count) in self.ifacecount:
" import mux::*;\n" + \
" import gpio::*;\n"
+ def extifinstance2(self, name, count):
+ template = "interface pad_config{0} = {1}.pad_config;"
+ dname = self.mksuffix(self.name, count)
+ return template.format(dname, name)
+
def slowifdeclmux(self, name, count):
size = len(self.peripheral.pinspecs)
- return " interface GPIO_config#(%d) pad_config%d;" % \
- (size, count)
+ dname = self.mksuffix(self.name, count)
+ return "interface GPIO_config#(%d) pad_config%s;" % \
+ (size, dname)
def num_axi_regs32(self):
return 2
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
inst = ifaces.extifinstance()
+ inst2 = ifaces.extifinstance2()
mkplic = ifaces.mk_plic()
numsloirqs = ifaces.mk_sloirqsdef()
ifacedef = ifaces.mk_ext_ifacedef()
bsv_file.write(slowt.format(imports, ifdecl, regdef, slavedecl,
fnaddrmap, mkslow, mkcon, mkcellcon,
pincon, inst, mkplic,
- numsloirqs, ifacedef))
+ numsloirqs, ifacedef,
+ inst2))
def write_soc(soc, soct, p, ifaces, iocells):
""" write out the soc.bsv file.