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);
''')
######################################################################
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(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")
########################################################################