This commit is contained in:
Sagar Karandikar 2023-06-16 07:38:52 -07:00
parent 46558a9349
commit ea2840497d
4 changed files with 56 additions and 19 deletions

View File

@ -18,10 +18,54 @@ def run_agfi_buildbitstream():
with prefix(f'cd {manager_fsim_dir} && source sourceme-manager.sh'):
rc = 0
if True:
# unique tag based on the ci workflow and filename is needed to ensure
# run farm is unique to each linux-poweroff test
with prefix(f"export FIRESIM_BUILDFARM_PREFIX={ci_env['GITHUB_RUN_ID']}-{Path(__file__).stem}"):
with settings(warn_only=True):
# pty=False needed to avoid issues with screen -ls stalling in fabric
build_result = run("timeout 10h firesim buildbitstream --forceterminate", pty=False)
rc = build_result.return_code
if rc != 0:
log_lines = 200
print(f"Buildbitstream failed. Printing {log_lines} of last log file:")
run(f"""LAST_LOG=$(ls | tail -n1) && if [ -f "$LAST_LOG" ]; then tail -n{log_lines} $LAST_LOG; fi""")
sys.exit(rc)
else:
# parse the output yamls, replace the sample hwdb's agfi line only
sample_hwdb_filename = f"{manager_fsim_dir}/{relative_hwdb_path}"
hwdb_entry_dir = f"{manager_fsim_dir}/deploy/built-hwdb-entries"
built_hwdb_entries = [x for x in os.listdir(hwdb_entry_dir) if os.path.isfile(os.path.join(hwdb_entry_dir, x))]
for hwdb in built_hwdb_entries:
print(f"Printing {hwdb}")
run(f"cat {hwdb_entry_dir}/{hwdb}")
sample_hwdb_lines = open(sample_hwdb_filename).read().split('\n')
with open(sample_hwdb_filename, "w") as sample_hwdb_file:
match_agfi = False
for line in sample_hwdb_lines:
if hwdb in line.strip().split(' ')[0].replace(':', ''):
# hwdb entry matches key name
match_agfi = True
sample_hwdb_file.write(line + '\n')
elif match_agfi == True and ("agfi:" in line.strip().split(' ')[0]):
# only replace this agfi
match_agfi = False
new_agfi_line = open(f"{hwdb_entry_dir}/{hwdb}").read().split("\n")[1]
print(f"Replacing {line.strip()} with {new_agfi_line}")
# print out the agfi line
sample_hwdb_file.write(new_agfi_line + '\n')
else:
# if no match print other lines
sample_hwdb_file.write(line + '\n')
if match_agfi == True:
sys.exit("::ERROR:: Unable to find matching AGFI key for HWDB entry")
print(f"Printing {sample_hwdb_filename}...")
run(f"cat {sample_hwdb_filename}")

View File

@ -240,7 +240,7 @@ def run_local_buildbitstreams():
# hwdb_entry_name, platform_name, buildtool:version
batch_hwdbs_in = [
("vitis_firesim_rocket_singlecore_no_nic", "vitis", "vitis:2022.1"),
("nitefury_firesim_rocket_singlecore_no_nic", "rhsresearch_nitefury_ii", "vitis:2022.1"),
("vitis_firesim_gemmini_rocket_singlecore_no_nic", "vitis", "vitis:2022.1"),
("alveo_u250_firesim_rocket_singlecore_no_nic", "xilinx_alveo_u250", "vivado:2021.1"),
("xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic", "xilinx_vcu118", "vivado:2019.1"),
]
@ -249,6 +249,7 @@ def run_local_buildbitstreams():
batch_hwdbs_in = [
("alveo_u280_firesim_rocket_singlecore_no_nic", "xilinx_alveo_u280", "vivado:2021.1"),
("nitefury_firesim_rocket_singlecore_no_nic", "rhsresearch_nitefury_ii", "vitis:2022.1"),
]
do_builds(batch_hwdbs_in)

View File

@ -32,12 +32,12 @@ builds_to_run:
- firesim_boom_singlecore_nic_l2_llc4mb_ddr3
# Configs for tutorials
- firesim_rocket_singlecore_no_nic_l2_lbp
- firesim_rocket_singlecore_sha3_nic_l2_llc4mb_ddr3
- firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3
- firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3_printf
- firesim_gemmini_rocket_singlecore_no_nic
- firesim_gemmini_printf_rocket_singlecore_no_nic
# - firesim_rocket_singlecore_no_nic_l2_lbp
# - firesim_rocket_singlecore_sha3_nic_l2_llc4mb_ddr3
# - firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3
# - firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3_printf
# - firesim_gemmini_rocket_singlecore_no_nic
# - firesim_gemmini_printf_rocket_singlecore_no_nic
# Configs for Vitis/XRT
# - vitis_firesim_rocket_singlecore_no_nic
@ -54,20 +54,12 @@ builds_to_run:
# - nitefury_firesim_rocket_singlecore_no_nic
agfis_to_share:
- firesim_rocket_quadcore_nic_l2_llc4mb_ddr3
- firesim_rocket_quadcore_no_nic_l2_llc4mb_ddr3
- firesim_boom_singlecore_no_nic_l2_llc4mb_ddr3
- firesim_supernode_rocket_singlecore_nic_l2_lbp
- firesim_rocket_quadcore_nic_l2_llc4mb_ddr3
- firesim_boom_singlecore_nic_l2_llc4mb_ddr3
- firesim_rocket_singlecore_no_nic_l2_lbp
- firesim_rocket_singlecore_sha3_nic_l2_llc4mb_ddr3
- firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3
- firesim_rocket_singlecore_sha3_no_nic_l2_llc4mb_ddr3_printf
- firesim_gemmini_rocket_singlecore_no_nic
- firesim_gemmini_printf_rocket_singlecore_no_nic
- firesim_supernode_rocket_singlecore_nic_l2_lbp
# Configs for tutorials
# - firesim_rocket_singlecore_no_nic_l2_lbp

View File

@ -257,7 +257,7 @@ set -o pipefail
fi
# to enable use of sudo and avoid modifying 'secure_path' in /etc/sudoers, we specify the full path to conda
$SUDO "${CONDA_EXE}" "$CONDA_SUBCOMMAND" $DRY_RUN_OPTION -n "$CONDA_ENV_NAME" -y "${CONDA_PACKAGE_SPECS[@]}"
$SUDO "${CONDA_EXE}" "$CONDA_SUBCOMMAND" $DRY_RUN_OPTION -n "$CONDA_ENV_NAME" -c conda-forge -y "${CONDA_PACKAGE_SPECS[@]}"
# to enable use of sudo and avoid modifying 'secure_path' in /etc/sudoers, we specify the full path to pip
CONDA_PIP_EXE="${CONDA_ENV_BIN}/pip"