adding synthesize attribute to the module and a print statement for pinmux generation.
[pinmux.git] / src / pinmux_generator.py
index e4a2176146c4958207b54dc712e28ac97b151ecf..8041b6c0bce6b95f0c4b4abcf1be305492409c5e 100644 (file)
@@ -90,11 +90,17 @@ for i in range(0,N_SPI):
        bsv_file.write('''
                // interface declaration between SPI-{0} and pinmux'''.format(i))
        bsv_file.write(spiinterface_decl.format(i));
+
+for i in range(0,N_TWI):
+       bsv_file.write('''
+               // interface declaration between TWI-{0} and pinmux'''.format(i))
+       bsv_file.write(twiinterface_decl.format(i));
 ################################################################
 
 ####=== finish interface definition and start module definition===####
 bsv_file.write('''
        endinterface
+       (*synthesize*)
        module mkpinmux(Ifc_pinmux);
 ''')                                   
 ######################################################################
@@ -121,6 +127,11 @@ for i in range(0,N_SPI):
        bsv_file.write('''\n            // following wires capture the parameters to the IO CELL if spi-{0} is 
                // allotted to it'''.format(i))
        bsv_file.write(spiwires.format(i))
+
+for i in range(0,N_TWI):
+       bsv_file.write('''\n            // following wires capture the parameters to the IO CELL if twi-{0} is 
+               // allotted to it'''.format(i))
+       bsv_file.write(twiwires.format(i))
 bsv_file.write("\n")
 ######################################################################
 #########################== Actual pinmuxing ==#######################
@@ -141,5 +152,8 @@ for i in range(0,N_UART):
        bsv_file.write(uartinterface_def.format(i))
 for i in range(0,N_SPI):
        bsv_file.write(spiinterface_def.format(i))
+for i in range(0,N_TWI):
+       bsv_file.write(twiinterface_def.format(i))
 bsv_file.write(footer)
+print("BSV file successfully generated: bsv_src/pinmux.bsv")
 ########################################################################