Added debug option to commnad line arguments

This commit is contained in:
Ganesh Gore 2019-08-21 11:08:13 -06:00
parent b7484ef178
commit a335a57c6c
3 changed files with 19 additions and 10 deletions

View File

@ -10,9 +10,9 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
#make
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=debug -DENABLE_VPR_GRAPHICS=off
cmake .. -DCMAKE_BUILD_TYPE=debug -DENABLE_VPR_GRAPHICS=off
make -j2
else
else
# For linux, we enable full package compilation
#make
mkdir build
@ -26,8 +26,4 @@ end_section "OpenFPGA.build"
$SPACER
cd -
./.travis/regression.sh
#cd fpga_flow
#./regression_fpga_flow.sh
#cd -
python3.5 ./openfpga_flow/scripts/run_fpga_task.py basic_flow

View File

@ -57,6 +57,8 @@ parser.add_argument('--run_dir', type=str,
help="Directory to store intermidiate file & final results")
parser.add_argument('--yosys_tmpl', type=str,
help="Alternate yosys template, generates top_module.blif")
parser.add_argument('--debug', action="store_true",
help="Run script in debug mode")
# ACE2 and power estimation related arguments
parser.add_argument('--K', type=int,
@ -249,6 +251,10 @@ def validate_command_line_arguments():
"""
logger.info("Validating commnad line arguments")
if args.debug:
logger.info("Setting loggger in debug mode")
logger.setLevel(logging.DEBUG)
# Check if flow supported
if not args.fpga_flow in config.get("FLOW_SCRIPT_CONFIG", "valid_flows"):
clean_up_and_exit("%s Flow not supported"%args.fpga_flow)
@ -780,6 +786,7 @@ def run_netlists_verification():
def run_command(taskname, logfile, command, exit_if_fail=True):
logger.info("Launching %s " % taskname)
try:
with open(logfile, 'w+') as output:
output.write(" ".join(command)+"\n")

View File

@ -33,6 +33,8 @@ parser.add_argument('--maxthreads', type=int, default=2,
parser.add_argument('--config', help="Override default configuration")
parser.add_argument('--test_run', action="store_true",
help="Dummy run shows final generated VPR commands")
parser.add_argument('--debug', action="store_true",
help="Run script in debug mode")
args = parser.parse_args()
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@ -76,7 +78,9 @@ def clean_up_and_exit(msg):
def validate_command_line_arguments():
pass
if args.debug:
logger.info("Setting loggger in debug mode")
logger.setLevel(logging.DEBUG)
def generate_each_task_actions(taskname):
@ -143,7 +147,8 @@ def generate_each_task_actions(taskname):
" with path %s " % (eachpath))
bench_files += files
ys_for_task = task_conf.get("SYNTHESIS_PARAM", "bench_yosys_common")
ys_for_task = task_conf.get("SYNTHESIS_PARAM", "bench_yosys_common",
fallback="")
benchmark_list.append({
"files": bench_files,
"top_module": task_conf.get("SYNTHESIS_PARAM", bech_name+"_top",
@ -218,7 +223,8 @@ def create_run_command(curr_job_dir, archfile, benchmark_obj, task_conf):
# Add other paramters to pass
for key, values in task_conf["SCRIPT_PARAM"].items():
command += ["--"+key, values]
if args.debug:
command += ["--debug"]
return command