feat: add support for json config files #55
Merged
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.
The first commit adds a library for reading and writing configuration files in tcl, json and yaml formats. This allows us to merge configuration files, so we no longer need to source
user_config.tcl
fromconfig.tcl
. Sourcing is still supported for compatibility with oldconfig.tcl
files, but all variables defined while evaluatingconfig.tcl
are overwritten by those appearing inuser_config.tcl
, creating aconfig_merged.tcl
file that is used in the flow.The second commit switches the defaults,
config.json
is now preferred overconfig.tcl
, and the generated files areuser_config.json
andconfig_merged.json
. We still generateuser_config.tcl
as well because an old-styleconfig.tcl
might still source it. We can remove that once we branch offtt08
.The third commit is a single-line change that also allows
config.yaml
. I've split it off so that it can be independently decided upon. I personally findconfig.yaml
much more readable, but we introduce some divergence from upstream openlane. The generated files are still kept in json.After merging the PR
tt-support-tools
should remain compatible with existing configuration files but also support these:https://github.com/htfab/tt07-verilog-template/blob/tcl-config/src/config.tcl (doesn't source
user_config.tcl
)https://github.com/htfab/tt07-verilog-template/blob/json-config/src/config.json
https://github.com/htfab/tt07-verilog-template/blob/yaml-config/src/config.yaml