[Flow] Now support explicit variable file for task

This commit is contained in:
ganeshgore 2020-11-25 17:22:41 -07:00
parent 32c43ffb90
commit 1554f583b7
2 changed files with 16 additions and 0 deletions

View File

@ -14,9 +14,11 @@ import time
from datetime import timedelta
import shlex
import glob
import json
import argparse
from configparser import ConfigParser, ExtendedInterpolation
import logging
from envyaml import EnvYAML
import glob
import subprocess
import threading
@ -85,6 +87,8 @@ parser.add_argument('--openfpga_shell_template', type=str,
help="Sample openfpga shell script")
parser.add_argument('--openfpga_arch_file', type=str,
help="Openfpga architecture file for shell")
parser.add_argument('--arch_variable_file', type=str, default=None,
help="Openfpga architecture file for shell")
# parser.add_argument('--openfpga_sim_setting_file', type=str,
# help="Openfpga simulation file for shell")
# parser.add_argument('--external_fabric_key_file', type=str,
@ -313,6 +317,15 @@ def read_script_config():
clean_up_and_exit("Missing CAD_TOOLS_PATH in openfpga_flow config")
cad_tools = config["CAD_TOOLS_PATH"]
if args.arch_variable_file:
_, file_extension = os.path.splitext(args.arch_variable_file)
if file_extension in [".yml", ".yaml"]:
script_env_vars["PATH"].update(
EnvYAML(args.arch_variable_file, include_environment=False))
if file_extension in [".json", ]:
with open(args.arch_variable_file, "r") as fp:
script_env_vars["PATH"].update(json.load(fp))
def validate_command_line_arguments():
"""

View File

@ -371,6 +371,9 @@ def create_run_command(curr_job_dir, archfile, benchmark_obj, param, task_conf):
command += ["--power"]
command += ["--power_tech", task_gc.get("power_tech_file")]
if task_gc.get("arch_variable_file"):
command += ["--arch_variable_file", task_gc.get("arch_variable_file")]
if task_gc.getboolean("spice_output"):
command += ["--vpr_fpga_spice"]