Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs-rtd/source/hdk/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ A few more notes on
source code and DCPs. Encryption, enabled by default, may impede
debugging as errors from encrypted envelope do not provide meaningful
information.
- Use ``--package-only -t <YYYY_MM_DD-HHMMSS>`` to skip Vivado and
package an existing post-route DCP. The tag must match the checkpoint
filename (``<cl>.<tag>.post_route.dcp`` in
``$CL_DIR/build/checkpoints``).
- The script also allows developers to pass different Vivado directives
as shown below:

Expand Down
1 change: 1 addition & 0 deletions hdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ A few more notes on [aws_build_dcp_from_cl.py](https://github.com/aws/aws-fpga/b
- Use `--cl <CL name>` option to build a different CL design. This is default to `cl_dram_hbm_dma`.
- Use `--aws_clk_gen` option to annotate the use of [AWS clock generation block](./docs/AWS_CLK_GEN_spec.md) and [customer clock recipes](./docs/Clock_Recipes_User_Guide.md).
- Use `--no-encrypt` option to disable encryption of the design's source code and DCPs. Encryption, enabled by default, may impede debugging as errors from encrypted envelope do not provide meaningful information.
- Use `--package-only -t <YYYY_MM_DD-HHMMSS>` to skip Vivado and package an existing post-route DCP. The tag must match the checkpoint filename (`<cl>.<tag>.post_route.dcp` in `$CL_DIR/build/checkpoints`).
- The script also allows developers to pass different Vivado directives as shown below:
- `--place <directive>`: Default to `SSI_SpreadLogic_high` placement strategy. Please refer to [Vivado User Guide](https://docs.amd.com/r/en-US/ug904-vivado-implementation/Available-Directives) for supported directives.
- `--phy_opt <directive>` : Default to `AggressiveExplore` physical optimization strategy. Please refer to [Vivado User Guide](https://docs.amd.com/r/en-US/ug904-vivado-implementation/Using-Directives?tocId=9xJiGeSV35ApxUsX7pAVDg) for supported directives
Expand Down
29 changes: 20 additions & 9 deletions hdk/common/shell_stable/build/scripts/aws_build_dcp_from_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ def main():
default=True,
)

parser.add_option(
"--package-only",
dest="package_only",
action="store_true",
default=False,
help="Skip Vivado and package an existing post-route DCP. Requires --tag matching the checkpoint timestamp.",
Comment thread
czfpga marked this conversation as resolved.
Outdated
)

(options, args) = parser.parse_args()

print("==================================================")
Expand Down Expand Up @@ -323,18 +331,21 @@ def main():

Custom `clock_recipe` arguments were detected, please add `--aws_clk_gen` to continue.""")

# Run the Vivado job
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} "
)

start_time = datetime.datetime.now()
print(f"\nAWS FPGA: {start_time.strftime(TIMESTAMP_LOG_FORMAT)} - Build starts\n")

sys.stdout.flush()
os.system(cmd)

if options.package_only:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

if not options.build_tag:
print_error("--package-only requires --tag matching an existing post-route DCP (for example -t YYYY_MM_DD-HHMMSS)")
print(f"AWS FPGA: --package-only set, skipping Vivado and packaging tag {build_tag}\n")
Comment on lines +358 to +364

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a nice-to-have.

else:
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} "
)
Comment on lines +366 to +370
os.system(cmd)

if options.flow == "BuildAll":
generate_dcp_tarball(
Expand Down