From b7261abcb50126621d8a9db8daf745b54076b063 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 25 Jun 2018 09:56:11 +0100 Subject: [PATCH] do full cell mux range otherwise spurious outputs occur --- src/bsv/actual_pinmux.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/bsv/actual_pinmux.py b/src/bsv/actual_pinmux.py index 78b9ba3..eef01b0 100644 --- a/src/bsv/actual_pinmux.py +++ b/src/bsv/actual_pinmux.py @@ -44,17 +44,22 @@ def transfn(temp): temp[0] = temp[0] .replace(' ', '') return '_'.join(temp) -def fmt(cell): +def fmt(cell, idx): """ blank entries need to output a 0 to the pin (it could just as well be a 1 but we choose 0). reason: blank entries in the pinmap.txt file indicate that there's nothing to choose from. however the user may still set the muxer to that value, and rather than throw an exception we choose to output... zero. """ + idx += 1 + if idx < len(cell): + cell = cell[idx] + else: + cell = '' return "%s_io" % cell if cell else '0' -def mkcomment(p, cell): +def mkcomment(p, cell, idx): """ returns a comment string for the cell when muxed """ return "" @@ -72,6 +77,12 @@ def init(p, ifaces): d last line doesn't need selector-logic, obviously. + + note that it's *important* that all muxer options be covered + (hence going up to 1<