From 9786e9bc10e517ad980e6df3264f6c5d699a53ac Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 31 Jul 2018 07:03:14 +0100 Subject: [PATCH] pass in muxwidth as argument --- src/spec/base.py | 2 +- src/spec/ifaceprint.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spec/base.py b/src/spec/base.py index 86ad570..bdb50ea 100644 --- a/src/spec/base.py +++ b/src/spec/base.py @@ -48,7 +48,7 @@ auto-generated by [[pinouts.py]] 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)) diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index e15d102..51088f5 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -3,7 +3,7 @@ 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 | | --- | ----------- | ----------- | ----------- | ----------- | @@ -13,7 +13,7 @@ def display(of, pins, banksel=None): 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] @@ -22,7 +22,7 @@ def display(of, pins, banksel=None): if skip: continue res = '| %3d |' % pin - for mux in range(4): + for mux in range(muxwidth): if mux not in pdata: res += " |" continue -- 2.30.2