projects
/
pinmux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cf5455e
)
output zero where there is a blank entry in the pinmux
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 13 Jun 2018 11:53:30 +0000
(12:53 +0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 13 Jun 2018 11:53:30 +0000
(12:53 +0100)
src/bsv/actual_pinmux.py
patch
|
blob
|
history
diff --git
a/src/bsv/actual_pinmux.py
b/src/bsv/actual_pinmux.py
index 65473e099acb2cb10e6fda2ff4bfce2e200a28af..a920db61c6ec894271570c412d943842df5af122 100644
(file)
--- a/
src/bsv/actual_pinmux.py
+++ b/
src/bsv/actual_pinmux.py
@@
-36,6
+36,14
@@
def transfn(temp):
temp[0] = temp[0] .replace(' ', '')
return '_'.join(temp)
temp[0] = temp[0] .replace(' ', '')
return '_'.join(temp)
+def fmt(cell):
+ """ 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.
+ """
+ return "%s_io" % cell if cell else '0'
def init(p, ifaces):
""" generates the actual output pinmux for each io-cell. blank lines
def init(p, ifaces):
""" generates the actual output pinmux for each io-cell. blank lines
@@
-49,8
+57,8
@@
def init(p, ifaces):
p.pinmux += " %s_out=" % cn(cell[0])
for i in range(0, len(cell) - 2):
p.pinmux += "wr%s" % cn(cell[0]) + \
p.pinmux += " %s_out=" % cn(cell[0])
for i in range(0, len(cell) - 2):
p.pinmux += "wr%s" % cn(cell[0]) + \
- "==" + str(i) + "?" +
cell[i + 1] + "_io
:\n\t\t\t"
- p.pinmux +=
cell[i + 2] + "_io"
+ "==" + str(i) + "?" +
fmt(cell[i + 1]) + "
:\n\t\t\t"
+ p.pinmux +=
fmt(cell[i + 2])
p.pinmux += ";\n"
# ======================================================== #
p.pinmux += ";\n"
# ======================================================== #