-
Notifications
You must be signed in to change notification settings - Fork 805
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
[dv,mem_bkdr_util] Separate out flash_bkdir_util #26081
base: master
Are you sure you want to change the base?
Conversation
filesets: | ||
files_dv: | ||
depend: | ||
- lowrisc:opentitan:bus_params_pkg |
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.
Are these dependencies all needed or do the already get pulled in from the mem_bkdr_util? Or is it just a safeguard?
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've dropped a couple but I think the rest are all needed. I would observe that many of our core files appear not to be as minimal as they could be if they relied upon transitivity. I am a bit apprehensive about breaking an untested build, and I'm sure CI is far from complete w.r.t. that.
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.
Looks good with one question.
01b73d5
to
e11ef56
Compare
Separate flash support into another package so that designs such as Darjeeling can employ mem_bkdr_util without depending upon the flash controller/package. Signed-off-by: Adrian Lees <[email protected]>
e11ef56
to
36a1664
Compare
Did you consider the way this same issue was handled for otp_ctrl? It basically moved the complete specialization in otp_ctrl out to hw/ip_templates/otp_ctrl/dv/env: look at https://github.com/lowRISC/opentitan/blob/master/hw/ip_templates/otp_ctrl/dv/env/otp_ctrl_mem_bkdr_util_pkg.sv and https://github.com/lowRISC/opentitan/blob/master/hw/ip_templates/otp_ctrl/dv/env/otp_ctrl_mem_bkdr_util.core.tpl. Perhaps for flash_ctrl the flash_ctrl_mem_bkdr_util_pkg.sv will need to be a template, but at least in the otp_ctrl all specializations are accessed via the top specific pkg files. I think that approach is cleaner since it removes all traces of the flash_ctrl details from mem_bkdr_util, and mem_bkdr_utils simply takes care of reads and writes, which is what it does for a living. |
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 left a comment with my suggestion for how to do this. Also refer to #25891.
I am familiar with the way otp_ctrl was extracted, yes, and I think that makes sense for an ip_template that needs to be specialized for the different top levels. The single additional function required for flash support is a little different, in my opinion, since we're not specializing the flash controller for Darjeeling; it's just not present in the integrated design.
The separation in this PR does achieve that too. mem_bkdr_util no longer contains any reference to the flash package or any flash-specific functionality, which allows the Darjeeling top-level to brought up alongside that of Earl Grey for the first time, and simulations of both are now possible on my local branch without crosstalk between the two environments. If it's felt that the flash_bkdr_util package is too specific to belong in the dv/sv/ directory - and the same argument could apply to ROM- and SRAM-specific behavior - it could always be moved later since it's now self-contained. |
👍 |
I see this is a very simple change, but it adds clutter rather than addressing root causes. Basically this change will need to be undone and done the right way, so this kicks the can down the road hoping someone else will do the real fix, fully knowing what that fix should be. |
Implementing rom_, sram_ and flash_bkdr_util as extended classes of mem_bkdr_util means that they may be accessed without requiring specialized code and without needing to know what type of memory is being accessed, as requested here some time ago:
Also at a few other sites in the top-level DV where you can see things become tidier. This PR only separates the files into different packages and core files and I should have realized that was necessary when the extended classes were introduced; mea culpa. |
Separate flash support into another package so that designs such as Darjeeling can employ mem_bkdr_util without depending upon the flash controller/package.