From 6490f801dd729b51c9d243e3493185844171cf8a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 29 Mar 2018 09:20:32 +0100 Subject: [PATCH] add fixed pins generation --- src/spec/gen.py | 8 ++++++++ src/spec/ifaceprint.py | 5 +++++ src/spec/m_class.py | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/spec/gen.py b/src/spec/gen.py index fa056db..ad9fa0e 100644 --- a/src/spec/gen.py +++ b/src/spec/gen.py @@ -40,6 +40,7 @@ def specgen(pth, pinouts, bankspec, fixedpins): for m in pinouts[k].keys(): muxsz = max(muxsz, m + 1) + # write out the mux... with open(os.path.join(pth, 'pinmap.txt'), 'w') as g: for k in pks: res = [str(k)] @@ -51,3 +52,10 @@ def specgen(pth, pinouts, bankspec, fixedpins): fname = '' res.append(fname.lower()) g.write('\t'.join(res) + '\n') + + # ... and the dedicated pins + with open(os.path.join(pth, 'fixedpins.txt'), 'w') as g: + for p in fixedpins: + p = map(str, p) + p = map(str.lower, p) + g.write('\t'.join(p) + '\n') diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index 5715909..642e8a8 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -236,6 +236,7 @@ def display_fixed(fixed, offs): fkeys = fixed.keys() fkeys.sort() pin_ = offs + res = [] for pin, k in enumerate(fkeys): print "## %s" % k print @@ -253,8 +254,12 @@ def display_fixed(fixed, offs): print print "* %d: %d %s" % (pin_, pin, name), linecount = 1 + res.append((pin_, name)) + prevname = name pin_ += 1 if linecount != 0: print print + + return res diff --git a/src/spec/m_class.py b/src/spec/m_class.py index 34cc91f..b9b2c7c 100644 --- a/src/spec/m_class.py +++ b/src/spec/m_class.py @@ -216,7 +216,7 @@ def pinspec(): } - display_fixed(fixedpins, len(pinouts)) + fixedpins = display_fixed(fixedpins, len(pinouts)) print "# Functions (PinMux)" print -- 2.30.2