From: Luke Kenneth Casson Leighton Date: Wed, 25 Jul 2018 08:03:02 +0000 (+0100) Subject: add mkfast_peripherals fn X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b098b124a061a0345f91252ab96ca107a06be80f;p=pinmux.git add mkfast_peripherals fn --- diff --git a/src/bsv/peripheral_gen/base.py b/src/bsv/peripheral_gen/base.py index a8e15f3..642557d 100644 --- a/src/bsv/peripheral_gen/base.py +++ b/src/bsv/peripheral_gen/base.py @@ -114,6 +114,9 @@ class PBase(object): def mk_cellconn(self, *args): return '' + def mkfast_peripheral(self, size=0): + return '' + def mkslow_peripheral(self, size=0): return '' @@ -239,7 +242,9 @@ class PeripheralIface(object): for fname in ['slowimport', 'extifinstance', 'extifdecl', 'slowifdecl', 'slowifdeclmux', - 'mkslow_peripheral', 'mk_plic', 'mk_ext_ifacedef', + 'mkslow_peripheral', + 'mkfast_peripheral', + 'mk_plic', 'mk_ext_ifacedef', 'mk_connection', 'mk_cellconn', 'mk_pincon']: fn = CallFn(self, fname) setattr(self, fname, types.MethodType(fn, self)) @@ -352,13 +357,26 @@ class PeripheralInterfaces(object): ret.append(self.data[name].axi_addr_map(i)) return '\n'.join(list(filter(None, ret))) + def mkfast_peripheral(self, *args): + ret = [] + for (name, count) in self.ifacecount: + for i in range(count): + if self.is_on_fastbus(name, i): + continue + #print "mkfast", name, count + x = self.data[name].mkfast_peripheral() + print name, count, x + suffix = self.data[name].mksuffix(name, i) + ret.append(x.format(suffix)) + return '\n'.join(list(filter(None, ret))) + def mkslow_peripheral(self, *args): ret = [] for (name, count) in self.ifacecount: for i in range(count): if self.is_on_fastbus(name, i): continue - print "mkslow", name, count + #print "mkslow", name, count x = self.data[name].mkslow_peripheral() print name, count, x suffix = self.data[name].mksuffix(name, i) diff --git a/src/bsv/peripheral_gen/jtag.py b/src/bsv/peripheral_gen/jtag.py index 1f381f4..3ccf6ad 100644 --- a/src/bsv/peripheral_gen/jtag.py +++ b/src/bsv/peripheral_gen/jtag.py @@ -6,16 +6,16 @@ class jtag(PBase): def slowimport(self): return " import jtagtdm::*;\n" - def mkslow_peripheral(self): + def mkfast_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 + Ifc_jtagdtm jtag{0} <-mkjtagdtm(clocked_by tck, reset_by trst); + rule drive_tmp_scan_outs; + jtag{0}.scan_out_1_i(1'b0); + jtag{0}.scan_out_2_i(1'b0); + jtag{0}.scan_out_3_i(1'b0); + jtag{0}.scan_out_4_i(1'b0); + jtag{0}.scan_out_5_i(1'b0); + endrule """ def axi_slave_name(self, name, ifacenum): return '' diff --git a/src/bsv/peripheral_gen/rgbttl.py b/src/bsv/peripheral_gen/rgbttl.py index e875beb..6f69d7b 100644 --- a/src/bsv/peripheral_gen/rgbttl.py +++ b/src/bsv/peripheral_gen/rgbttl.py @@ -9,7 +9,7 @@ class rgbttl(PBase): def num_axi_regs32(self): return 10 - def mkslow_peripheral(self): + def mkfast_peripheral(self): sz = len(self.peripheral.pinspecs) - 4 # subtract CK, DE, HS, VS return " Ifc_rgbttl_dummy lcd{0} <- mkrgbttl_dummy();" diff --git a/src/bsv/pinmux_generator.py b/src/bsv/pinmux_generator.py index c4f675c..7def4f8 100644 --- a/src/bsv/pinmux_generator.py +++ b/src/bsv/pinmux_generator.py @@ -136,7 +136,7 @@ def write_soc(soc, soct, p, ifaces, iocells): regdef = ifaces.axi_reg_def() slavedecl = ifaces.axi_slave_idx() fnaddrmap = ifaces.axi_addr_map() - mkfast = ifaces.mkslow_peripheral() + mkfast = ifaces.mkfast_peripheral() mkcon = ifaces.mk_connection() mkcellcon = ifaces.mk_cellconn() pincon = ifaces.mk_pincon()