fix(iomux): Fix port signal length (given mux size non-power of 2) master
authorAndrey Miroshnikov <andrey@technepisteme.xyz>
Tue, 18 Oct 2022 12:38:53 +0000 (12:38 +0000)
committerAndrey Miroshnikov <andrey@technepisteme.xyz>
Tue, 18 Oct 2022 12:38:53 +0000 (12:38 +0000)
src/spec/iomux.py

index 90a7158c58cb7bcdcda1152827489558a9899aee..0351fbe064d0687bb9cc2adeb9dd6a4cc7ea65ec 100644 (file)
@@ -38,7 +38,8 @@ class IOMuxBlockSingle(Elaboratable):
     def __init__(self, n_ports=4):
         print("1-bit IO Mux Block")
         self.n_ports = n_ports
-        self.port = Signal(log2_int(self.n_ports))
+        portsize = n_ports.bit_length()
+        self.port = Signal(portsize)
 
         temp = []
         for i in range(self.n_ports):