From: Luke Kenneth Casson Leighton Date: Fri, 23 Mar 2018 05:20:20 +0000 (+0000) Subject: slight logic change which seems to work on generating mux selector X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21f3199841e1037827cca55993afc6e33dc22d84;p=pinmux.git slight logic change which seems to work on generating mux selector --- 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" # ======================================================== #