From 5a9d9a1eb27687cd55f25c22795b25ea6204982a Mon Sep 17 00:00:00 2001 From: Wade Fife Date: Fri, 22 Nov 2024 14:13:39 -0600 Subject: [PATCH] fpga: tools: Add --ignore-warnings to repeat_fpga_build Original-commit: 381ecf857852a5184402b20d82d8b19f2188f434 --- tools/utils/repeat_fpga_build.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/tools/utils/repeat_fpga_build.py b/tools/utils/repeat_fpga_build.py index b38ef35..0003deb 100755 --- a/tools/utils/repeat_fpga_build.py +++ b/tools/utils/repeat_fpga_build.py @@ -202,6 +202,12 @@ def parse_args(): "location (e.g., /tools/Xilinx/Vivado).", default=None, ) + parser.add_argument( + "--ignore-warnings", + "-W", + help="Run build even when there are warnings from the RFNoC image builder", + action="store_true", + ) parser.add_argument( "--num", "-n", @@ -282,6 +288,7 @@ def rfnoc_image_builder_cmd( image_core_name, fpga_dir, vivado_path, + ignore_warnings, build_num=None, ): """ @@ -300,6 +307,8 @@ def rfnoc_image_builder_cmd( cmd += f"--fpga-dir {fpga_dir} " if vivado_path: cmd += f"--vivado-path {vivado_path} " + if ignore_warnings: + cmd += "--ignore-warnings " return cmd @@ -313,6 +322,7 @@ def run_fpga_build( image_core_name, fpga_dir, vivado_path, + ignore_warnings, parallel_builds, ): """Performs one iteration of an FPGA build. @@ -327,6 +337,8 @@ def run_fpga_build( image_core_name: --image-core-name argument to be passed fpga_dir: --fpga-dir argument to be passed vivado_path: --vivado-path argument to be passed + ignore_warnings: --ignore-warnings argument to be passed + parallel_builds: Indicates if we are doing builds in parallel Returns: Status.SUCCESS: The build succeeded @@ -343,6 +355,7 @@ def run_fpga_build( image_core_name, fpga_dir, vivado_path, + ignore_warnings, cmd_build_num, ) logging.info(f"Running FPGA build command: {cmd}") @@ -388,7 +401,9 @@ def run_fpga_build( return status -def run_ip_build(ip_jobs, target, image_core, image_core_name, fpga_dir, vivado_path): +def run_ip_build( + ip_jobs, target, image_core, image_core_name, fpga_dir, vivado_path, ignore_warnings +): """Performs the IP build. This is done separately so that when we do parallel FPGA builds, they don't @@ -401,13 +416,21 @@ def run_ip_build(ip_jobs, target, image_core, image_core_name, fpga_dir, vivado_ image_core_name: --image-core-name argument to be passed fpga_dir: --fpga-dir argument to be passed vivado_path: --vivado-path argument to be passed + ignore_warnings: --ignore-warnings argument to be passed Returns: 0: The IP build succeeded non-zero: The IP build failed """ cmd = rfnoc_image_builder_cmd( - None, target, image_core, image_core_name, fpga_dir, vivado_path, None + None, + target, + image_core, + image_core_name, + fpga_dir, + vivado_path, + ignore_warnings, + None, ) cmd += f" --ip-only --jobs {ip_jobs}" logging.info(f"Running IP build with command: {cmd}") @@ -475,6 +498,7 @@ def main(): args.image_core_name, args.fpga_dir, args.vivado_path, + args.ignore_warnings, ) if status != Status.SUCCESS: return status.value @@ -502,6 +526,7 @@ def main(): args.image_core_name, args.fpga_dir, args.vivado_path, + args.ignore_warnings, args.fpga_jobs > 1, ), )