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))
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 = {}