From 21f3199841e1037827cca55993afc6e33dc22d84 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 23 Mar 2018 05:20:20 +0000 Subject: [PATCH] slight logic change which seems to work on generating mux selector --- src/actual_pinmux.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/actual_pinmux.py b/src/actual_pinmux.py index e5aa499..82a0ef2 100644 --- a/src/actual_pinmux.py +++ b/src/actual_pinmux.py @@ -49,15 +49,10 @@ def init(p): global dedicated_wire for cell in p.muxed_cells: p.pinmux += " %s_out=" % cn(cell[0]) - i = 0 - while (i < len(cell) - 1): + 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" - if i + 2 == len(cell) - 1: - p.pinmux += cell[i + 2] + "_io" - i = i + 2 - else: - i = i + 1 + p.pinmux += cell[i + 2] + "_io" p.pinmux += ";\n" # ======================================================== # -- 2.30.2