maintaining distinct arrays for muxed and dedicated cells
[pinmux.git] / src / params.py
1 # == Parameters == #
2 N_MUX = 1 # number of selection lines for the mux per io
3 N_IO = 0
4 N_MUX_IO = 0
5 N_UART = 2
6 N_SPI = 1
7 N_TWI = 2
8 # ================ #
9 # == capture the number of IO cells required == #
10 pinmapfile = open('pinmap.txt', 'r')
11 max_io = 0
12 muxed_cells = []
13 dedicated_cells = []
14 for lineno, line in enumerate(pinmapfile):
15 line1 = line.split()
16 if(len(line1) > 1):
17 if(len(line1) == 2): # dedicated
18 dedicated_cells.append(line1)
19 if(len(line1) > 2):
20 muxed_cells.append(line1)
21
22 N_IO = len(dedicated_cells) + len(muxed_cells)
23 print("Max number of IO: " + str(N_IO))
24 print("Muxed IOs: " + str(len(muxed_cells)))
25 print("Dedicated IOs: " + str(len(dedicated_cells)))
26 # ============================================ #