2626
2727import sys
2828
29+
2930def usage ():
30- print ("Usage: ./probes name width probenum" )
31+ print ("Usage: ./probes name width probenum" )
3132
3233def header ():
33- return """create_debug_core u_ila_0 ila
34+ return """create_debug_core u_ila_0 ila
3435
3536set_property C_DATA_DEPTH 16384 [get_debug_cores u_ila_0]
3637set_property C_TRIGIN_EN false [get_debug_cores u_ila_0]
@@ -49,49 +50,47 @@ endgroup
4950connect_debug_port u_ila_0/clk [get_nets [list xlnx_ddr4_c0/inst/u_ddr4_infrastructure/addn_ui_clkout1 ]]"""
5051
5152def convertLine (x ):
52- temp = x .split ()
53- temp [1 ] = int (temp [1 ])
54- return tuple (temp )
53+ temp = x .split ()
54+ temp [1 ] = int (temp [1 ])
55+ return tuple (temp )
5556
5657def probeBits ( probe ):
57- str = ''
58+ string = ''
5859
59- if (probe [1 ] > 1 ):
60- for i in range (probe [1 ]):
61- if i != (probe [1 ]- 1 ):
62- str = str + f"{{{ probe [0 ]} [{ i } ]}} "
63- else :
64- str = str + f"{{{ probe [0 ]} [{ i } ]}} "
60+ if (probe [1 ] > 1 ):
61+ for i in range (probe [1 ]):
62+ if i != (probe [1 ]- 1 ):
63+ string = string + f"{{{ probe [0 ]} [{ i } ]}} "
64+ else :
65+ string = string + f"{{{ probe [0 ]} [{ i } ]}} "
6566
66- else :
67- str = f'{{{ probe [0 ]} }}'
67+ else :
68+ string = f'{{{ probe [0 ]} }}'
6869
69- return str
70+ return string
7071
7172def printProbe ( probe , i ):
72- bits = probeBits (probe )
73+ bits = probeBits (probe )
7374
74- return (
75- f'create_debug_port u_ila_0 probe\n '
76- f'set_property port_width { probe [1 ]} [get_debug_ports u_ila_0/probe{ i } ]\n '
77- f'set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe{ i } ]\n '
78- f'connect_debug_port u_ila_0/probe{ i } [get_nets [list { bits } ]]\n \n '
79- )
75+ return (
76+ f'create_debug_port u_ila_0 probe\n '
77+ f'set_property port_width { probe [1 ]} [get_debug_ports u_ila_0/probe{ i } ]\n '
78+ f'set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe{ i } ]\n '
79+ f'connect_debug_port u_ila_0/probe{ i } [get_nets [list { bits } ]]\n \n '
80+ )
8081
8182def main (args ):
82- if (len (args ) != 3 ):
83- usage ()
83+ if (len (args ) != 3 ):
84+ usage ()
8485
85- name = args [0 ]
86- width = int (args [1 ])
87- probeNum = int (args [2 ])
86+ name = args [0 ]
87+ width = int (args [1 ])
88+ probeNum = int (args [2 ])
8889
8990
90- probe = (name , width )
91+ probe = (name , width )
9192
92- print (printProbe (probe , probeNum ))
93+ print (printProbe (probe , probeNum ))
9394
9495if __name__ == '__main__' :
95- main (sys .argv [1 :])
96-
97-
96+ main (sys .argv [1 :])
0 commit comments