Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ipgen,clkmgr] Create ipgen files #21202

Merged
merged 8 commits into from
Feb 9, 2024
Merged

Conversation

matutem
Copy link
Contributor

@matutem matutem commented Feb 5, 2024

Create the clkmgr generated files using ipgen, but keep using the legacy flow for now. This is so the full transition is broken into two stages for ease of reviewing. A subsequent change will complete the transition to ipgen and remove the legacy files.

Just like previous IP transitions to ipgen, most of legacy files are simply copied to hw/ip_templates/clkmgr, but the following changes are noteworthy:

  • The third commit moves .tpl files to the locations needed for ipgen, and wipes out from ip_templates the files that are generated so the tree will no longer have these useless and confusing files.
  • The fourth commit makes additional files into templates since their generated text contains the name of top.
  • The fifth commit fixes some core files to use instance_vlnv and declare a virtual name for template code, and other clkmgr core files to use the virtual name.
  • The sixth commit is needed since ipgen uses plain dictionaries, whereas the old flow uses some class objects.
  • The seventh commit makes azure avoid building under the ip_templates tree since build should only happen in the target generated trees.
  • The eigth commit generates all clkmr files under hw/top_earlgrey/ip_autogen using ipgen.
  • The ninth commit deals with the special case of the clkmgr_sec_cm_testplan.hjson file.

@matutem matutem requested review from a team and msfschaffner as code owners February 5, 2024 23:51
@matutem matutem requested review from jdonjdon and removed request for a team February 5, 2024 23:51
@matutem matutem requested a review from vogelpi February 5, 2024 23:56
@matutem matutem force-pushed the ipgen_clkmgr branch 9 times, most recently from b3acef9 to 53e24a4 Compare February 7, 2024 10:42
Copy link
Contributor

@msfschaffner msfschaffner left a comment

Choose a reason for hiding this comment

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

LGTM

Part of lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
This is a straight copy with no changes to the files.

Part of lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
In ipgen template files are at the corresponding directory where
their generated file will reside.

There is no use for files in ip_templates that will end up being
generated. The clkmgr.cfg.example.hjson file is obsolete and
misleading.

The clkmgr_sec_cm_testplan.hjson needs to be removed from templates or it
will overwrite the real top-specific testplan at ip_autogen.

Part of lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
The files are almost identical to the previous ones, except they use
${topname} instead of a specific name and consecutive '#' are escaped
so they are not considered md comments. This escape replaces things like
`###` by `${"###"}`.

Adjust some relative paths to account for the change in the file locations.

Use {self_dir} to simplify some paths: it points to the location of the hjson
file used to process the contents of a given file.

Part of lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
The template core files use instance_vlnv, and declare a virtual target.
Other core files depending on the template cores depend on the
corresponding virtual target instead.

Part of rstmgr lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
The custom template generation used class objects, ipgen uses dictionaries
instead.
Make minor changes in the templates causing no functional change.

Part of rstmgr lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
Template files are only intended for code generation, so it makes
no sense to use them to build targets.

- Add clkmgr in hw/ip_templates/BUILD all_files
- Add exclusion for clkmgr_regs in azure-pipelines.yml

Part of lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
The legacy flow and files is preserved.
Add FUSESOC_IGNORE in hw/ip_templates/clkmgr: it can be
removed once the clkmgr change to ipgen is complete.

Part of lowRISC#8440

Signed-off-by: Guillermo Maturana <[email protected]>
@matutem
Copy link
Contributor Author

matutem commented Feb 9, 2024

The one failure is completely unrelated to this change. Merging this.

@matutem matutem merged commit 209e487 into lowRISC:master Feb 9, 2024
30 of 32 checks passed
@matutem matutem deleted the ipgen_clkmgr branch February 9, 2024 18:59
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.

2 participants