-
Notifications
You must be signed in to change notification settings - Fork 332
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
Move firmware to common directory #82
base: main
Are you sure you want to change the base?
Move firmware to common directory #82
Conversation
…y split out the various components
…ecessary cmake files to build them
…laced into separate libraries later on
and added the mprj_stimulus test
Hey @AdamWRichardson. First, thank you for your contribution. It is always nice to see the merits of the open-source world. I can see that the main motivation here is to isolate the firmware and test benches. There were some attempts to do that here. And, currently caravel_user_project references the firmware inside litex repo. As usual there is room for improvement but perhaps you weren't aware of that structure. Nonetheless, can I ask you to highlight the benefit of what you are suggesting vs the current direction used in the litex repo. |
Hi @kareefardi thanks for your reply, I wasn't aware of this structure but I see several advantages to this approach rather than the approach in the
Can I ask how the |
Hi again @kareefardi is there any update on this? Would you like me to close this pull request or something else? |
Hey @AdamWRichardson. Sorry, I have been quite busy and didn't have the time to review this. I did not actually catch your edit above. I will take a look and answer your questions. Meanwhile let's keep it open. I can see merits to adding this. I skimmed through your fork and I do have one question, perhaps a silly since I didn't look thoroughly: I noticed that the simulation testbench files themselves (.v) still do exist under verilog/dv/ and then the makefile inside verilog/dv calls cmake. But, for instance, wb_port.c and wb_port.tb are somewhat coupled. Isn't that a bit confusing? Also, how would it work if we are to separate the firmware to separate repo? One more thing, please keep in mind that if we merged this, testbenches in litex repo should be also consistent with this. |
No worries, there's no rush it was just friendly nudge 👍 One of the main motivations behind this change is to allow the firmware to be developed independently of the RTL, including the testbenches. For now with this merge the two would still be in step and are closely coupled, but maybe in the future they can be decoupled more easily. One way of doing this is to have only 1 testbench that simulates everything and the firmware decides whether the test has passed or not using a standardised method (e.g. writing a particular string to a particular peripheral). In my experience this has been the more common approach to firmware testing but initially they would remain coupled. There wouldn't necessarily be any change if the firmware is in a separate repo because it will be submoduled by all repos that need it, including this one. Then the firmware could still be visible and built from wherever is reasonable to submodule it (I'm thinking of submoduling at the root of the repo but maybe there's a better place for it). |
Hi @AdamWRichardson we really appreciate your contribution and we're looking into ways to merge your contribution, but please put in mind that this is a huge change that would need time to study.
Questions/Requests:
Thank you for your contribution and your quick response to questions. |
Hi @marwaneltoukhy thanks for the reply and again there's no rush at all, happy to provide help and knowledge where I can 😄
Is there a reason you're not submoduling the litex repo? I'm probably missing something here.
I have not, could you point me to the makefiles/directories for running a litex sim? This PR is very much an initial idea and there's probably still work to be done to get everything working as expected, but happy to attempt if I can.
I will do a merge now.
The only extra things required are
The directory structure I've used is a fairly standard one for C/C++ projects. Although it is also similar to RTL as it separates the libraries (includes) from the implementation (src). Is this what you mean by difference in the directory structure?
For now you would add the Hope this helps! |
# Conflicts: # Makefile # caravel_firmware/src/testcases/la_test1/main.c
This is a large set of changes which moves the firmware into a single place. Motivation can be found in the read me which I wrote as part of these changes.
Eventually the firmware directory can be made it's own repo and "submoduled" in this repo but this is the first step to that move
TODO in this PR:
TODO out of scope of this PR: