Fixed CLI override function#663
Open
rumlenordstroem wants to merge 1 commit intochipsalliance:mainfrom
Open
Conversation
kboronski-ant
requested changes
Oct 16, 2023
Comment on lines
-155
to
-178
| for stage_name, cli_stage_cfg in part_cfg.items(): | ||
| if stage_name in KWORDS: | ||
| continue | ||
|
|
||
| stage_cfg = part_cfg.get(stage_name) | ||
| if stage_cfg is None: | ||
| stage_cfg = {} | ||
| part_cfg[stage_name] = stage_cfg | ||
|
|
||
| stage_values = stage_cfg.get("values") | ||
| stage_dependencies = stage_cfg.get("dependencies") | ||
| cli_stage_values = cli_stage_cfg.get("values") | ||
| cli_stage_dependencies = cli_stage_cfg.get("dependencies") | ||
|
|
||
| if cli_stage_values is not None: | ||
| if stage_values is None: | ||
| stage_values = {} | ||
| stage_cfg["values"] = stage_values | ||
| stage_values.update(cli_stage_values) | ||
| if cli_stage_dependencies is not None: | ||
| if stage_dependencies is None: | ||
| stage_dependencies = {} | ||
| stage_cfg["dependencies"] = stage_dependencies | ||
| stage_dependencies.update(cli_stage_dependencies) |
Collaborator
There was a problem hiding this comment.
I appreciate how you simplified the code for global dependency overrides, but you dropped an entire part for overriding dependencies defined per-stage.
Author
There was a problem hiding this comment.
Oops, thanks for letting me know. I was probably a little too quick to open this pull request. I will try to fix this when I have time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug where you where not able to override top module from the CLI while using a flow file. For example like this:
f4pga -vv build -f basys3.json -Dsources=[Blinky.sv] -Vtop=Blinkywhere basys3.json looks like this:
{ "default_part": "XC7A35TCPG236-1", "XC7A35TCPG236-1": { "default_target": "bitstream", "dependencies": { "build_dir": "build/basys3", "xdc": ["basys3.xdc"] } } }This resulted in an error where tool would complain that no top module if no top module is defined in basys3.json. The value from the top option was never passed to the flow configuration.