of.write(
"\n## Bank %s (%d pins, width %d)\n\n" %
(bank, self.pinbanks[bank], self.muxwidths[bank]))
- display(of, self, bank)
+ display(of, self, bank, muxwidth=self.muxwidths[bank])
of.write("\n# Pinouts (Fixed function)\n\n")
fixedpins = display_fixed(of, self.fixedpins, len(self))
from copy import deepcopy
-def display(of, pins, banksel=None):
+def display(of, pins, banksel=None, muxwidth=4):
of.write("""\
| Pin | Mux0 | Mux1 | Mux2 | Mux3 |
| --- | ----------- | ----------- | ----------- | ----------- |
pdata = pins.get(pin)
if banksel:
skip = False
- for mux in range(4):
+ for mux in range(muxwidth):
if mux not in pdata:
continue
name, bank = pdata[mux]
if skip:
continue
res = '| %3d |' % pin
- for mux in range(4):
+ for mux in range(muxwidth):
if mux not in pdata:
res += " |"
continue