digits = maketrans('0123456789', ' ' * 10) # delete space later
-def get_cell_bit_width(p):
- max_num_cells = 0
- for cell in p.muxed_cells:
- max_num_cells = max(len(cell) - 1, max_num_cells)
- return int(math.log(max_num_cells + 1, 2))
-
-
def cn(idx): # idx is an integer
return "cell%s_mux" % str(idx)
the last one, and we do not want the "default" (last line)
to be the output.
"""
- p.cell_bitwidth = get_cell_bit_width(p)
p.pinmux = ' '
global dedicated_wire
for cell in p.muxed_cells:
if verify:
self.do_checks()
+ self.cell_bitwidth = self.get_cell_bit_width()
+
# == user info after parsing ================= #
self.N_IO = len(self.dedicated_cells) + len(self.muxed_cells)
print("Max number of IO: " + str(self.N_IO))
+ print("Muxer bit width: " + str(self.cell_bitwidth))
print("Muxed IOs: " + str(len(self.muxed_cells)))
print("Dedicated IOs: " + str(len(self.dedicated_cells)))
# TODO
+ def get_cell_bit_width(self):
+ max_num_cells = 0
+ for cell in self.muxed_cells:
+ max_num_cells = max(len(cell) - 1, max_num_cells)
+ return int(math.log(max_num_cells + 1, 2))
+
+
if __name__ == '__main__':
p = Parse()