From dfe125c2962ddd4784c9c75dc8c28d5152154546 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 20 Jun 2018 10:06:33 +0100 Subject: [PATCH] separate pin banks by name --- src/spec/base.py | 6 +++++- src/spec/ifaceprint.py | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/spec/base.py b/src/spec/base.py index ba0ce10..bf202c1 100644 --- a/src/spec/base.py +++ b/src/spec/base.py @@ -37,7 +37,11 @@ auto-generated by [[pinouts.py]] [[!toc ]] """) - display(of, self) + bk = self.pinbanks.keys() + bk.sort() + for bank in bk: + of.write("\n## Bank %s (%d pins)\n\n" % (bank, self.pinbanks[bank])) + display(of, self, 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 4af0e59..3dc60f7 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -3,7 +3,7 @@ from copy import deepcopy -def display(of, pins): +def display(of, pins, banksel=None): of.write("""\ | Pin | Mux0 | Mux1 | Mux2 | Mux3 | | --- | ----------- | ----------- | ----------- | ----------- | @@ -11,6 +11,16 @@ def display(of, pins): pinidx = sorted(pins.keys()) for pin in pinidx: pdata = pins.get(pin) + if banksel: + skip = False + for mux in range(4): + if mux not in pdata: + continue + name, bank = pdata[mux] + if banksel != bank: + skip = True + if skip: + continue res = '| %3d |' % pin for mux in range(4): if mux not in pdata: -- 2.30.2