opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

Move sw device code into sw/device folder

Open moidx opened this issue 7 years ago • 11 comments

Based on offline discussion between @asb, @tjaychen and @moidx. The proposed directory structure for software shall be as shown below. The device directory contains chip firmware, whereas host contains support tools.


├── device
│   ├── benchmarks
│   ├── boot_rom
│   ├── exts
│   ├── libs
│   ├── examples
│   └── tests
└── host
    └── spiflash

moidx avatar Jul 23 '19 18:07 moidx

Would it make sense to further divide device with subfolders for boot_rom and the rest to show the separation between the stages?

towoe avatar Jul 24 '19 11:07 towoe

Would it make sense to further divide device with subfolders for boot_rom and the rest to show the separation between the stages?

SGTM. Perhaps it is a good idea to also add a test folder now and limit the proliferation of hello_ programs.

PR lowRISC/stwg-base#806 is also brining an useful embedded library that can be used in both device and host targets. Perhaps we should also add a sw/third_party folder as well? In the long term this mapping can be used to satisfy hermetic build requirements.

moidx avatar Jul 24 '19 20:07 moidx

I think sw/vendor would be consistent with the rest of the repo. After all, we might vendor in some lowRISC software project for convenience.

We will need to later consider policy for when it makes sense to vendor something in vs rely on it as an external dep. We could for instance vendor in all Python libraries we depend on, but it doesn't seem particularly worthwhile given pip does a reasonable job (and we can always pin particular versions).

asb avatar Jul 27 '19 03:07 asb

@sriyerg

Sri pointed out that there is not currently a lot of thought on how we would support multiple tops simultaneously. We should open a separate PR to track this on how to modularize between common things and things specific to top.

tjaychen avatar Sep 23 '19 21:09 tjaychen

Do we imagine there being different toolsets for different toplevels in, say, the next 6-12 months? Unless we have something specific in mind I think we're better off keeping things simple and revisiting if the requirements change later.

asb avatar Sep 24 '19 08:09 asb

Hard to say, but I would guess no.

tjaychen avatar Sep 24 '19 22:09 tjaychen

#469 is pending on resolving this (or at least @moidx's review of #469). Can we get a resolution on this? I think the original proposal makes a lot of sense; a test/ subdir under device/ is probably also wise. Any objections so that we can get #469 moving?

sjgitty avatar Oct 19 '19 01:10 sjgitty

Updated initial comment. No objections from my part. I can submit an PR to start making progress.

moidx avatar Oct 19 '19 01:10 moidx

yeah i havent' started the move because there are a pile of docs with build instructions relying on sw/tests instead of sw/device/test so I was going to wait for those docs to land then start editing.

On Fri, Oct 18, 2019 at 6:13 PM Miguel Osorio [email protected] wrote:

Updated initial comment. No objections from my part. I can submit an PR to start making progress.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/opentitan/issues/27?email_source=notifications&email_token=AAH2RSQOPVNVKA25LZXQL3LQPJNKVA5CNFSM4ISTJR2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBWVF3Y#issuecomment-544035567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2RSQNCW3B4QNKYEU5TTLQPJNKVANCNFSM4ISTJR2A .

tjaychen avatar Oct 19 '19 01:10 tjaychen

Ok, went all out trying to make this into an atomic change #535.

moidx avatar Oct 19 '19 02:10 moidx

Addressed by PR lowRISC/opentitan#535.

moidx avatar Oct 29 '19 14:10 moidx