bname = self.axibase(name, ifacenum)
bend = self.axiend(name, ifacenum)
name = self.axi_slave_name(name, ifacenum)
- return """\
- if(addr>=`{0} && addr<=`{1})
- return tuple2(True,fromInteger(valueOf({2})));
- else""".format(bname, bend, name)
+ template = """\
+if(addr>=`{0} && addr<=`{1})
+ return tuple2(True,fromInteger(valueOf({2})));
+else"""
+ return template.format(bname, bend, name)
def mk_pincon(self, name, count):
# TODO: really should be using bsv.interface_decl.Interfaces
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)))
+ ret.append("//%s %s" % (n, str(p)))
sname = self.peripheral.iname().format(count)
sname = "{0}.{1}".format(sname, pname)
ps = "pinmux.peripheral_side.%s" % sname
n_ = '{0}.{1}'.format(n_, fname)
n_ = self.ifname_tweak(pname, 'in', n_)
ret.append("mkConnection({1}, {0});".format(ps_, n_))
- return '\n'.join(li(ret, 6))
+ return '\n'.join(ret)
def mk_cellconn(self, *args):
return ''
print "PBase __mk_connection", self.name, aname
if not con:
return ''
- return li(txt.format(con, aname, fabricname), 8)
+ return txt.format(con, aname, fabricname)
def __mk_master_connection(self, con, aname):
txt = "mkConnection (slow_fabric.v_to_slaves\n" + \
print "PBase __mk_connection", self.name, aname
if not con:
return ''
- return li(txt.format(con, aname), 8)
+ return txt.format(con, aname)
def mk_connection(self, count, fabricname, typ, name=None):
if name is None:
plic = mkplic_rule.format(name, plic_obj, irq_offs)
res.append(plic)
irq_offs += 1 # increment to next irq
- return ('\n'.join(li(res, 5)), irq_offs)
+ return ('\n'.join(res), irq_offs)
def mk_ext_ifacedef(self, iname, inum):
return ''
sname = pname
else:
sname = self.peripheral.iname().format(count)
- template = " interface {0}{3} = {2}{1};"
+ template = "interface {0}{3} = {2}{1};"
return template.format(pname, sname, prefix, suffix)
def extifinstance2(self, name, count):
"""
pinmux_cellrule = """\
- rule connect_select_lines_pinmux;
+rule connect_select_lines_pinmux;
{0}
- endrule
+endrule
"""
for (name, count) in self.ifacecount:
#print "slowimport", name, self.data[name].slowimport
ret.append(self.data[name].slowimport())
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 4))
def extfastifinstance(self, *args):
ret = []
if self.is_on_fastbus(name, i):
continue
ret.append(self.data[name].extfastifinstance(name, i))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def extifinstance2(self, *args):
ret = []
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)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def extifinstance(self, *args):
ret = []
if not self.is_on_fastbus(name, i):
continue
ret.append(self.data[name].extifinstance(name, i))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def extifdecl(self, *args):
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
ret.append(self.data[name].slowifdeclmux(name, i))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def fastifdecl(self, *args):
ret = []
if self.is_on_fastbus(name, i):
continue
ret.append(self.data[name].fastifdecl(name, i))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 4))
def slowifdecl(self, *args):
ret = []
if self.is_on_fastbus(name, i):
continue
ret.append(self.data[name].axi_addr_map(i))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def mkfast_peripheral(self, *args):
ret = []
print name, count, x
suffix = self.data[name].mksuffix(name, i)
ret.append(x.format(suffix))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def mkslow_peripheral(self, *args):
ret = []
print name, count, x
suffix = self.data[name].mksuffix(name, i)
ret.append(x.format(suffix))
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def mk_fast_connection(self, *args):
ret = []
print "txt", txt
print self.data[name].mk_connection
ret.append(txt)
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 4))
def mk_connection(self, *args):
ret = []
print "txt", txt
print self.data[name].mk_connection
ret.append(txt)
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def mk_cellconn(self):
ret = []
continue
(txt, cellcount) = res
ret.append(txt)
- ret = '\n'.join(list(filter(None, ret)))
- return pinmux_cellrule.format(ret)
+ ret = li('\n'.join(list(filter(None, ret))), 4)
+ return li(pinmux_cellrule.format(ret), 4)
def mk_pincon(self):
ret = []
continue
txt = self.data[name].mk_pincon(name, i)
ret.append(txt)
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 4))
def mk_dma_irq(self):
ret = []
continue
txt = self.data[name].mk_ext_ifacedef(name, i)
ret.append(txt)
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 8))
def mk_plic(self):
ret = []
(txt, irq_offs) = res
ret.append(txt)
self.num_slow_irqs = irq_offs
- return '\n'.join(list(filter(None, ret)))
+ return '\n'.join(li(list(filter(None, ret)), 4))
def mk_sloirqsdef(self):
return " `define NUM_SLOW_IRQS {0}".format(self.num_slow_irqs)