From: Luke Kenneth Casson Leighton Date: Fri, 20 Jul 2018 10:22:12 +0000 (+0100) Subject: add pinmux cell connections X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94675638ab8442e88aca73f632a27029f9661f4d;p=pinmux.git add pinmux cell connections --- diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index 20cc188..57d70cd 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -209,6 +209,12 @@ class gpio(PBase): if name.startswith('mux'): return "mux{0}.axi_slave" + def mk_cellconn(self, cellnum, bank, count): + ret = [] + bank = bank[4:] # strip off "gpio" + txt = " pinmux.mux_lines.cell{0}_mux(mux{1}.mux_config.mux[{2}]);" + return txt.format(cellnum, bank, count) + axi_slave_declarations = """\ typedef 0 SlowMaster; @@ -345,10 +351,12 @@ class PeripheralInterfaces(object): def mk_cellconn(self): ret = [] - txt = " pinmux.mux_lines.cell{0}_mux(muxa.mux_config.mux[{0}]);" + cellcount = 0 for (name, count) in self.ifacecount: for i in range(count): - ret.append(txt.format(i)) + txt = self.data[name].mk_cellcon(cellcount, name, i) + cellcount += 1 + ret.append(txt) ret = '\n'.join(list(filter(None, ret))) return pinmux_cellrule.format(ret) diff --git a/src/bsv/pinmux_generator.py b/src/bsv/pinmux_generator.py index e33c082..7f91db9 100644 --- a/src/bsv/pinmux_generator.py +++ b/src/bsv/pinmux_generator.py @@ -106,7 +106,7 @@ def write_slow(slow, template, p, ifaces, iocells): fnaddrmap = ifaces.axi_addr_map() mkslow = ifaces.mkslow_peripheral() mkcon = ifaces.mk_connection() - mkcellcon = iocells.mk_cellconn() + mkcellcon = ifaces.mk_cellconn() with open(slow, "w") as bsv_file: bsv_file.write(template.format(imports, ifdecl, regdef, slavedecl, fnaddrmap, mkslow, mkcon, mkcellcon))