From 2232a9f43a5b60fe31f7de65b6000c7a00d5309b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 13 Apr 2021 17:21:32 +0100 Subject: [PATCH] add litex name map --- src/pinmux_generator.py | 2 +- src/spec/ls180.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pinmux_generator.py b/src/pinmux_generator.py index 04d3cf9..3e92bf0 100644 --- a/src/pinmux_generator.py +++ b/src/pinmux_generator.py @@ -92,7 +92,7 @@ if __name__ == '__main__': pm, chip = module.pinparse(ps, pinspec) litexmap = ps.pywrite(pyf, pm) pinout, bankspec, pin_spec, fixedpins = ps.write(of) - chip['litex.map'] = litexmap + #chip['litex.map'] = litexmap chip = json.dumps(chip) with open("%s/litex_pinpads.json" % pinspec, "w") as f: f.write(chip) diff --git a/src/spec/ls180.py b/src/spec/ls180.py index 15f9353..e78367e 100644 --- a/src/spec/ls180.py +++ b/src/spec/ls180.py @@ -139,6 +139,7 @@ def pinspec(): def pinparse(psp, pinspec): p = Parse(pinspec, verify=False) pinmap = {} + litexmap = {} print p.muxed_cells print p.muxed_cells_bank @@ -157,6 +158,7 @@ def pinparse(psp, pinspec): n_extpower = 0 for (padnum, name, x), bank in zip(p.muxed_cells, p.muxed_cells_bank): orig_name = name + litex_name = None domain = None # TODO, get this from the PinSpec. sigh padnum = int(padnum) start = p.bankstart[bank] @@ -226,6 +228,7 @@ def pinparse(psp, pinspec): prefix = 'spisdcard_' name = prefix + suffix pad = ['p_' + name, name, name] + litex_name = name[:6] + suffix # SD/MMC elif name.startswith('sd0'): domain = 'SD' @@ -241,6 +244,7 @@ def pinparse(psp, pinspec): else: name = 'sdcard_' + name[4:] pad = ['p_' + name, name, name] + litex_name = name[:6] + "_".join(name.split("_")[1:]) # SDRAM elif name.startswith('sdr'): domain = 'SDR' @@ -276,6 +280,7 @@ def pinparse(psp, pinspec): else: name = 'sdram_' + name[4:] pad = ['p_' + name, name, name] + litex_name = name[:5] + "_".join(name.split("_")[1:]) # UART elif name.startswith('uart'): domain = 'UART' @@ -324,6 +329,9 @@ def pinparse(psp, pinspec): pad = ['p_' + name, name, name] print ("GPIO pad", name, pad) + if litex_name is None: + litex_name = name + # JTAG domain if name and name.startswith('jtag'): domain = 'JTAG' @@ -345,6 +353,7 @@ def pinparse(psp, pinspec): clocks[domain] = name # record remap pinmap[orig_name] = name + litexmap[litex_name] = name # add pad to iopads if domain and pad is not None: @@ -412,6 +421,7 @@ def pinparse(psp, pinspec): 'pads.instances' : iopads, 'pins.specs' : psp.byspec, 'pins.map' : pinmap, + 'litex.map' : litexmap, 'chip.domains' : domains, 'chip.clocks' : clocks, 'chip.n_intpower': n_intpower, -- 2.30.2