`ifdef FlexBus
interface FlexBus_Master_IFC flexbus_out;
`endif
-
+{1}
endinterface
(*synthesize*)
module mkSoc #(Bit#(`VADDR) reset_vector, Clock slow_clock, Reset slow_reset, Clock uart_clock,
`ifdef PWM_AXI4Lite ,Clock ext_pwm_clock `endif )(Ifc_Soc);
Clock core_clock <-exposeCurrentClock; // slow peripheral clock
Reset core_reset <-exposeCurrentReset; // slow peripheral reset
+{2}
`ifdef Debug
Ifc_jtagdtm tap <-mkjtagdtm(clocked_by tck, reset_by trst);
rule drive_tmp_scan_outs;
class PeripheralInterfaces(object):
def __init__(self):
- pass
+ self.fastbusmode = False
def slowimport(self, *args):
ret = []
return " `define NUM_SLOW_IRQS {0}".format(self.num_slow_irqs)
def is_on_fastbus(self, name, i):
+ #print "fastbus mode", self.fastbusmode, name, i
iname = self.data[name].iname().format(i)
+ if self.fastbusmode:
+ return iname not in self.fastbus
return iname in self.fastbus
def slowimport(self):
return " import jtagtdm::*;\n"
+ def mkslow_peripheral(self):
+ return """\
+ Ifc_jtagdtm {0} <-mkjtagdtm(clocked_by tck, reset_by trst);
+ rule drive_tmp_scan_outs;
+ {0}.scan_out_1_i(1'b0);
+ {0}.scan_out_2_i(1'b0);
+ {0}.scan_out_3_i(1'b0);
+ {0}.scan_out_4_i(1'b0);
+ {0}.scan_out_5_i(1'b0);
+ endrule
+"""
def axi_slave_name(self, name, ifacenum):
return ''
""" write out the soc.bsv file.
joins all the peripherals together as AXI Masters
"""
+ ifaces.fastbusmode = True # side-effects... shouldn't really do this
with open(soct) as bsv_file:
soct = bsv_file.read()
imports = ifaces.slowimport()
- ifdecl = ifaces.slowifdeclmux() + '\n' + ifaces.extifdecl()
+ ifdecl = "" #ifaces.slowifdeclmux() + '\n' + ifaces.extifdecl()
regdef = ifaces.axi_reg_def()
slavedecl = ifaces.axi_slave_idx()
fnaddrmap = ifaces.axi_addr_map()
- mkslow = ifaces.mkslow_peripheral()
+ mkfast = ifaces.mkslow_peripheral()
mkcon = ifaces.mk_connection()
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
ifacedef = ifaces.mk_ext_ifacedef()
ifacedef = ifaces.mk_ext_ifacedef()
with open(soc, "w") as bsv_file:
- bsv_file.write(soct.format(imports, ))#ifdecl, regdef, slavedecl,
- #fnaddrmap, mkslow, mkcon, mkcellcon,
- #pincon, inst, mkplic,
- #numsloirqs, ifacedef))
+ bsv_file.write(soct.format(imports, ifdecl, mkfast,
+ #'', '' #regdef, slavedecl,
+ #'', mkslow, #fnaddrmap, mkslow, mkcon, mkcellcon,
+ #pincon, inst, mkplic,
+ #numsloirqs, ifacedef))
+ ))
def write_bus(bus, p, ifaces):