Skip to content

Wire config.cfg pre_synth entries into hardware builds#138

Open
merkelmarrow wants to merge 1 commit into
Xilinx:devfrom
merkelmarrow:fix/config-cfg-pre-synth-wiring
Open

Wire config.cfg pre_synth entries into hardware builds#138
merkelmarrow wants to merge 1 commit into
Xilinx:devfrom
merkelmarrow:fix/config-cfg-pre-synth-wiring

Conversation

@merkelmarrow

Copy link
Copy Markdown

The config.cfg file lets you list pre-synthesis Tcl scripts uner a [user_region] section, meant to run before synthesis during a hardware build (for example to apply timing constraints or per-step implementation directives). Until now those entries were parsed but never actually used, so the only working way to inject a pre-synth script was the --pre-synth-tcls command-line flag, which is not reachable through the regular add_vbin CMake build flow.

This change wires the config file entries through to the build, so both the config file and the command-line flag now work.

  • paths are resolved relative to the config file.
  • you can still pass scripts with --pre-synth-tcls. When both are used, the config file scripts run first and the command-line ones after, so a command-line script can be layered on top.
  • a script listed more than once is de-duplicated.

Example

[user_region]
pre_synth=constraints.tcl
pre_synth=impl_directives.tcl

Testing

  • Added unit tests covering the config-file path reaching the build, the merge order with the command-line flag, de-duplication, and the missing-file error. Full linker test suite passes.
  • Validated end-to-end. A build driven only by a [user_region] pre_synth= entry (no command-line flag) confirmed the script is sourced during the build and the build completes and produces a valid image.

The parser stored [user_region] pre_synth= entries in
ConnectivityConfig.user_region.pre_synth_tcls, but the hardware build
only ever read LinkerConfiguration.pre_synth_tcls, which was populated
solely from the --pre-synth-tcls CLI flag. The config-declared scripts
were parsed and then dropped, so they never reached the build. This
also left the CMak add_vbin flow with no working pre-synth path, since
it never passes --pre-synth-tcls.

Merge both sources in LinkerConfiguration: config entries source first,
then CLI ones, so the order is predicatable. Duplicates are now dropped
by resolved path, which also collapses a repeated --pre-synth-tcls path
that previously sourced twice.

Signed-off-by: Marco Blackwell <mblackwe@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant