adding a sample test where certain IOs have differing number of muxes
[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 = 4
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
23 # check if the user has not screwed up by ensuring that no pin is
24 # present in both muxed and dedicated pins
25 # TODO
26
27 # =========================================== #
28 N_IO = len(dedicated_cells) + len(muxed_cells)
29 print("Max number of IO: " + str(N_IO))
30 print("Muxed IOs: " + str(len(muxed_cells)))
31 print("Dedicated IOs: " + str(len(dedicated_cells)))
32 # ============================================ #