X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fparse.py;h=b2e017ab2dd54e2c75ea6960fc756a7ed2c6c1cc;hb=0e07cd1c35e098cac02d0278ed18f1e3d8090352;hp=2dffeb33b75974257d62c7cd414de90426942428;hpb=0179d35e50fdba6b9a0c9bb3a77dfea16773d3e0;p=pinmux.git diff --git a/src/parse.py b/src/parse.py index 2dffeb3..b2e017a 100644 --- a/src/parse.py +++ b/src/parse.py @@ -122,6 +122,12 @@ class Parse(object): def get_muxwidth(self, cellnum): return self.muxed_cells_width[int(cellnum)] + def get_muxbitwidth(self, cellnum): + wid = self.get_muxwidth(cellnum) + if wid == 1: + return 0 + return int(math.log(wid + 1, 2)) + if __name__ == '__main__': p = Parse()