From: Luke Kenneth Casson Leighton Date: Tue, 24 Jul 2018 05:33:50 +0000 (+0100) Subject: add qspi get/put mkConnection X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca40952cfdab010b45b060238405b8b7c01095c4;p=pinmux.git add qspi get/put mkConnection --- diff --git a/src/bsv/peripheral_gen/qspi.py b/src/bsv/peripheral_gen/qspi.py index 462b57b..c4a6764 100644 --- a/src/bsv/peripheral_gen/qspi.py +++ b/src/bsv/peripheral_gen/qspi.py @@ -22,43 +22,24 @@ class qspi(PBase): def pinname_out(self, pname): return {'ck': 'out.clk_o', 'nss': 'out.ncs_o', - 'io0': 'out.io_o[0]', - 'io1': 'out.io_o[1]', - 'io2': 'out.io_o[2]', - 'io3': 'out.io_o[3]', }.get(pname, '') def pinname_outen(self, pname): return {'ck': 1, 'nss': 1, - 'io0': 'out.io_enable[0]', - 'io1': 'out.io_enable[1]', - 'io2': 'out.io_enable[2]', - 'io3': 'out.io_enable[3]', }.get(pname, '') def mk_pincon(self, name, count): ret = [PBase.mk_pincon(self, name, count)] # special-case for gpio in, store in a temporary vector + ret = [] plen = len(self.peripheral.pinspecs) - ret.append(" // XXX NSS and CLK are hard-coded master") - ret.append(" // TODO: must add qspi slave-mode") - ret.append(" // all ins done in one rule from 4-bitfield") - ret.append(" rule con_%s%d_io_in;" % (name, count)) - ret.append(" {0}{1}.out.io_i({{".format(name, count)) - for i, p in enumerate(self.peripheral.pinspecs): - typ = p['type'] - pname = p['name'] - if not pname.startswith('io'): - continue - idx = pname[1:] - n = name - sname = self.peripheral.pname(pname).format(count) - ps = "pinmux.peripheral_side.%s_in" % sname - comma = '' if i == 5 else ',' - ret.append(" {0}{1}".format(ps, comma)) - ret.append(" });") - ret.append(" endrule") + template = " mkConnection({0}.{1},\n\t\t\t{2}.{1});" + ps = "pinmux.peripheral_side.%s" % name + name = self.get_iname(count) + n = "{0}.out".format(name) + for ptype in ['io_out', 'io_out_en', 'io_in']: + ret.append(template.format(ps, ptype, n)) return '\n'.join(ret) def num_irqs(self):