-
Notifications
You must be signed in to change notification settings - Fork 813
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,otp_ctrl] Change otp_ctrl to ipgen #25503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
fab6d27
to
cfce607
Compare
CHANGE_AUTHORIZED: BLOCKFILE |
CHANGE_AUTHORIZED: BLOCKFILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
At this point, can we hold-off merging that until the full ipgen flow for otp_ctrl is available? We, downstream, have a custom otp_ctrl based on hw/ip/otp_ctrl. Since we are in a quite critical phase now, I want to avoid adding another thing to deal with, e.g., porting those changes to Darjeeling, which eventually look different when the ipgen version is available.
Please build the future PRs on top of this one. Then we can merge the ipgen version as a direct sequence of PRs (or a single one).
Thanks @matutem |
266d111
to
657cdcb
Compare
@matutem: We can run CHANGE AUTHORIZED: hw/top_earlgrey/ip_autogen/otp_ctrl/rtl/otp_ctrl_top_specific_pkg.sv This is a new file to which top-specific (in this case for Earlgrey) |
43ff428
to
14812a9
Compare
Yes @andreaskurth, the otp_ctrl_top_specific_pkg package has the items that were in otp_ctrl_pkg but that are top-specific. I take it your approval was with the understanding that these miscellaneous items would be handled adequately. |
2f8fc3e
to
0c950eb
Compare
88de25f
to
b3d89cd
Compare
- lowrisc:ip:tlul | ||
- lowrisc:prim:all | ||
- lowrisc:prim:ram_1p | ||
- lowrisc:prim:otp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hierarchy is wonky (not the fault of this PR; it's inherited and is similar to issues with flash_ctrl). An ipgen IP depends on the effectively virtual prim:otp
, and that depends on the very same ipgen IP that instantiated it. In a world of multiple parameterizations, that doesn't work at all.
I feel like the OTP macro ought to live outside the otp_ctrl IP and instantiated in the "chip" level. Or...
Alternatively, perhaps we could have a template parameter for the OTP macro's (unique) module name and generate a generic macro with ipgen (instead of having a non-ipgen prim:otp
). Stuff the generic macro we created in its own core file with a virtual VLNV. Then, otp_ctrl.core (and otp_ctrl.sv) could instantiate that module, instead of the non-ipgen prim_otp
, and depend on the virtual VLNV. We'd essentially be creating a virtual macro library on the fly with ipgen, and top level core files would choose either the generated generic macro or an integrator's own.
Would that make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, the "prim" CSR layout makes no sense to anyone but one particular integrator. Maybe that should become a top-specific, vendor-specific IP that gets instantiated at "chip" level. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess both are a separate discussion. They do make sense but we firs should get otp_ctrl to ipgen and then iterate on that. Right now, this PR is gating to bringup Darjeeling on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess both are a separate discussion. They do make sense but we firs should get otp_ctrl to ipgen and then iterate on that. Right now, this PR is gating to bringup Darjeeling on master.
Oh, agreed on taking the incremental steps and not gating this PR on that particular issue. This was merely brought up for discussion.
ae0a055
to
790a60d
Compare
c601e25
to
64a68f5
Compare
This commit is similar to other ipgen conversions, but changes a few extra things because it needs to change the generation of otp memory images. It merges the following 32 individual commits: - Fix OtpMemMap exception message - Improve handling template parameters by ipgen - Add doc and avoid redundant declaration. - Move otp_ctrl images and mmap hjson out of hw/ip - The files that are top-specific moved to hw/top_earlgrey/data/otp - Adjust lots of paths to match this change - Move otp_ctrl_img.c.tpl to util/design/data since it is generic - Move the documentation of otp image generation to util/design/README.md - Add otp_ctrl ipgen tpldesc hjson file - Copy all hw/ip/otp_ctrl files to ip_templates - This is a straight copy with no changes to the files. - Remove generated files - There is no use for files in ip_templates that will end up being generated. - Move template files to their specific directories - Turn a few more files into templates and fix paths - The template files are almost identical to the previous ones, except - they use ${topname} instead of a specific name - consecutive '#' are escaped so they are not considered hugo comments; for example, ### is replaced by ${"###"} - text bracketed by CMDGEN is removed - 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. - Fix some incorrect links to docs. - Move top-specific items out of otp_ctrl_pkg - Move top-specific and implementation items to otp_ctrl_top_specific_pkg. - Create separate core files for both packages. - Adjust multiple sv files to use the right package. - Remove unused lc_otp_token_{req,rsp}_t. - Fix core files - Change most core file into templates, use instance_vlnv, and declare a virtual target. - Change otp_ctrl_sim_cfg.hjson into a template since it uses a template fusesoc core. - Change templates to use plain dictionaries - In practice this just removes redundant config token. - Block building template targets - Add otp_ctrl in hw/ip_templates/BUILD all_files. - Template files are only intended for code generation, so it makes no sense to use them to build targets. - Remove gen_comment from templates - The comment regarding generation for ipgen artifacts will be dealt with uniformly in the PR that fixes lowRISC#25444. - Remove gen_comment from the tpldesc file. - Add code in OtpMemMap to support ipgen - Create packages for design.lib and design.mubi. - gen-flash-img depends on modules that import topgen modules so it needs to have topgen in sys.path. This was not needed for some reason, perhaps the introduction of packages ends up requiring it. - Place darjeeling mmap and img files under hw/top_darjeeling - This is similar to the new placement of the corresponding earlgrey files. - Fix the copyright banner. - Block generation of dif artifacts - These artifacts need to be placed under top-specific directories. - When the sw side is ready for that, change the flow to create the per top generated files in the right place. - Create otp_ctrl with ipgen - Create both earlgrey and darjeeling otp_ctrl with topgen.py via ipgen. - As a side effect some random constants are changed, since there are more requests for random numbers in topgen. - Make util/design/gen-otp-mmap.py compatible with otp_ctrl ipgen - This tool may become obsolete, but it is best to upgrade it per the ipgen flow. - Comment out dif generation, and add a TODO with an explicit issue. - Add mmap_def argument in bazel's otp_image_consts - Remove unnecessary otp link in md file - This avoids the confusion about which top to refer to. - Generate otp_ctrl difs via ipgen - Fix top level core files - Fix BUILD files - Use ip_autogen path for otp_ctrl_c_regs. - Use ip_autogen path for rust artifacts. - Change a few hw BUILD files for ipgen changes. - Fix reference to data/otp_ctrl.hjson in BUILD.tpl. - Fix image handling in dvsim sim.mk - Fix hjson files - Fix md files - Describe references to top-specific otp_ctrl as examples. - Fix BLOCKFILE - Fix documentation collateral - Fix englishbreakfast build - Remove otp_ctrl from top_englishbreakfast because it is not instantiated, but keep otp_ctrl_pkg since it shows in types of unconnected ports. - Remove obsolete otp-mmap check from ci - Remove legacy files - Update hw/ip/README.md file Fixes lowRISC#25019 Signed-off-by: Guillermo Maturana <[email protected]>
This commit is similar to other ipgen conversions, but changes a few
extra things because it needs to change the generation of otp memory
images. It merges the following 32 individual commits:
generated.
for example, ### is replaced by ${"###"}
file used to process the contents of a given file.
a virtual target.
fusesoc core.
no sense to use them to build targets.
with uniformly in the PR that fixes [ipgen] Insert per-ip DO NOT EDIT comment #25444.
needs to have topgen in sys.path. This was not needed for some reason,
perhaps the introduction of packages ends up requiring it.
per top generated files in the right place.
are more requests for random numbers in topgen.
the ipgen flow.
but keep otp_ctrl_pkg since it shows in types of unconnected ports.
Fixes #25019