Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5 testcases for CGA added to monitor the working on CGA #1676

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -165,15 +165,15 @@ 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
$(XVFB) ./dbuild/bin/pinassignment --replay tests/TestGui/gui_pinassignment.tcl
$(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
Expand Down
21 changes: 21 additions & 0 deletions tests/TestGui/compiler_flow_with_clean/CGA_Result_default.json
Original file line number Diff line number Diff line change
@@ -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
}
119 changes: 119 additions & 0 deletions tests/TestGui/compiler_flow_with_clean/raptor_run.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions tests/TestGui/compiler_flow_with_clean/test.config
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 21 additions & 0 deletions tests/TestGui/design_runs/CGA_Result_default.json
Original file line number Diff line number Diff line change
@@ -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
}
119 changes: 119 additions & 0 deletions tests/TestGui/design_runs/raptor_run.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions tests/TestGui/design_runs/test.config
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 21 additions & 0 deletions tests/TestGui/foedag_proc/CGA_Result_default.json
Original file line number Diff line number Diff line change
@@ -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
}
Loading
Loading