From 2c6752c064aff6cf72227d4887dd2e7d9b0ae2ab Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 14 Nov 2021 19:19:26 +0000 Subject: [PATCH] sort out JSON function missing and get mapping working --- src/pinmux_generator.py | 26 +++++++++++++++----------- src/spec/ifaceprint.py | 6 ++++-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/pinmux_generator.py b/src/pinmux_generator.py index 0cf35b5..febc722 100644 --- a/src/pinmux_generator.py +++ b/src/pinmux_generator.py @@ -98,17 +98,21 @@ if __name__ == '__main__': specgen(of, output_dir, pinout, bankspec, ps.muxwidths, pin_spec, fixedpins, ps.fastbus) - pm, chip = module.pinparse(ps, pinspec) - litexmap = ps.pywrite(pyf, pm) - jchip = json.dumps(chip) - with open("%s/litex_pinpads.json" % pinspec, "w") as f: - f.write(jchip) - # TODO: fix create_sv to allow different packages (and die images) - # Test with different package size, once working 'create_sv' will be improved - if pinspec == "ngi_router": - temp_create_sv("%s/%s.svg" % (pinspec, pinspec), chip) - else: - create_sv("%s/%s.svg" % (pinspec, pinspec), chip) + if hasattr(module, "pinparse"): + pm, chip = module.pinparse(ps, pinspec) + litexmap = ps.pywrite(pyf, pm) + jchip = json.dumps(chip) + with open("%s/litex_pinpads.json" % pinspec, "w") as f: + f.write(jchip) + # octavius: please keep line-lengths to below 80 chars + # TODO: fix create_sv to allow different packages + # (and die images) + # Test with different package size, once working + # 'create_sv' will be improved + if pinspec == "ngi_router": + temp_create_sv("%s/%s.svg" % (pinspec, pinspec), chip) + else: + create_sv("%s/%s.svg" % (pinspec, pinspec), chip) else: if output_type == 'bsv': from bsv.pinmux_generator import pinmuxgen as gentypes diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index 87e89d5..51f622a 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -882,8 +882,10 @@ def display_fns(of, bankspec, pins, function_names): for fname in fnidx: fnbase = find_fn(fname, fn_names) #fblower = fnbase.lower() - assert fnbase in function_names, "fn %s not in descriptions %s" % \ - (fname, str(function_names.keys())) + if fnbase not in function_names: + print ("fn %s not in descriptions %s" % \ + (fname, str(function_names.keys()))) + continue #print "name", fname, fnbase if fnbase != current_fn: if current_fn is not None: -- 2.30.2