blob: b0e4506ec7ece4c04cc8dd48a154d26a1fddc50b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<%def name="num_ports_str(direction)">\
<%
# Generate a string for the number of input or output CHDR ports. This takes
# into account any parameters that affect the number of ports. The direction
# argument should be the string 'inputs' or 'outputs'.
num_ports_cnt = 0
num_ports_str = ''
for port_name, port_info in config['data'][direction].items():
if 'num_ports' in port_info:
if str(port_info['num_ports']).isdecimal():
num_ports_cnt = num_ports_cnt + int(port_info['num_ports'])
else:
num_ports_str = num_ports_str + '+' + str(port_info['num_ports'])
else:
num_ports_cnt = num_ports_cnt + 1
num_ports_str = str(num_ports_cnt) + num_ports_str
%>\
${num_ports_str}\
</%def>
<%def name="num_ports_in_str()">\
## Generate a string for the number of input CHDR ports. This takes into
## account any parameters that affect the number of ports.
${num_ports_str('inputs')}\
</%def>
<%def name="num_ports_out_str()">\
## Generate a string for the number of output CHDR ports. This takes into
## account any parameters that affect the number of ports.
${num_ports_str('outputs')}\
</%def>
|