temp = temp.replace(' ', '')
x = dictionary.get(temp)
assert x is not None, "ERROR: The signal : " + \
- str(cell[i + 1]) + \
- " of pinmap.txt isn't present \nin the current" + \
- " dictionary. Update dictionary or fix-typo."
+ str(cell[i + 1]) + \
+ " of pinmap.txt isn't present \nin the current" + \
+ " dictionary. Update dictionary or fix-typo."
if x == "input":
p.pinmux += \
mux_wire.format(cell[0], i, "wr" + cell[i + 1]) + "\n"
self.pinnumbers = sorted(self.pinnumbers)
self.upper_offset = self.lower_offset + \
- int(math.log(len(self.muxed_cells), 2))
+ int(math.log(len(self.muxed_cells), 2))
if verify:
self.do_checks()
# TODO
+
if __name__ == '__main__':
p = Parse()
print p.N_IO
endpackage
'''
+
def pinmuxgen(pth=None, verify=True):
""" populating the file with the code
"""
// where each IO will have the same number of muxes.''')
for cell in p.muxed_cells:
- bsv_file.write(mux_interface.ifacefmt(cell[0],
- int(math.log(len(cell) - 1, 2))))
+ cnum = int(math.log(len(cell) - 1, 2))
+ bsv_file.write(mux_interface.ifacefmt(cell[0], cnum))
bsv_file.write('''
endinterface
bsv_file.write(axi4_lite.format(p.ADDR_WIDTH, p.DATA_WIDTH))
# ##################################################
+
def printhelp():
print ('''pinmux_generator.py [-o outputdir] [-v|--validate] [-h|--help]
-o outputdir : defaults to bsv_src. also location for reading pinmux.txt
-h | --help : this help message
''')
+
if __name__ == '__main__':
try:
options, remainder = getopt.getopt(
sys.exit(0)
pinmuxgen(output_dir, validate)
-