From f6c9eb0ff8144658e83ea9665c23ce57905ea61e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 1 Apr 2021 16:50:31 +0100 Subject: [PATCH] use OrderedDict in pinmap so that JTAG boundary scan is ordered --- src/spec/ifaceprint.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index dba37e6..3d3cfb4 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -89,14 +89,14 @@ def map_name(pinmap, fn, fblower, pin, rename): def python_pindict(of, pinmap, pins, function_names, dname, remap): - of.write("%s = {\n" % dname) + of.write("\n%s = OrderedDict()\n" % dname) for k, pingroup in pins.byspec.items(): (a, n) = k.split(":") if n.isdigit(): a = "%s%s" % (a, n) fblower = a.lower() - of.write(" '%s': [ " % fblower) + of.write("%s['%s'] = [ " % (dname, fblower)) count = 0 for i, p in enumerate(pingroup): of.write("'%s', " % map_name(pinmap, k[0], fblower, p, remap)) @@ -104,13 +104,15 @@ def python_pindict(of, pinmap, pins, function_names, dname, remap): if count == 4 and i != len(pingroup)-1: of.write("\n ") count = 0 - of.write("],\n") + of.write("]\n") print " dict %s" % dname, a, n, pingroup - of.write("}\n\n") + of.write("\n\n") def python_dict_fns(of, pinmap, pins, function_names): of.write("# auto-generated by Libre-SOC pinmux program: do not edit\n") of.write("# python src/pinmux_generator.py -v -s {spec} -o {output}\n") + of.write("# use OrderedDict to fix stable order for JTAG Boundary Scan\n") + of.write("from collections import OrderedDict\n") fn_names = function_names.keys() fns = {} -- 2.30.2