@@ -10,8 +10,8 @@ ip_name="" #design_level
10
10
tool_name=" iverilog"
11
11
12
12
# simulation stages
13
- post_synth_sim=true
14
- post_route_sim=true
13
+ post_synth_sim=false
14
+ post_route_sim=false
15
15
bitstream_sim=false
16
16
17
17
# raptor options
@@ -203,20 +203,35 @@ parse_cga exit 1; }
203
203
204
204
# #vary design to design
205
205
[ -z " $add_constraint_file " ] && echo " " || echo " add_constraint_file $add_constraint_file " >> raptor_tcl.tcl
206
+
207
+ if [ " $post_synth_sim " == true ] || [ " $post_route_sim " == true ] || [ " $bitstream_sim " == true ]; then
208
+ echo " add_simulation_file ./sim/co_sim_tb/co_sim_$design .v ./rtl/$design .v" >> raptor_tcl.tcl
209
+ echo " set_top_testbench co_sim_$design " >> raptor_tcl.tcl
210
+ else
211
+ echo " "
212
+ fi
206
213
207
214
echo " analyze" >> raptor_tcl.tcl
208
215
[ -z " $verific_parser " ] && echo " " || echo " verific_parser $verific_parser " >> raptor_tcl.tcl
209
216
[ -z " $synthesis_type " ] && echo " " || echo " synthesis_type $synthesis_type " >> raptor_tcl.tcl
210
217
[ -z " $custom_synth_script " ] && echo " " || echo " custom_synth_script $custom_synth_script " >> raptor_tcl.tcl
211
218
[ -z " $synth_options " ] && echo " " || echo " synth_options $synth_options " >> raptor_tcl.tcl
212
219
[ -z " $strategy " ] && echo " " || echo " synthesize $strategy " >> raptor_tcl.tcl
213
-
214
- if [ " $post_synth_sim " == true ] || [ " $post_route_sim " == true ] || [ " $bitstream_sim " == true ]; then
215
- echo " setup_lec_sim 2 2" >> raptor_tcl.tcl
216
- else
217
- echo " "
218
- fi
219
220
if [ " $post_synth_sim " == true ]; then
221
+ echo " # Open the input file in read mode" >> raptor_tcl.tcl
222
+ echo " set input_file [open \" $design /run_1/synth_1_1/synthesis/$design \_post_synth.v\" r]" >> raptor_tcl.tcl
223
+ echo " # Read the file content" >> raptor_tcl.tcl
224
+ echo " set file_content [read \$ input_file]" >> raptor_tcl.tcl
225
+ echo " # Close the input file after reading" >> raptor_tcl.tcl
226
+ echo " close \$ input_file" >> raptor_tcl.tcl
227
+ echo " set modified_content [string map {\" $design (\" \" ${design} _post_synth(\" } \$ file_content]" >> raptor_tcl.tcl
228
+ echo " # Open the file again, this time in write mode to overwrite the old content" >> raptor_tcl.tcl
229
+ echo " set output_file [open \" $design /run_1/synth_1_1/synthesis/$design \_post_synth.v\" w]" >> raptor_tcl.tcl
230
+ echo " # Write the modified content back to the file" >> raptor_tcl.tcl
231
+ echo " puts \$ output_file \$ modified_content" >> raptor_tcl.tcl
232
+ echo " # Close the file" >> raptor_tcl.tcl
233
+ echo " close \$ output_file" >> raptor_tcl.tcl
234
+ echo " puts \" Modification completed.\" " >> raptor_tcl.tcl
220
235
[ " $tool_name " = " iverilog" ] && echo " simulation_options compilation icarus gate" >> raptor_tcl.tcl || echo " simulation_options compilation verilator gate" >> raptor_tcl.tcl
221
236
[ " $tool_name " = " iverilog" ] && echo " simulate gate icarus" >> raptor_tcl.tcl || echo " simulate gate verilator" >> raptor_tcl.tcl
222
237
else
@@ -235,11 +250,28 @@ parse_cga exit 1; }
235
250
echo " place" >> raptor_tcl.tcl
236
251
echo " route" >> raptor_tcl.tcl
237
252
if [ " $post_route_sim " == true ]; then
238
- [ " $tool_name " = " iverilog" ] && echo " simulation_options compilation icarus pnr" >> raptor_tcl.tcl || echo " simulation_options compilation verilator pnr" >> raptor_tcl.tcl
253
+ echo " # Open the input file in read mode" >> raptor_tcl.tcl
254
+ echo " set input_file [open \" $design /run_1/synth_1_1/synthesis/post_pnr_wrapper_$design \_post_synth.v\" r]" >> raptor_tcl.tcl
255
+ echo " # Read the file content" >> raptor_tcl.tcl
256
+ echo " set file_content [read \$ input_file]" >> raptor_tcl.tcl
257
+ echo " # Close the input file after reading" >> raptor_tcl.tcl
258
+ echo " close \$ input_file" >> raptor_tcl.tcl
259
+ echo " set modified_content [string map {\" module $design (\" \" module ${design} _post_route (\" } \$ file_content]" >> raptor_tcl.tcl
260
+ echo " # Open the file again, this time in write mode to overwrite the old content" >> raptor_tcl.tcl
261
+ echo " set output_file [open \" $design /run_1/synth_1_1/synthesis/post_pnr_wrapper_$design \_post_synth.v\" w]" >> raptor_tcl.tcl
262
+ echo " # Write the modified content back to the file" >> raptor_tcl.tcl
263
+ echo " puts \$ output_file \$ modified_content" >> raptor_tcl.tcl
264
+ echo " # Close the file" >> raptor_tcl.tcl
265
+ echo " close \$ output_file" >> raptor_tcl.tcl
266
+ echo " puts \" Modification completed.\" " >> raptor_tcl.tcl
267
+ [ " $tool_name " = " iverilog" ] && echo " simulation_options compilation icarus -DPNR=1 pnr" >> raptor_tcl.tcl || echo " simulation_options compilation verilator -DPNR=1 pnr" >> raptor_tcl.tcl
239
268
[ " $tool_name " = " iverilog" ] && echo " simulate pnr icarus" >> raptor_tcl.tcl || echo " simulate pnr verilator" >> raptor_tcl.tcl
240
269
else
241
270
echo " "
242
271
fi
272
+ echo " setup_lec_sim" >> raptor_tcl.tcl
273
+ [ " $tool_name " = " iverilog" ] && echo " simulate gate icarus" >> raptor_tcl.tcl || echo " simulate gate verilator" >> raptor_tcl.tcl
274
+ [ " $tool_name " = " iverilog" ] && echo " simulate pnr icarus" >> raptor_tcl.tcl || echo " simulate pnr verilator" >> raptor_tcl.tcl
243
275
echo " sta" >> raptor_tcl.tcl
244
276
echo " power" >> raptor_tcl.tcl
245
277
echo " bitstream $bitstream " >> raptor_tcl.tcl
0 commit comments