From 42dfe24d4b90eea0fffa56623aaab0881dfb89a4 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 25 Jun 2018 09:12:57 +0100 Subject: [PATCH] clarify out-mux formatting --- src/bsv/actual_pinmux.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/bsv/actual_pinmux.py b/src/bsv/actual_pinmux.py index a920db6..57f2835 100644 --- a/src/bsv/actual_pinmux.py +++ b/src/bsv/actual_pinmux.py @@ -49,16 +49,25 @@ def init(p, ifaces): """ generates the actual output pinmux for each io-cell. blank lines need to output "0" to the iopad, if there is no entry in that column. + + text is outputted in the format: + x_out = + muxer_sel==0 ? a : + muxer_sel==1 ? b : + muxer_sel==2 ? 0 : + d + + last line doesn't need selector-logic, obviously. """ p.pinmux = ' ' global dedicated_wire + fmtstr = "wr%s == %d ? %s :\n\t\t\t" # mux-selector format for cell in p.muxed_cells: p.pinmux += " // output muxer for cell idx %s\n" % cell[0] - p.pinmux += " %s_out=" % cn(cell[0]) + p.pinmux += " %s_out=\n" % cn(cell[0]) for i in range(0, len(cell) - 2): - p.pinmux += "wr%s" % cn(cell[0]) + \ - "==" + str(i) + "?" + fmt(cell[i + 1]) + ":\n\t\t\t" - p.pinmux += fmt(cell[i + 2]) + p.pinmux += fmtstr % (cn(cell[0]), i, fmt(cell[i + 1])) + p.pinmux += fmt(cell[i + 2]) # last line p.pinmux += ";\n" # ======================================================== # -- 2.30.2