import types
+
def li(txt, indent):
indent = ' ' * indent
istxt = False
def extifinstance(self, name, count):
return self._extifinstance(name, count, "",
- "pinmux.peripheral_side.")
+ "pinmux.peripheral_side.")
mkplic_rule = """\
endrule
"""
-axi_master_declarations= """\
+axi_master_declarations = """\
typedef 0 Dmem_master_num;
typedef 1 Imem_master_num;
{0}
cnct = list(filter(None, cnct))
ct = self.dma_count
- _cnct = ["rule rl_connect_interrupt_to_DMA;",
- " Bit #(%d) lv_interrupt_to_DMA={" % ct]
+ _cnct = ["rule rl_connect_interrupt_to_DMA;",
+ " Bit #(%d) lv_interrupt_to_DMA={" % ct]
spc = " "
spcsep = ",\n" + spc
cnct = _cnct + [spc + spcsep.join(cnct)]
cnct.append(" };")
- cnct.append(" dma.interrupt_from_peripherals(\n" + \
+ cnct.append(" dma.interrupt_from_peripherals(\n" +
" lv_interrupt_to_DMA);")
cnct.append("endrule;")
def extfastifinstance(self, name, count):
return self._extifinstance(name, count, "_out", "", True)
-
def fastifdecl(self, name, count):
# YUK!
- return "Ifc_jtagdtm jtag{0}_out;".format(count);
+ return "Ifc_jtagdtm jtag{0}_out;".format(count)
def mkfast_peripheral(self):
return """\
jtag{0}.scan_out_5_i(1'b0);
endrule
"""
+
def axi_slave_name(self, name, ifacenum, typ=''):
return ''
"method Bit#(1) %s;" % self.irq_name()
def get_clock_reset(self, name, count):
- return "slow_clock,slow_reset" # XXX TODO: change to uart_clock/reset
+ return "slow_clock,slow_reset" # XXX TODO: change to uart_clock/reset
def num_axi_regs32(self):
return 8
numsloirqs, ifacedef,
inst2))
+
def write_soc(soc, soct, p, ifaces, iocells):
""" write out the soc.bsv file.
joins all the peripherals together as AXI Masters
"""
- ifaces.fastbusmode = True # side-effects... shouldn't really do this
+ ifaces.fastbusmode = True # side-effects... shouldn't really do this
with open(soct) as bsv_file:
soct = bsv_file.read()
imports = ifaces.slowimport()
num_dmachannels = ifaces.num_dmachannels()
with open(soc, "w") as bsv_file:
bsv_file.write(soct.format(imports, ifdecl, mkfast,
- slavedecl, mastdecl, mkcon,
- inst, dma, num_dmachannels,
- #'', '' #regdef, slavedecl,
- #'', mkslow, #fnaddrmap, mkslow, mkcon, mkcellcon,
- #pincon, inst, mkplic,
- #numsloirqs, ifacedef))
- ))
+ slavedecl, mastdecl, mkcon,
+ inst, dma, num_dmachannels,
+ ))
def write_bus(bus, p, ifaces):
def setganged(self, fname, grp):
grp = map(lambda x: x[:-1], grp)
- if not self.ganged.has_key(fname):
+ if fname not in self.ganged:
self.ganged[fname] = []
self.ganged[fname] += grp