Skip to content

Commit ef06ce9

Browse files
authored
Merge pull request #428 from os-fpga/EDA-3187-add-setup-lec-sim
Eda 3187 add setup lec sim
2 parents 064093b + 7e6dbdf commit ef06ce9

File tree

5 files changed

+58
-16
lines changed

5 files changed

+58
-16
lines changed

RTL_testcases/RS_FPGA_PRIMITIVES_new/carry_chain_primitive_inst/raptor_run.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ip_name="" #design_level
1010
tool_name="iverilog"
1111

1212
#simulation stages
13-
post_synth_sim=false
13+
post_synth_sim=true
1414
post_route_sim=true
1515
bitstream_sim=false
1616

@@ -259,6 +259,10 @@ parse_cga exit 1; }
259259
else
260260
echo ""
261261
fi
262+
echo "clear_simulation_files">>raptor_tcl.tcl
263+
echo "setup_lec_sim 10 2">>raptor_tcl.tcl
264+
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
265+
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
262266
echo "sta">>raptor_tcl.tcl
263267
echo "power">>raptor_tcl.tcl
264268
echo "bitstream $bitstream">>raptor_tcl.tcl

RTL_testcases/RTL_Benchmarks_Gap_Analysis/ca_prng/raptor_run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ parse_cga exit 1; }
258258
else
259259
echo ""
260260
fi
261+
echo "setup_lec_sim">>raptor_tcl.tcl
262+
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
263+
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
261264
echo "sta">>raptor_tcl.tcl
262265
echo "power">>raptor_tcl.tcl
263266
echo "bitstream $bitstream">>raptor_tcl.tcl

RTL_testcases/RTL_Benchmarks_Gap_Analysis/can/raptor_run.sh

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ ip_name="" #design_level
1010
tool_name="iverilog"
1111

1212
#simulation stages
13-
post_synth_sim=true
14-
post_route_sim=true
13+
post_synth_sim=false
14+
post_route_sim=false
1515
bitstream_sim=false
1616

1717
#raptor options
@@ -203,20 +203,35 @@ parse_cga exit 1; }
203203

204204
##vary design to design
205205
[ -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
206213

207214
echo "analyze">>raptor_tcl.tcl
208215
[ -z "$verific_parser" ] && echo "" || echo "verific_parser $verific_parser">>raptor_tcl.tcl
209216
[ -z "$synthesis_type" ] && echo "" || echo "synthesis_type $synthesis_type">>raptor_tcl.tcl
210217
[ -z "$custom_synth_script" ] && echo "" || echo "custom_synth_script $custom_synth_script">>raptor_tcl.tcl
211218
[ -z "$synth_options" ] && echo "" || echo "synth_options $synth_options">>raptor_tcl.tcl
212219
[ -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
219220
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
220235
[ "$tool_name" = "iverilog" ] && echo "simulation_options compilation icarus gate" >> raptor_tcl.tcl || echo "simulation_options compilation verilator gate" >> raptor_tcl.tcl
221236
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
222237
else
@@ -235,11 +250,28 @@ parse_cga exit 1; }
235250
echo "place">>raptor_tcl.tcl
236251
echo "route">>raptor_tcl.tcl
237252
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
239268
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
240269
else
241270
echo ""
242271
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
243275
echo "sta">>raptor_tcl.tcl
244276
echo "power">>raptor_tcl.tcl
245277
echo "bitstream $bitstream">>raptor_tcl.tcl

RTL_testcases/RTL_Benchmarks_Gap_Analysis/cf_fft_256_8/raptor_run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ parse_cga exit 1; }
205205
[ -z "$custom_synth_script" ] && echo "" || echo "custom_synth_script $custom_synth_script">>raptor_tcl.tcl
206206
[ -z "$synth_options" ] && echo "" || echo "synth_options $synth_options">>raptor_tcl.tcl
207207
[ -z "$strategy" ] && echo "" || echo "synthesize $strategy">>raptor_tcl.tcl
208+
echo "setup_lec_sim">>raptor_tcl.tcl
209+
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
208210
if [ "$post_synth_sim" == true ]; then
209211
echo "# Open the input file in read mode">>raptor_tcl.tcl
210212
echo "set input_file [open \"$design/run_1/synth_1_1/synthesis/$design\_post_synth.v\" r]">>raptor_tcl.tcl
@@ -258,6 +260,7 @@ parse_cga exit 1; }
258260
else
259261
echo ""
260262
fi
263+
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
261264
echo "sta">>raptor_tcl.tcl
262265
echo "power">>raptor_tcl.tcl
263266
echo "bitstream $bitstream">>raptor_tcl.tcl

RTL_testcases/RTL_Benchmarks_Gap_Analysis/cf_fft_256_8/rtl/cf_fft_256_8.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,22 +1123,22 @@ reg n1960;
11231123
reg n1964;
11241124
reg [5:0] n1970;
11251125
reg n1977;
1126-
reg n1982;
1126+
reg n1982 = 0;
11271127
wire [31:0] n1993;
11281128
reg [5:0] n1993ra;
1129-
reg [31:0] n1993m ;
1129+
reg [31:0] n1993m = 0;
11301130
wire [31:0] n1997;
11311131
reg [5:0] n1997ra;
1132-
reg [31:0] n1997m ;
1133-
reg n2001;
1132+
reg [31:0] n1997m = 0;
1133+
reg n2001 = 0;
11341134
reg [5:0] n2007;
11351135
reg n2014;
11361136
wire [31:0] n2030;
11371137
reg [5:0] n2030ra;
1138-
reg [31:0] n2030m ;
1138+
reg [31:0] n2030m = 0;
11391139
wire [31:0] n2034;
11401140
reg [5:0] n2034ra;
1141-
reg [31:0] n2034m ;
1141+
reg [31:0] n2034m = 0;
11421142
reg n2038;
11431143
reg n2047;
11441144
assign n4 = 7'b0000001;

0 commit comments

Comments
 (0)