File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
tools/AutoTuner/src/autotuner/utils Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,14 @@ if [[ -n "${RUN_AUTOTUNER+x}" ]] && [[ ${RUN_AUTOTUNER} -eq 1 ]]; then
9999 python3 -m unittest tools.AutoTuner.test.smoke_test_sample_iteration.${PLATFORM} SampleIterationSmokeTest.test_sample_iteration
100100
101101 if [ " $PLATFORM " == " asap7" ] && [ " $DESIGN " == " gcd" ]; then
102- echo " Running Autotuner ref file test (only once)"
102+ echo " Running the following tests once."
103+
104+ echo " Running Autotuner ref file test"
103105 python3 -m unittest tools.AutoTuner.test.ref_file_check.RefFileCheck.test_files
106+
107+ echo " Running Autotuner plotting utility test"
108+ folder_name=$( ls -dt ./flow/logs/asap7/gcd/test-tune* | head -n 1)
109+ python3 tools/AutoTuner/src/autotuner/utils/plot.py --results_dir=$folder_name
104110 fi
105111
106112 echo " Running Autotuner smoke algorithm & evaluation test"
Original file line number Diff line number Diff line change 44import pandas as pd
55import matplotlib .pyplot as plt
66import re
7+ import os
78import argparse
89
910AT_REGEX = r"variant-AutoTunerBase-([\w-]+)-\w+"
11+ IMG_DIR = "images"
1012
1113
1214def load_dir (dir : str ) -> pd .DataFrame :
@@ -83,6 +85,8 @@ def plot(df: pd.DataFrame, key: str):
8385
8486
8587def main (results_dir : str ):
88+ # Default: saves to <REPO_ROOT>/images. Change the IMG_DIR above.
89+ os .makedirs (IMG_DIR , exist_ok = True )
8690 df = load_dir (results_dir )
8791 df = preprocess (df )
8892 keys = ["qor" , "runtime" , "clk_period" , "worst_slack" ]
@@ -93,7 +97,10 @@ def main(results_dir: str):
9397if __name__ == "__main__" :
9498 parser = argparse .ArgumentParser (description = "Plot AutoTuner results." )
9599 parser .add_argument (
96- "results_dir" , type = str , help = "Directory containing the results." , required = True
100+ "--results_dir" ,
101+ type = str ,
102+ help = "Directory containing the results." ,
103+ required = True ,
97104 )
98105 args = parser .parse_args ()
99106 main (args .results_dir )
You can’t perform that action at this time.
0 commit comments