generate_syn_runs.tcl 6.21 KB
Newer Older
1
2
proc create_run {I O D {run 1} opt} {
    puts "Creating run with I = $I, O = $O, D = $D"
Marcos Vinicius Silva Oliveira's avatar
Marcos Vinicius Silva Oliveira committed
3
    set prjpre [format "I%03d_O%03d_D%03d_SHORTSR" $I $O $D]
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    set prjname [format "%s-%s" $prjpre $opt]
    set basepath "D:/mygitlab/sorting"
    set prjpath [format "%s/syn/%s/wrapper_%s.prj" $basepath $prjname $prjname]
    set subprjpath [format "%s/syn/%s/muon_sorter_1/muon_sorter_%s.prj" $basepath $prjname $prjname]
    puts $prjpath
    puts $subprjpath
    project -new $prjpath
    add_file -vhdl ${basepath}/src/rtl/MuctpiDataTypes.vhd
    add_file -vhdl ${basepath}/src/rtl/MuctpiFunctions.vhd
    add_file -verilog ${basepath}/src/rtl/lfsr.sv
    add_file -vhdl ${basepath}/src/rtl/muon_sorter.vhd
    add_file -verilog ${basepath}/src/rtl/reducer.sv
    add_file -vhdl ${basepath}/src/rtl/shift_reg_tap.vhd
    add_file -vhdl ${basepath}/src/rtl/wrapper.vhd    
    set_option -disable_io_insertion 0
    set_option -part XCVU9P
    set_option -package FLGC2104
    set_option -vhdl2008 1
    set_option -retiming 0
    switch $opt {
	freq160retfan10000 {
	    set_option -frequency 160
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_160.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
	}
	freq160retfan16 {
	    set_option -frequency 160
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_160.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
	}
	freq80retfan10000 {
	    set_option -frequency 80
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_80.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
	}
	freq80retfan16 {
	    set_option -frequency 80
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_80.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
	}
	freq320retfan10000 {
	    set_option -frequency 320
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_320.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
	}
	freq320retfan16 {
	    set_option -frequency 320
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_320.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
59
60
61
62
63
64
65
66
67
68
69
70
	}
	freq40retfan10000 {
	    set_option -frequency 40
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_40.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
	}
	freq40retfan16 {
	    set_option -frequency 40
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_40.sdc
		add_file -constraint ${basepath}/src/xdc/wrapper.sdc
71
72
73
74
75
76
77
78
79
80
81
82
	}	
	default {
	    puts "Invalid opt option!"
	}
    }
    hdl_param -set I $I
    hdl_param -set O $O
    hdl_param -set delay $D
    project -save $prjpath
    project -run compile
    cd ${basepath}/syn
    export_project -instance muon_sorter_1 -add_file {../src/rtl/MuctpiDataTypes.vhd ../src/rtl/MuctpiFunctions.vhd ../src/rtl/muon_sorter.vhd} -no_default_hdl -project $subprjpath
83

84
    project_data -active $subprjpath
85

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
    set_option -disable_io_insertion 1
    set_option -part XCVU9P
    set_option -package FLGC2104
    set_option -vhdl2008 1   
    hdl_param -set num_in $I
    hdl_param -set num_out $O
    hdl_param -set delay $D
    set_option -job pr_1 -add par
    set_option -job pr_1 -option enable_run 0
    switch $opt {
	freq160retfan10000 {
	    set_option -retiming 1
	    set_option -frequency 160
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_160.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
	}
	freq160retfan16 {
	    set_option -retiming 1
	    set_option -frequency 160
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_160.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
	}
	freq80retfan10000 {
	    set_option -retiming 1
	    set_option -frequency 80
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_80.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
	}
	freq80retfan16 {
	    set_option -retiming 1
	    set_option -frequency 80
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_80.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
	}	
124
	freq320retfan10000 {
125
126
127
128
129
130
131
132
133
134
135
136
	    set_option -retiming 1
	    set_option -frequency 320
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_320.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
	}
	freq320retfan16 {
	    set_option -retiming 1
	    set_option -frequency 320
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_320.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
137
138
139
140
141
142
143
144
145
146
147
148
149
150
	}
	freq40retfan10000 {
	    set_option -retiming 1
	    set_option -frequency 40
	    set_option -fanout_limit 10000
		add_file -constraint ${basepath}/src/xdc/clock_40.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
	}
	freq40retfan16 {
	    set_option -retiming 1
	    set_option -frequency 40
	    set_option -fanout_limit 16
		add_file -constraint ${basepath}/src/xdc/clock_40.sdc
		add_file -constraint ${basepath}/src/xdc/muon_sorter.sdc
151
152
153
154
155
	}	
	default {
	    puts "Invalid opt option!"
	}
    }
156

157
158
    
    project -save $subprjpath
159

160
161
162
163
164
    project_data -active $prjpath
    set_option -job par_1 -option enable_run 1
    #impl -active rev_1
    if {$run == 1} {project -run}  
    project -save $prjpath
165
166
167
168
}


proc range {from to {step 1}} {
169
    set res $from; while {$to>$from} {lappend res [incr from $step]}; return $res
170
}
171

172
set cfgs []
Marcos Vinicius Silva Oliveira's avatar
Marcos Vinicius Silva Oliveira committed
173
set opts [list freq320retfan10000 freq160retfan10000 freq80retfan10000 freq80retfan16 freq40retfan10000 freq40retfan16]
174
#lappend cfgs [list 16 16 [range 0 2]]
175
#lappend cfgs [list 16 2 [range 0 2]]
176
177
178
lappend cfgs [list 16 16 [range 0 3]]
#lappend cfgs [list 32 16 [range 0 5]]
#lappend cfgs [list 32 4 [range 0 5]]
179
#lappend cfgs [list 48 16 [range 0 8]]
180
181
182
#lappend cfgs [list 64 16 [range 0 10]]

foreach cfg $cfgs {
183
    foreach {I O Dr} $cfg {
184
		foreach {D} $Dr {
185
186
187
188
			foreach opt $opts {
				puts "$I $O $D"
				create_run $I $O $D 1 $opt
			}
189
		}
190
191
    }
}