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

[doc,cmdgen] Remove need for text bracketed by CMDGEN BEGIN END #24991

Closed
matutem opened this issue Nov 1, 2024 · 0 comments · Fixed by #24993
Closed

[doc,cmdgen] Remove need for text bracketed by CMDGEN BEGIN END #24991

matutem opened this issue Nov 1, 2024 · 0 comments · Fixed by #24993
Assignees
Labels
Component:Doc Documentation issue Component:MultiTop Component:Tooling Issues related to tooling, e.g. tools/scripts for doc, code generation (docgen, reggen), CSR
Milestone

Comments

@matutem
Copy link
Contributor

matutem commented Nov 1, 2024

Description

The util/cmdgen.py tool runs a command to generate text that will be inserted between the line containing CMDGEN BEGIN and the one containing CMDGEN END. This means there is no need to have any text between these lines.

The usage of cmdgen is described at https://opentitan.org/book/doc/contributing/doc/index.html#cmdgen, and is currently done manually as it is not part of the make targets under hw/Makefile which generates a top.

Since we place all generated artifacts in git we need to make sure cmdgen is run so all md files are as expected.

The problem we face is that if the bracketed text is empty the ci/scripts/check-generated.sh will fail since it uses hw/Makefile to generate artifacts and there is no target for cmdgen. Apparently we currently deal with this by populating the lines between the CMDGEN brackets with what earlgrey expects, which is clumsy, and is unworkable in multi-top.

I propose we add a cmdgen target in that makefile and enhance the check-generated script to invoke that target as well.

@matutem matutem added Component:Doc Documentation issue Component:MultiTop Component:Tooling Issues related to tooling, e.g. tools/scripts for doc, code generation (docgen, reggen), CSR labels Nov 1, 2024
@matutem matutem added this to the Multi-Top milestone Nov 1, 2024
matutem added a commit to matutem/opentitan that referenced this issue Nov 1, 2024
Change ci/scripts/check-generated.sh to run both top and cmdgen
when checking for the topgen generated artifacts. This is to
support template md files having no text between the BEGIN and
END markers so they can handle multi-top.

Add a separate "cmdgen" target in the hw/Makefile and describe
that in the README.md for contributing to documentation.

Fixes lowRISC#24991

Signed-off-by: Guillermo Maturana <[email protected]>
matutem added a commit to matutem/opentitan that referenced this issue Nov 2, 2024
Change ci/scripts/check-generated.sh to run both top and cmdgen
when checking for the topgen generated artifacts. This is to
support template md files having no text between the BEGIN and
END markers so they can handle multi-top.

Add a separate "cmdgen" target in the hw/Makefile and describe
that in the README.md for contributing to documentation.

Fixes lowRISC#24991

Signed-off-by: Guillermo Maturana <[email protected]>
matutem added a commit to matutem/opentitan that referenced this issue Nov 3, 2024
Change ci/scripts/check-generated.sh to run both top and cmdgen
when checking for the topgen generated artifacts. This is to
support template md files having no text between the BEGIN and
END markers so they can handle multi-top.

Add a separate "cmdgen" target in the hw/Makefile and describe
that in the README.md for contributing to documentation.

Fixes lowRISC#24991

Signed-off-by: Guillermo Maturana <[email protected]>
@HU90m HU90m closed this as completed in b4c9944 Nov 4, 2024
andrea-caforio pushed a commit to andrea-caforio/opentitan that referenced this issue Nov 12, 2024
Change ci/scripts/check-generated.sh to run both top and cmdgen
when checking for the topgen generated artifacts. This is to
support template md files having no text between the BEGIN and
END markers so they can handle multi-top.

Add a separate "cmdgen" target in the hw/Makefile and describe
that in the README.md for contributing to documentation.

Fixes lowRISC#24991

Signed-off-by: Guillermo Maturana <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Doc Documentation issue Component:MultiTop Component:Tooling Issues related to tooling, e.g. tools/scripts for doc, code generation (docgen, reggen), CSR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants