Directory structure hw/doc
I am often confused to find for example the *hjson file in the doc folder of hw/ip/* or hw/top_earlgrey.
The doc folder holds this config file as well as documentation.
I could imagine that the idea is that this is only an example config and therefore in doc.
But I would be interested what the rationale here is.
For top_earlgrey there is also a data subdirectory which would be in my opinion the more appropriate place to hold config data.
Sorry if I missed the original discussion and reopen an already discussed point.
@eunchan @sjgitty
At first, we only had config hjson file that is used to create the document. So it was natural to be placed at doc/ directory. Now we have register information also in the hjson. It is quite good to have hjson be in data/ .
Or, i think it is also OK to be placed at the IP top hw/ip/*/*.hjson as it is only a single file. Some modules need templating such as rv_plic. But it can be in tpl/ or data/ .
Thanks for raising the issue.
I agree that we should probably move all the templates into something like a data or tpl folder, together with the templating script. Otherwise the doc folder can get a bit cluttered with files that do not really belong there.
As for the hjson file itself I am not so sure though. I mean, it is still a documentation source file, just as the markdown file itself. We just happen to generate more artifacts from the hjson file now. I am not against moving it somewhere else, just wanted to say that I do not think it is completely misplaced ;).
Thanks @eunchan for explaining the history reasoning!
I would be in favor of putting files which hold config data into other different folder than doc as this information is reused by different functional components.
There are also template files which should be move somewhere else as well I guess, but not sure if it make sense to create tpl as well. At some point we have a separate folder for each file. But I think there is a distinction between to template files.
I do not want to trigger a new discussion concerning the folder structure right now, so maybe it makes sense to check in the call if there is a need?
@msfschaffner but the hjson is not just a documentation source? It is also the input for the register header, or am I mistaken here? I see your reasoning why it might not be misplaced, but I guess even having different ideas why something is somewhere could cause some kind of confusion later.
@towoe indeed, we do not only generate the documentation from it. As Eunchan said, this directory structure kind of grew over time, and the hjson file was initially placed in that folder as it was used for documentation only at the beginning. I am completely fine if we decide to move it somewhere else. I just want to avoid a proliferation of degenerate subfolders containing only one file ;).
Since this seems to be a possible source of confusion, it's probably good to quickly discuss this in the next call, yes.
Thanks for the response @msfschaffner. I think we are exactly in sync here, just wanted to make sure in my last comment that I did not have any incorrect assumptions.
Is there a particular proposal here? Let's take one piece of IP as a study in our next Silicon meeting and propose a change. I do agree things are a bit jumbled as files have been added organically over time. Good time to reshuffle now if we're going to do it. How about @towoe and @eunchan and @msfschaffner create a proposal doc for the 2019-10-08 meeting.
On Tue, Sep 24, 2019 at 2:26 PM Tobias Woelfel [email protected] wrote:
Thanks for the response @msfschaffner https://github.com/msfschaffner. I think we are exactly in sync here, just wanted to make sure in my last comment that I did not have any incorrect assumptions.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/opentitan/issues/256?email_source=notifications&email_token=AJZQKVOSJDUXQ4MZVNRC4VDQLKAXLA5CNFSM4IZ7H562YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7P3QBI#issuecomment-534755333, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZQKVNFIKFZYLNCF36CJTTQLKAXLANCNFSM4IZ7H56Q .
Yes, @towoe started a doc on that, but the proposal is not fully stable yet. We'll circulate as soon as we think it is (so it probably won't make it into tomorrows discussion)...
Is this possible to put all *.hjson file in one folder (i.e. input/config etc. in hw/ip/*) and indicate their purposes via dedicated suffixes? For instance, uart_reg.hjson for rtl and uvm register generation, uart_dv_plan.hjson is for dv plan, and uart_testplan.hjson for dvtestplan etc. Putting *.hjson files in different sub-dirs might be difficult to maintain and track.
@tunghoang290780 my understanding for keeping the configuration file in different locations has the aim that each IP is self contained. So all data for an IP is in one folder.
@tunghoang290780 my understanding for keeping the configuration file in different locations has the aim that each IP is self contained. So all data for an IP is in one folder.
@towoe: I mean for individual IP, all *.hjson file can be put in the same folder. Currently, they are placed in hw/ip/*/doc and hw/ip/*/dv etc.
@tunghoang290780 I think this is a DV-related question as some of these hjson files contain the DV testplan. @sriyerg may help answer this question.
@towoe can I nominate you as the "owner" of this issue in the sense that you try to close it before launch?
Ah, sorry @tunghoang290780.
@msfschaffner I will add a fix message to the PR so this issue will be close when merged.
Agree @tunghoang290780 - we will make the following changes to make it more unified:
- move ip/*/dv/*_dv_plan.md -> ip/*/doc/*_dv_plan.md
- move ip/*/dv/*_testplan.hjson -> ip/*/data/*_testplan.hjson
We only recently started adding these documents for DV so we originally decided to settle on putting them in the dv directory. But now, the doc and data directories are a more logical place to put those.
Thanks Sri
DV related files are covered in #600 and #618