diff --git a/Makefile b/Makefile index f8bdb293e..3ea17ee2b 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ test/gui: run-cmake-debug $(XVFB) ./dbuild/bin/foedag --script tests/TestGui/compiler_flow/compiler_flow.tcl $(XVFB) ./dbuild/bin/foedag --script tests/TestGui/run_project_test/run_project.tcl $(XVFB) ./dbuild/bin/foedag --compiler openfpga --replay tests/TestGui/run_project_test/run_project.tcl && exit 1 || (echo "PASSED: Caught negative test") - $(XVFB) ./dbuild/bin/foedag --script tests/TestGui/compiler_flow_with_clean.tcl + $(XVFB) ./dbuild/bin/foedag --script tests/TestGui/compiler_flow_with_clean/compiler_flow_with_clean.tcl $(XVFB) ./dbuild/bin/console_test --replay tests/TestGui/gui_console.tcl $(XVFB) ./dbuild/bin/console_test --replay tests/TestGui/gui_console_negative_test.tcl && exit 1 || (echo "PASSED: Caught negative test") $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/gui_start_stop.tcl @@ -165,7 +165,7 @@ test/gui: run-cmake-debug $(XVFB) ./dbuild/bin/newfile --replay tests/TestGui/gui_new_file.tcl $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/gui_foedag.tcl $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/gui_foedag_negative_test.tcl && exit 1 || (echo "PASSED: Caught negative test") - $(XVFB) ./dbuild/bin/designruns --replay tests/TestGui/design_runs.tcl + $(XVFB) ./dbuild/bin/designruns --replay tests/TestGui/design_runs/design_runs.tcl $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/gui_task_dlg.tcl $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/gui_top_settings_dlg.tcl $(XVFB) ./dbuild/bin/ipconfigurator --replay tests/TestGui/gui_ipconfigurator.tcl @@ -173,7 +173,7 @@ test/gui: run-cmake-debug $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/tcl_init_file_load_pt1.tcl $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/tcl_init_file_load_pt2.tcl $(XVFB) ./dbuild/bin/foedag --script tests/TestGui/gtkwave_invoke.tcl || (cat foedag.log; exit 1) - #$(XVFB) ./dbuild/bin/foedag --script tests/TestGui/gtkwave_cmds.tcl || (cat foedag.log; exit 1) + #$(XVFB) ./dbuild/bin/foedag --script tests/TestGui/gtkwave_cmds/gtkwave_cmds.tcl || (cat foedag.log; exit 1) $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/gtkwave_open_bad_path.tcl && exit 1 || (echo "PASSED: Caught negative test") $(XVFB) ./dbuild/bin/foedag --replay tests/TestGui/log_header.tcl $(XVFB) ./dbuild/bin/programmer-gui_test --replay tests/TestGui/programmer_gui.tcl diff --git a/tests/TestGui/compiler_flow_with_clean/CGA_Result_default.json b/tests/TestGui/compiler_flow_with_clean/CGA_Result_default.json new file mode 100644 index 000000000..81a65be51 --- /dev/null +++ b/tests/TestGui/compiler_flow_with_clean/CGA_Result_default.json @@ -0,0 +1,21 @@ +{ + "strategy": "delay", + "total_runtime": null, + "synthesis_runtime": null, + "packing_runtime": null, + "placement_runtime": null, + "routing_runtime": null, + "time_analysis_runtime": null, + "bitstream_runtime": null, + "reg_id": "23", + "device": "GEMINI_COMPACT_104x68", + "version": null, + "git_hash": null, + "built": null, + "built_type": null, + "status": "Fail", + "error_msg": "No log generated", + "post_synth_sim_status": null, + "failure_type": null, + "fmax_clock1": null +} \ No newline at end of file diff --git a/tests/TestGui/compiler_flow_with_clean.tcl b/tests/TestGui/compiler_flow_with_clean/compiler_flow_with_clean.tcl similarity index 100% rename from tests/TestGui/compiler_flow_with_clean.tcl rename to tests/TestGui/compiler_flow_with_clean/compiler_flow_with_clean.tcl diff --git a/tests/TestGui/compiler_flow_with_clean/raptor_run.sh b/tests/TestGui/compiler_flow_with_clean/raptor_run.sh new file mode 100755 index 000000000..ba4a6427b --- /dev/null +++ b/tests/TestGui/compiler_flow_with_clean/raptor_run.sh @@ -0,0 +1,119 @@ +#!/bin/bash +set -e +# XVFB='xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24"' +main_path=$PWD +start=`date +%s` + + +function end_time(){ + end=`date +%s` + runtime=$((end-start)) + echo -e "\nTotal RunTime to run raptor_run.sh: $runtime">>results.log + echo "Peak Memory Usage: 117360">>results.log + echo "ExecEndTime: $end">>results.log + raptor --version>>results.log +} + +function parse_cga(){ + cd $main_path + tail -n100 ./results_dir/raptor.log > ./results_dir/raptor_tail.log + timeout 15m python3 ../../../../../parser.py ./results_dir/results.log ./results_dir/raptor_perf.log + mv CGA_Result.json ./results_dir +} + +command -v raptor >/dev/null 2>&1 && raptor_path=$(which raptor) || { echo >&2 echo "First you need to source Raptor"; end_time +parse_cga exit; } +lib_fix_path="${raptor_path:(-11)}" +library=${raptor_path/$lib_fix_path//share/raptor/sim_models} + +#removing and creating raptor_testcase_files +#rm -fR $PWD/results_dir +[ ! -d $PWD/results_dir ] && mkdir $PWD/results_dir +[ -d $PWD/results_dir ] && touch $PWD/results_dir/CGA_Result.json +cd $main_path +[ -f CGA_Result_default.json ] && cp CGA_Result_default.json ./results_dir/CGA_Result.json +[ -d $PWD/results_dir ] && cd $PWD/results_dir + +echo "ExecStartTime: $start">results.log +echo "Domain of the design: Unit Level Test">>results.log +# Check if parameters were passed as command line arguments +reg_id="23" +timeout="90" +synth_stage="" +mute_flag="" +if [[ $# -eq 6 ]]; then + reg_id=$1 + timeout=$2 + post_synth_sim=$3 + device=$4 + synth_stage=$5 + mute_flag=$6 +else + if [[ $1 == "load_toolconf" ]]; then + # Load parameters from tool.conf file + source $main_path/../../tool.conf + elif [[ $1 == "clean" ]]; then + cd $main_path + PIDS=$(lsof +D "results_dir" | awk 'NR>1 {print $2}' | uniq) + for PID in $PIDS; do + if kill -0 $PID 2>/dev/null; then + echo "Attempting to terminate process $PID..." + kill $PID + sleep 1 + if kill -0 $PID 2>/dev/null; then + echo "Process $PID did not terminate gracefully. Forcing termination." + kill -9 $PID 2>/dev/null || echo "Could not force terminate process $PID. It may have already exited." + fi + else + echo "Process $PID already terminated." + fi + done + rm -rf cksums.md5 newsum.md5 raptor_tcl.tcl results_dir/ + echo "Files cleaned" + exit 0 + else + echo "Using paramters defined in raptor_run.sh" + fi +fi + +if [ -z $1 ]; then + echo "RegID: $reg_id">>results.log +else + echo "RegID: $1">>results.log +fi + +if [ -z $2 ]; then + echo "timeout: $timeout">>results.log +else + timeout=$2 + echo "timeout: $2">>results.log +fi + +function compile () { + + module unload synopsys/1.0 + + cd $main_path/results_dir + echo $PWD + + timeout+='m' + + timeout 2m xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24" raptor --compiler dummy $mute_flag --script ../compiler_flow_with_clean.tcl 2>&1 | tee -a results.log + if [ ${PIPESTATUS[0]} -eq 124 ]; then + echo -e "\nERROR: TIM: Design Compilation took $timeout. Exiting due to timeout">>raptor.log + cat raptor.log >> results.log + end_time + parse_cga + exit + fi + +} + +compile +cat raptor.log >> results.log +echo -e "\n\n#########Raptor Performance Data#########" >> results.log +cat raptor_perf.log >> results.log +echo -e "#############################################\n" >> results.log + +end_time +parse_cga diff --git a/tests/TestGui/compiler_flow_with_clean/test.config b/tests/TestGui/compiler_flow_with_clean/test.config new file mode 100644 index 000000000..651900a8f --- /dev/null +++ b/tests/TestGui/compiler_flow_with_clean/test.config @@ -0,0 +1,24 @@ +#test_owner:"abdulhameed.akram" +#test_details:"This test performs the raptor compile and simulation" +#test_status:"inactive" +#simulator:"" +#stage_id:"4" +#reg_type:"2" +#total_runtime_margin:"20" +#synthesis_runtime_margin:"20" +#packing_runtime_margin:"20" +#placement_runtime_margin:"20" +#routing_runtime_margin:"20" +#time_analysis_runtime_margin:"20" +#bitstream_runtime_margin:"20" +#fmax_clock1_margin:"5" +#registers_margin:"10" +#total_luts_margin:"10" +#brams_margin:"10" +#dsp_margin:"10" +#Adder_Carry_margin:"10" +#CLB_margin:"10" +#LUT_CLB_ratio_margin:"5" +#CLB_percentage_used_margin:"5" +#FLE_Percentage_used_margin:"10" +#Wirelength_Percentage_used_margin:"10" diff --git a/tests/TestGui/design_runs/CGA_Result_default.json b/tests/TestGui/design_runs/CGA_Result_default.json new file mode 100644 index 000000000..81a65be51 --- /dev/null +++ b/tests/TestGui/design_runs/CGA_Result_default.json @@ -0,0 +1,21 @@ +{ + "strategy": "delay", + "total_runtime": null, + "synthesis_runtime": null, + "packing_runtime": null, + "placement_runtime": null, + "routing_runtime": null, + "time_analysis_runtime": null, + "bitstream_runtime": null, + "reg_id": "23", + "device": "GEMINI_COMPACT_104x68", + "version": null, + "git_hash": null, + "built": null, + "built_type": null, + "status": "Fail", + "error_msg": "No log generated", + "post_synth_sim_status": null, + "failure_type": null, + "fmax_clock1": null +} \ No newline at end of file diff --git a/tests/TestGui/design_runs.tcl b/tests/TestGui/design_runs/design_runs.tcl similarity index 100% rename from tests/TestGui/design_runs.tcl rename to tests/TestGui/design_runs/design_runs.tcl diff --git a/tests/TestGui/design_runs/raptor_run.sh b/tests/TestGui/design_runs/raptor_run.sh new file mode 100755 index 000000000..08ff33530 --- /dev/null +++ b/tests/TestGui/design_runs/raptor_run.sh @@ -0,0 +1,119 @@ +#!/bin/bash +set -e +# XVFB='xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24"' +main_path=$PWD +start=`date +%s` + + +function end_time(){ + end=`date +%s` + runtime=$((end-start)) + echo -e "\nTotal RunTime to run raptor_run.sh: $runtime">>results.log + echo "Peak Memory Usage: 117360">>results.log + echo "ExecEndTime: $end">>results.log + raptor --version>>results.log +} + +function parse_cga(){ + cd $main_path + tail -n100 ./results_dir/raptor.log > ./results_dir/raptor_tail.log + timeout 15m python3 ../../../../../parser.py ./results_dir/results.log ./results_dir/raptor_perf.log + mv CGA_Result.json ./results_dir +} + +command -v raptor >/dev/null 2>&1 && raptor_path=$(which raptor) || { echo >&2 echo "First you need to source Raptor"; end_time +parse_cga exit; } +lib_fix_path="${raptor_path:(-11)}" +library=${raptor_path/$lib_fix_path//share/raptor/sim_models} + +#removing and creating raptor_testcase_files +#rm -fR $PWD/results_dir +[ ! -d $PWD/results_dir ] && mkdir $PWD/results_dir +[ -d $PWD/results_dir ] && touch $PWD/results_dir/CGA_Result.json +cd $main_path +[ -f CGA_Result_default.json ] && cp CGA_Result_default.json ./results_dir/CGA_Result.json +[ -d $PWD/results_dir ] && cd $PWD/results_dir + +echo "ExecStartTime: $start">results.log +echo "Domain of the design: Unit Level Test">>results.log +# Check if parameters were passed as command line arguments +reg_id="23" +timeout="90" +synth_stage="" +mute_flag="" +if [[ $# -eq 6 ]]; then + reg_id=$1 + timeout=$2 + post_synth_sim=$3 + device=$4 + synth_stage=$5 + mute_flag=$6 +else + if [[ $1 == "load_toolconf" ]]; then + # Load parameters from tool.conf file + source $main_path/../../tool.conf + elif [[ $1 == "clean" ]]; then + cd $main_path + PIDS=$(lsof +D "results_dir" | awk 'NR>1 {print $2}' | uniq) + for PID in $PIDS; do + if kill -0 $PID 2>/dev/null; then + echo "Attempting to terminate process $PID..." + kill $PID + sleep 1 + if kill -0 $PID 2>/dev/null; then + echo "Process $PID did not terminate gracefully. Forcing termination." + kill -9 $PID 2>/dev/null || echo "Could not force terminate process $PID. It may have already exited." + fi + else + echo "Process $PID already terminated." + fi + done + rm -rf cksums.md5 newsum.md5 raptor_tcl.tcl results_dir/ + echo "Files cleaned" + exit 0 + else + echo "Using paramters defined in raptor_run.sh" + fi +fi + +if [ -z $1 ]; then + echo "RegID: $reg_id">>results.log +else + echo "RegID: $1">>results.log +fi + +if [ -z $2 ]; then + echo "timeout: $timeout">>results.log +else + timeout=$2 + echo "timeout: $2">>results.log +fi + +function compile () { + + module unload synopsys/1.0 + + cd $main_path/results_dir + echo $PWD + + timeout+='m' + + timeout 2m xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24" raptor --compiler dummy $mute_flag --script ../design_runs.tcl 2>&1 | tee -a results.log + if [ ${PIPESTATUS[0]} -eq 124 ]; then + echo -e "\nERROR: TIM: Design Compilation took $timeout. Exiting due to timeout">>raptor.log + cat raptor.log >> results.log + end_time + parse_cga + exit + fi + +} + +compile +cat raptor.log >> results.log +echo -e "\n\n#########Raptor Performance Data#########" >> results.log +cat raptor_perf.log >> results.log +echo -e "#############################################\n" >> results.log + +end_time +parse_cga diff --git a/tests/TestGui/design_runs/test.config b/tests/TestGui/design_runs/test.config new file mode 100644 index 000000000..651900a8f --- /dev/null +++ b/tests/TestGui/design_runs/test.config @@ -0,0 +1,24 @@ +#test_owner:"abdulhameed.akram" +#test_details:"This test performs the raptor compile and simulation" +#test_status:"inactive" +#simulator:"" +#stage_id:"4" +#reg_type:"2" +#total_runtime_margin:"20" +#synthesis_runtime_margin:"20" +#packing_runtime_margin:"20" +#placement_runtime_margin:"20" +#routing_runtime_margin:"20" +#time_analysis_runtime_margin:"20" +#bitstream_runtime_margin:"20" +#fmax_clock1_margin:"5" +#registers_margin:"10" +#total_luts_margin:"10" +#brams_margin:"10" +#dsp_margin:"10" +#Adder_Carry_margin:"10" +#CLB_margin:"10" +#LUT_CLB_ratio_margin:"5" +#CLB_percentage_used_margin:"5" +#FLE_Percentage_used_margin:"10" +#Wirelength_Percentage_used_margin:"10" diff --git a/tests/TestGui/foedag_proc/CGA_Result_default.json b/tests/TestGui/foedag_proc/CGA_Result_default.json new file mode 100644 index 000000000..81a65be51 --- /dev/null +++ b/tests/TestGui/foedag_proc/CGA_Result_default.json @@ -0,0 +1,21 @@ +{ + "strategy": "delay", + "total_runtime": null, + "synthesis_runtime": null, + "packing_runtime": null, + "placement_runtime": null, + "routing_runtime": null, + "time_analysis_runtime": null, + "bitstream_runtime": null, + "reg_id": "23", + "device": "GEMINI_COMPACT_104x68", + "version": null, + "git_hash": null, + "built": null, + "built_type": null, + "status": "Fail", + "error_msg": "No log generated", + "post_synth_sim_status": null, + "failure_type": null, + "fmax_clock1": null +} \ No newline at end of file diff --git a/tests/TestGui/foedag_proc.tcl b/tests/TestGui/foedag_proc/foedag_proc.tcl similarity index 100% rename from tests/TestGui/foedag_proc.tcl rename to tests/TestGui/foedag_proc/foedag_proc.tcl diff --git a/tests/TestGui/foedag_proc/raptor_run.sh b/tests/TestGui/foedag_proc/raptor_run.sh new file mode 100755 index 000000000..09b7bb289 --- /dev/null +++ b/tests/TestGui/foedag_proc/raptor_run.sh @@ -0,0 +1,119 @@ +#!/bin/bash +set -e +# XVFB='xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24"' +main_path=$PWD +start=`date +%s` + + +function end_time(){ + end=`date +%s` + runtime=$((end-start)) + echo -e "\nTotal RunTime to run raptor_run.sh: $runtime">>results.log + echo "Peak Memory Usage: 117360">>results.log + echo "ExecEndTime: $end">>results.log + raptor --version>>results.log +} + +function parse_cga(){ + cd $main_path + tail -n100 ./results_dir/raptor.log > ./results_dir/raptor_tail.log + timeout 15m python3 ../../../../../parser.py ./results_dir/results.log ./results_dir/raptor_perf.log + mv CGA_Result.json ./results_dir +} + +command -v raptor >/dev/null 2>&1 && raptor_path=$(which raptor) || { echo >&2 echo "First you need to source Raptor"; end_time +parse_cga exit; } +lib_fix_path="${raptor_path:(-11)}" +library=${raptor_path/$lib_fix_path//share/raptor/sim_models} + +#removing and creating raptor_testcase_files +#rm -fR $PWD/results_dir +[ ! -d $PWD/results_dir ] && mkdir $PWD/results_dir +[ -d $PWD/results_dir ] && touch $PWD/results_dir/CGA_Result.json +cd $main_path +[ -f CGA_Result_default.json ] && cp CGA_Result_default.json ./results_dir/CGA_Result.json +[ -d $PWD/results_dir ] && cd $PWD/results_dir + +echo "ExecStartTime: $start">results.log +echo "Domain of the design: Unit Level Test">>results.log +# Check if parameters were passed as command line arguments +reg_id="23" +timeout="90" +synth_stage="" +mute_flag="" +if [[ $# -eq 6 ]]; then + reg_id=$1 + timeout=$2 + post_synth_sim=$3 + device=$4 + synth_stage=$5 + mute_flag=$6 +else + if [[ $1 == "load_toolconf" ]]; then + # Load parameters from tool.conf file + source $main_path/../../tool.conf + elif [[ $1 == "clean" ]]; then + cd $main_path + PIDS=$(lsof +D "results_dir" | awk 'NR>1 {print $2}' | uniq) + for PID in $PIDS; do + if kill -0 $PID 2>/dev/null; then + echo "Attempting to terminate process $PID..." + kill $PID + sleep 1 + if kill -0 $PID 2>/dev/null; then + echo "Process $PID did not terminate gracefully. Forcing termination." + kill -9 $PID 2>/dev/null || echo "Could not force terminate process $PID. It may have already exited." + fi + else + echo "Process $PID already terminated." + fi + done + rm -rf cksums.md5 newsum.md5 raptor_tcl.tcl results_dir/ + echo "Files cleaned" + exit 0 + else + echo "Using paramters defined in raptor_run.sh" + fi +fi + +if [ -z $1 ]; then + echo "RegID: $reg_id">>results.log +else + echo "RegID: $1">>results.log +fi + +if [ -z $2 ]; then + echo "timeout: $timeout">>results.log +else + timeout=$2 + echo "timeout: $2">>results.log +fi + +function compile () { + + module unload synopsys/1.0 + + cd $main_path/results_dir + echo $PWD + + timeout+='m' + + timeout 2m xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24" raptor --compiler dummy $mute_flag --script ../foedag_proc.tcl 2>&1 | tee -a results.log + if [ ${PIPESTATUS[0]} -eq 124 ]; then + echo -e "\nERROR: TIM: Design Compilation took $timeout. Exiting due to timeout">>raptor.log + cat raptor.log >> results.log + end_time + parse_cga + exit + fi + +} + +compile +cat raptor.log >> results.log +echo -e "\n\n#########Raptor Performance Data#########" >> results.log +cat raptor_perf.log >> results.log +echo -e "#############################################\n" >> results.log + +end_time +parse_cga diff --git a/tests/TestGui/foedag_proc/test.config b/tests/TestGui/foedag_proc/test.config new file mode 100644 index 000000000..651900a8f --- /dev/null +++ b/tests/TestGui/foedag_proc/test.config @@ -0,0 +1,24 @@ +#test_owner:"abdulhameed.akram" +#test_details:"This test performs the raptor compile and simulation" +#test_status:"inactive" +#simulator:"" +#stage_id:"4" +#reg_type:"2" +#total_runtime_margin:"20" +#synthesis_runtime_margin:"20" +#packing_runtime_margin:"20" +#placement_runtime_margin:"20" +#routing_runtime_margin:"20" +#time_analysis_runtime_margin:"20" +#bitstream_runtime_margin:"20" +#fmax_clock1_margin:"5" +#registers_margin:"10" +#total_luts_margin:"10" +#brams_margin:"10" +#dsp_margin:"10" +#Adder_Carry_margin:"10" +#CLB_margin:"10" +#LUT_CLB_ratio_margin:"5" +#CLB_percentage_used_margin:"5" +#FLE_Percentage_used_margin:"10" +#Wirelength_Percentage_used_margin:"10" diff --git a/tests/TestGui/gtkwave_cmds/CGA_Result_default.json b/tests/TestGui/gtkwave_cmds/CGA_Result_default.json new file mode 100644 index 000000000..81a65be51 --- /dev/null +++ b/tests/TestGui/gtkwave_cmds/CGA_Result_default.json @@ -0,0 +1,21 @@ +{ + "strategy": "delay", + "total_runtime": null, + "synthesis_runtime": null, + "packing_runtime": null, + "placement_runtime": null, + "routing_runtime": null, + "time_analysis_runtime": null, + "bitstream_runtime": null, + "reg_id": "23", + "device": "GEMINI_COMPACT_104x68", + "version": null, + "git_hash": null, + "built": null, + "built_type": null, + "status": "Fail", + "error_msg": "No log generated", + "post_synth_sim_status": null, + "failure_type": null, + "fmax_clock1": null +} \ No newline at end of file diff --git a/tests/TestGui/gtkwave_cmds.tcl b/tests/TestGui/gtkwave_cmds/gtkwave_cmds.tcl similarity index 100% rename from tests/TestGui/gtkwave_cmds.tcl rename to tests/TestGui/gtkwave_cmds/gtkwave_cmds.tcl diff --git a/tests/TestGui/gtkwave_cmds/raptor_run.sh b/tests/TestGui/gtkwave_cmds/raptor_run.sh new file mode 100755 index 000000000..2c9bc8c0c --- /dev/null +++ b/tests/TestGui/gtkwave_cmds/raptor_run.sh @@ -0,0 +1,119 @@ +#!/bin/bash +set -e +# XVFB='xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24"' +main_path=$PWD +start=`date +%s` + + +function end_time(){ + end=`date +%s` + runtime=$((end-start)) + echo -e "\nTotal RunTime to run raptor_run.sh: $runtime">>results.log + echo "Peak Memory Usage: 117360">>results.log + echo "ExecEndTime: $end">>results.log + raptor --version>>results.log +} + +function parse_cga(){ + cd $main_path + tail -n100 ./results_dir/raptor.log > ./results_dir/raptor_tail.log + timeout 15m python3 ../../../../../parser.py ./results_dir/results.log ./results_dir/raptor_perf.log + mv CGA_Result.json ./results_dir +} + +command -v raptor >/dev/null 2>&1 && raptor_path=$(which raptor) || { echo >&2 echo "First you need to source Raptor"; end_time +parse_cga exit; } +lib_fix_path="${raptor_path:(-11)}" +library=${raptor_path/$lib_fix_path//share/raptor/sim_models} + +#removing and creating raptor_testcase_files +#rm -fR $PWD/results_dir +[ ! -d $PWD/results_dir ] && mkdir $PWD/results_dir +[ -d $PWD/results_dir ] && touch $PWD/results_dir/CGA_Result.json +cd $main_path +[ -f CGA_Result_default.json ] && cp CGA_Result_default.json ./results_dir/CGA_Result.json +[ -d $PWD/results_dir ] && cd $PWD/results_dir + +echo "ExecStartTime: $start">results.log +echo "Domain of the design: Unit Level Test">>results.log +# Check if parameters were passed as command line arguments +reg_id="23" +timeout="90" +synth_stage="" +mute_flag="" +if [[ $# -eq 6 ]]; then + reg_id=$1 + timeout=$2 + post_synth_sim=$3 + device=$4 + synth_stage=$5 + mute_flag=$6 +else + if [[ $1 == "load_toolconf" ]]; then + # Load parameters from tool.conf file + source $main_path/../../tool.conf + elif [[ $1 == "clean" ]]; then + cd $main_path + PIDS=$(lsof +D "results_dir" | awk 'NR>1 {print $2}' | uniq) + for PID in $PIDS; do + if kill -0 $PID 2>/dev/null; then + echo "Attempting to terminate process $PID..." + kill $PID + sleep 1 + if kill -0 $PID 2>/dev/null; then + echo "Process $PID did not terminate gracefully. Forcing termination." + kill -9 $PID 2>/dev/null || echo "Could not force terminate process $PID. It may have already exited." + fi + else + echo "Process $PID already terminated." + fi + done + rm -rf cksums.md5 newsum.md5 raptor_tcl.tcl results_dir/ + echo "Files cleaned" + exit 0 + else + echo "Using paramters defined in raptor_run.sh" + fi +fi + +if [ -z $1 ]; then + echo "RegID: $reg_id">>results.log +else + echo "RegID: $1">>results.log +fi + +if [ -z $2 ]; then + echo "timeout: $timeout">>results.log +else + timeout=$2 + echo "timeout: $2">>results.log +fi + +function compile () { + + module unload synopsys/1.0 + + cd $main_path/results_dir + echo $PWD + + timeout+='m' + + timeout 2m xvfb-run --auto-servernum --server-args="-screen 0, 1280x1024x24" raptor --compiler dummy $mute_flag --script ../gtkwave_cmds.tcl 2>&1 | tee -a results.log + if [ ${PIPESTATUS[0]} -eq 124 ]; then + echo -e "\nERROR: TIM: Design Compilation took $timeout. Exiting due to timeout">>raptor.log + cat raptor.log >> results.log + end_time + parse_cga + exit + fi + +} + +compile +cat raptor.log >> results.log +echo -e "\n\n#########Raptor Performance Data#########" >> results.log +cat raptor_perf.log >> results.log +echo -e "#############################################\n" >> results.log + +end_time +parse_cga diff --git a/tests/TestGui/gtkwave_cmds/test.config b/tests/TestGui/gtkwave_cmds/test.config new file mode 100644 index 000000000..651900a8f --- /dev/null +++ b/tests/TestGui/gtkwave_cmds/test.config @@ -0,0 +1,24 @@ +#test_owner:"abdulhameed.akram" +#test_details:"This test performs the raptor compile and simulation" +#test_status:"inactive" +#simulator:"" +#stage_id:"4" +#reg_type:"2" +#total_runtime_margin:"20" +#synthesis_runtime_margin:"20" +#packing_runtime_margin:"20" +#placement_runtime_margin:"20" +#routing_runtime_margin:"20" +#time_analysis_runtime_margin:"20" +#bitstream_runtime_margin:"20" +#fmax_clock1_margin:"5" +#registers_margin:"10" +#total_luts_margin:"10" +#brams_margin:"10" +#dsp_margin:"10" +#Adder_Carry_margin:"10" +#CLB_margin:"10" +#LUT_CLB_ratio_margin:"5" +#CLB_percentage_used_margin:"5" +#FLE_Percentage_used_margin:"10" +#Wirelength_Percentage_used_margin:"10"