BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/qspi
BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/spi
BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/sdmmc
+BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/flexbus
BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/uart
default: gen_verilog
`ifdef DDR
interface master=fabric.v_to_slaves[fromInteger(valueOf(Sdram_slave_num))];
`endif
- `ifdef Debug
- method Action tms_i(Bit#(1) tms);
- tap.tms_i(tms);
- endmethod
- method Action tdi_i(Bit#(1) tdi);
- tap.tdi_i(tdi);
- endmethod
- method Action bs_chain_i(Bit#(1) bs_chain);
- tap.bs_chain_i(bs_chain);
- endmethod
- method Bit#(1) shiftBscan2Edge=tap.shiftBscan2Edge;
- method Bit#(1) selectJtagInput=tap.selectJtagInput;
- method Bit#(1) selectJtagOutput=tap.selectJtagOutput;
- method Bit#(1) updateBscan=tap.updateBscan;
- method Bit#(1) bscan_in=tap.bscan_in;
- method Bit#(1) scan_shift_en=tap.scan_shift_en;
- method Bit#(1) tdo=tap.tdo;
- method Bit#(1) tdo_oe=tap.tdo_oe;
- `endif
interface slow_ios=slow_peripherals.slow_ios;
-
+{6}
endmodule
endpackage
def mk_ext_ifacedef(self, iname, inum):
return ''
+ def extfastifinstance(self, name, count):
+ return ''
+
def extifinstance(self, name, count):
sname = self.peripheral.iname().format(count)
pname = self.get_iname(count)
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
- 'extifinstance', 'extifdecl',
+ 'extfastifinstance', 'extifinstance', 'extifdecl',
'slowifdecl', 'slowifdeclmux',
'fastifdecl',
'mkslow_peripheral',
ret.append(self.data[name].slowimport())
return '\n'.join(list(filter(None, ret)))
+ def extfastifinstance(self, *args):
+ ret = []
+ for (name, count) in self.ifacecount:
+ for i in range(count):
+ iname = self.data[name].iname().format(i)
+ print "extfast", iname, self.is_on_fastbus(name, i)
+ if self.is_on_fastbus(name, i):
+ continue
+ ret.append(self.data[name].extfastifinstance(name, i))
+ return '\n'.join(list(filter(None, ret)))
+
def extifinstance(self, *args):
ret = []
for (name, count) in self.ifacecount:
def slowimport(self):
return " import jtagtdm::*;\n"
+ def extfastifinstance(self, name, count):
+ # YUK!
+ print "jtag", name, count
+ return """\
+ method Action tms_i(Bit#(1) tms);
+ {0}.tms_i(tms);
+ endmethod
+ method Action tdi_i(Bit#(1) tdi);
+ {0}.tdi_i(tdi);
+ endmethod
+ method Action bs_chain_i(Bit#(1) bs_chain);
+ {0}.bs_chain_i(bs_chain);
+ endmethod
+ method Bit#(1) shiftBscan2Edge={0}.shiftBscan2Edge;
+ method Bit#(1) selectJtagInput={0}.selectJtagInput;
+ method Bit#(1) selectJtagOutput={0}.selectJtagOutput;
+ method Bit#(1) updateBscan={0}.updateBscan;
+ method Bit#(1) bscan_in={0}.bscan_in;
+ method Bit#(1) scan_shift_en={0}.scan_shift_en;
+ method Bit#(1) tdo={0}.tdo;
+ method Bit#(1) tdo_oe={0}.tdo_oe;
+""".format(self.name, count)
+
+
+
def fastifdecl(self, name, count):
# YUK!
template = """ \
mkcon = ifaces.mk_fast_connection()
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
- inst = ifaces.extifinstance()
+ inst = ifaces.extfastifinstance()
mkplic = ifaces.mk_plic()
numsloirqs = ifaces.mk_sloirqsdef()
ifacedef = ifaces.mk_ext_ifacedef()
- ifacedef = ifaces.mk_ext_ifacedef()
with open(soc, "w") as bsv_file:
bsv_file.write(soct.format(imports, ifdecl, mkfast,
slavedecl, mastdecl, mkcon,
+ inst,
#'', '' #regdef, slavedecl,
#'', mkslow, #fnaddrmap, mkslow, mkcon, mkcellcon,
#pincon, inst, mkplic,