adding synthesize attribute to the module and a print statement for pinmux generation.
[pinmux.git] / src / pinmux_generator.py
index fed54eacecd1042bd96a3306b715938d821bc04a..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,10 +127,21 @@ 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 ==#######################
+bsv_file.write('''
+               /*================= This where the muxing starts for each io-cell=================*/ 
+''')
 bsv_file.write(pinmux);
+bsv_file.write('''
+               /*================================================================================*/ 
+''')
 ######################################################################
 ################=== interface definitions for each method ===###########
 for i in range(0,N_IO):
@@ -135,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")
 ########################################################################