if len(s0.pingroup) == 1: # only one function, grouped higher
for ks in s.keys(): # grouped by interface
fntype = 'inout' # XXX TODO
- k = "%s_%s" % (s[ks].fname, s[ks].suffix)
+ k = s[ks].suffix
k_ = k.lower()
g.write("%s\t%s\n" % (k_, fntype))
else:
fname = pinouts[k][midx][0]
else:
fname = ''
- print k, midx, fname
res.append(fname.lower())
g.write('\t'.join(res) + '\n')
#!/usr/bin/env python
+from copy import deepcopy
+
+
class Pinouts(object):
def __init__(self):
self.pins = {}
specname = fname + suffix
else:
specname = fname + bank
- pins.fnspec[fname][specname] = fn
-
+ if pins.fnspec[fname].has_key(specname):
+ # ok so some declarations may bring in different
+ # names at different stages (EINT, PWM, flexbus1/2)
+ # so we have to merge the names in. main thing is
+ # the pingroup
+ tomerge = pins.fnspec[fname][specname]
+ for p in fn.pingroup:
+ if p not in tomerge.pingroup:
+ tomerge.pingroup.append(p)
+ tomerge.pins.update(fn.pins)
+ tomerge.fntype.update(fn.fntype)
+ else:
+ pins.fnspec[fname][specname] = deepcopy(fn)
# merge actual pins
for (pinidx, v) in fn.pins.items():