Add --package-only to aws_build_dcp_from_cl.py to package an existing DCP - #805
Add --package-only to aws_build_dcp_from_cl.py to package an existing DCP#805WajahatRiaz wants to merge 3 commits into
Conversation
Reuse an existing post-route checkpoint with --tag instead of re-running implementation, and document the flag next to the other aws_build_dcp_from_cl.py options. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi @WajahatRiaz! Thanks for your contribution! It looks well-scoped and can be genuinely useful for all users of this devkit. We'll review this internally. |
Clock recipes are written into the Developer CL tarball, so --package-only now requires --tag and at least one of --clock_recipe_a/b/c/hbm. Omitted recipes keep the documented defaults. --aws_clk_gen is not required in this mode because packaging only records the recipes in the manifest. Co-authored-by: Cursor <cursoragent@cursor.com>
Do not fall back to documented defaults for omitted recipes, so the tarball manifest cannot silently disagree with the clocks used during implementation. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a --package-only mode to aws_build_dcp_from_cl.py so developers can package an already-generated post-route DCP into a Developer CL tarball without re-running Vivado, and documents the new workflow in the HDK docs.
Changes:
- Added
--package-onlyCLI flag, plus argument validation around required--tagand explicitly-specified clock recipe options. - Adjusted the existing
--aws_clk_gen/clock-recipe guard so it does not block packaging-only usage. - Documented
--package-onlyusage in both Markdown and RTD documentation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| hdk/common/shell_stable/build/scripts/aws_build_dcp_from_cl.py | Adds --package-only mode and related validation/logic changes for packaging existing post-route DCPs. |
| hdk/README.md | Documents the new --package-only workflow and its required arguments. |
| docs-rtd/source/hdk/README.rst | Mirrors the documentation update for RTD/Sphinx output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| _missing_recipes = [opt for opt in CLOCK_RECIPE_OPTS if not option_on_argv(opt)] | ||
| if _missing_recipes: | ||
| print_error( | ||
| "--package-only requires all four clock recipes to be passed explicitly " | ||
| "(--clock_recipe_a, --clock_recipe_b, --clock_recipe_c, and --clock_recipe_hbm)" | ||
| ) | ||
| print(f"AWS FPGA: --package-only set, skipping Vivado and packaging tag {build_tag}\n") |
There was a problem hiding this comment.
This would be a nice-to-have.
| cmd = ( | ||
| f"vivado -mode batch -source build_all.tcl -log {build_tag}.vivado.log " | ||
| + f"-tclargs {options.place_direct} {options.phy_opt_direct} {options.route_direct} " | ||
| + f"{options.clock_recipe_a} {options.clock_recipe_b} {options.clock_recipe_c} {options.clock_recipe_hbm} " | ||
| ) |
|
Hi @WajahatRiaz. Thanks for the quick follow-ups on the suggested changes! We always appreciate contributions, and we want to make sure you git the credit for these changes. We have a few more housekeeping items. Can you please run the following, from the repo root: pip install ruff # formatter tool
ruff check --select E,W,F,I,N,UP,B,C4,SIM,PIE --line-length 140 --fix --unsafe-fixes hdk/common/shell_stable/build/scripts/aws_build_dcp_from_cl.py
ruff format --line-length 140 hdk/common/shell_stable/build/scripts/aws_build_dcp_from_cl.py |
| sys.stdout.flush() | ||
| os.system(cmd) | ||
|
|
||
| if options.package_only: |
There was a problem hiding this comment.
nit: this validation (missing --tag, missing clock-recipe flags) runs after the "Build starts" banner is printed right above, so a failed --package-only invocation logs a start message immediately followed by an error/exit.
Let's move this whole block above the start banner print, before the start banner print.
| dest="package_only", | ||
| action="store_true", | ||
| default=False, | ||
| help="Skip Vivado and package an existing post-route DCP. Requires --tag matching the checkpoint timestamp and all four of --clock_recipe_a/b/c/hbm passed explicitly (recipes are not defaulted or derived from the DCP).", |
There was a problem hiding this comment.
This line is too long. ruff format won't break string literals. Let's apply the following:
| help="Skip Vivado and package an existing post-route DCP. Requires --tag matching the checkpoint timestamp and all four of --clock_recipe_a/b/c/hbm passed explicitly (recipes are not defaulted or derived from the DCP).", | |
| help=( | |
| "Skip Vivado and package an existing post-route DCP. Requires --tag matching the checkpoint " | |
| "timestamp and all four of --clock_recipe_a/b/c/hbm passed explicitly (recipes are not defaulted " | |
| "or derived from the DCP)." | |
| ), |
Summary
aws_build_dcp_from_cl.pyalways starts Vivado, then packages the post-route DCP into a Developer CL tarball. If packaging fails after a successful implementation (for exampleAWS_FPGA_REPO_DIRis unset or points at the wrong tree, sorelease_version.txtcannot be read), the DCP is already on disk but the only supported recovery is to re-run the full build.This PR adds
--package-onlyso the same script can skip Vivado and package an existing checkpoint. The tag (-t) must match$CL_DIR/build/checkpoints/<cl>.<tag>.post_route.dcp. Without--package-only,BuildAllis unchanged.The flag is documented in
hdk/README.mdanddocs-rtd/source/hdk/README.rst.Usage
Test plan
Verified on
cl_axil_reg_access(tag2026_08_25-071852).--package-onlywith a valid-tskips Vivado and writes the tarballAbout 1 second; Vivado is not started.
--helplists the flag--package-onlywithout-terrors and does not start VivadoDefault build (no
--package-only) still runs Vivado, then packagesAbout 18 minutes.