-
Notifications
You must be signed in to change notification settings - Fork 406
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
Connect Dromajo Simulator #415
Conversation
I'll leave this open for people to leave comments, recommendations. |
Great job, this looks very promising. |
Looks awesome! Please do PR some of your Dromajo changes so we can share improvements! |
@ccelio I will definitely PR the changes, I just want to get things cleaned up first! |
Does this turn off the DTM to prevent external agent/device polling? |
In Chipyard we use HTIF/TSI to bringup the core. I don't turn off the debug module. |
How do you co-simulate if HTIF/TSI can perturb the state of the system? I would think you would also have to simulate the side-effects of the HTIF/TSI actions. |
TSI only reads from the TOHOST addr in our systems. As long as it does no writes, we are good. |
@jerryz123 I went ahead and updated the release notes. Currently, you have to specify the binary and the dtb file with plusargs. Unfortunately, I don't think there is a way to make the binary plusarg go away. VCS doesn't have a default variable of some sort that I can check and get the binary file. As for the dtb, I need to modify Chipyard so Ill leave that for a later time since that is a bit ugly. Until that is fixed you can do |
Also, I will remove the default |
The DTB thing is fine for now. Can we really not get the args with Also can you merge some intermediate commits, and prepend them with [cosim]. |
05f816a
to
b4bb909
Compare
Done @jerryz123. This should be ready for review now... assuming CI passes. |
I am running all assembly/bmark tests with Dromajo and I am encountering divergences (I will look into it after Thanksgiving break). |
Ok. I resolved/figured out most of the divergences... here they are:
With that being said, I think we won't be running with Dromajo by default so not having these features is fine for now. I'll just wait until a patch for the |
TL,DR: I think you have to disable randomized memory. The problem is that some of the riscv-tests will access memory that has not been initialized first (for example, a load-reserve that doesn't care about what it is actually loading). Unless you randomize dramajo with the exact same memory pattern from boom, there's no hope of this really working (aside from expensively tracking whether each byte has been accessed yet, and if not, letting the DUT override dramajo, which means you have the same coverage hole anyways). This gets extra complicated because elf binaries have a For this reason, I recommend zeroing out all DUT memory. It's a small loss in coverage, but a huge removal of headaches. |
Yeah adding |
Is that too heavy-handed, or does that only affect the bootROM/bootRAM and simRAM? I believe in the past I used a modified simRAM/bootRAM model that zeroed out the memory, but let other SeqMems and Regs be randomized (which is nice for X-prop/reset bug hunting). Doing so is not unrealistic, since in the "real thing", you can freely zero out the bootRAM anyways. |
Unfortunately it does cause all regs to be zero initialized, which is annoying. I think we would like to continue using the SimAXIMem for the simRAM, which does not let us specifically zero out that memory. |
I’d consider pushing upstream a “zeroing” option to SimAXIMem (perhaps as a verilog define flag?). |
Yes. I ended up using the |
[lsu] AMOs should generate pf/ae_st. Do this by putting LR in the LDQ
This should be good to merge now. |
This looks good to merge, but there's lots of opportunity for more features.
|
Ill go ahead and make a GH issue to track improvements. But I think this is a good stepping stone to merge in for basic support.
I tested Linux boot (br-base + fedora + coremark) on FireSim. I haven't retried booting with Dromajo cosim. Though at the time, the failure was that uninitialized memory was getting read in. So I don't expect an issue.
I think we can just ignore any errors related to
Future work!
Future work! |
Sorry, I meant how far does it get when run with cosim? Can you start up a SW sim run with cosim, and the boot-binary? |
Running as we speak! |
As an update... we think this is good to merge. Linux tests are finding small bugs here and there which means this is working! So we will go ahead and merge after CI. |
* Move firemarshal into chipyard (was in firesim)
Related issue:
Type of change: new feature
Impact: new rtl
Development Phase: implementation
Release Notes
This adds the https://github.com/chipsalliance/dromajo simulator to BOOM for functional verification. Additionally, it has the following core changes:
misa
at runtimeDromajo Func Sim Notes
This uses a fork of Dromajo (https://github.com/abejgonzalez/dromajo) to do a couple of things:
To get the simulation running here is an example command that I used to get bare-metal tests working (BIN ==
baremetal-test
):make run-binary CONFIG=SmallBoomConfig BINARY=<BIN>
For Linux, I just ran the
br-base-bin
that comes with FireMarshal and it matches. Note: The Dromajo uart output will probably have alot of duplicated characters (centossssssssss
) because Dromajo doesn't have UART tx/rx fifos (on Linux a write is continually done until the txfifo is not full). So when co-simulating the UART output from the DUT will differ from Dromajo. Similar command (BIN ==br-base-bin
):make run-binary CONFIG=SmallBoomConfig BINARY=<BIN> SIM_FLAGS="+drj_dtb=\"<DTB_FILE>\""
Also, you need to change the VCS Makefile to include the following two lines in the compile:
To get the proper Dromajo inputs (MMIO, PLIC, etc), I had to modify the incoming
TileParams
and add the overall systemBootROMParams
,MemoryPortParams
,CLINTParams
, andPLICParams
. Additionally, the binary is taken from the VPI arguments (assuming HTIF is the bringup procedure).