-
Notifications
You must be signed in to change notification settings - Fork 43
CachePlugin with wayCount=1
gets eventually stuck loading the same data
#131
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
Comments
Hi, It isn't a hardware bug, but more a by design dead lock. Fondamentaly, what would be needed to avoid that, is to update the L1 D$ refill slots to incorporate some cycles of locking once the refill is done. Around there :
I would say, use at least 2 ways, as 1 is just a performance killer. |
Thanks for the fast reply!
Not really a conscious choice I made, but rather the current default: NaxRiscv/src/main/scala/naxriscv/platform/asic/NaxAsicGen.scala Lines 71 to 72 in 1c50e84
|
Hoo right. It was to keep things as small as possible for P&R trials. I can just change the default to 2 as a default, ok for you ? |
Wouldn't it still be possible to face the same problem with more than |
I think there is a limit into it, which is the latency between a refill completion and the retry. |
Sure, I attached the complete simulation project and a GTKwave save file positioned roughly at the time when the redo bit is no longer cleared. nax_debug_1.gtkw.txt I am using this patch Nax5.patch.txt and the following command: Let me know if you need more info to reproduce the issue. |
Thanks ^^ Hmm make => |
I guess you are using a too old verilator version. You can probably just remove line 22 from the makefile which adds this argument |
Right ^^ Then make =>
Hmmm maybe it is tooo upstream XD |
Ah yes, that's a known upstream issue. As a hacky workaround, I am applying this patch to remove the assertion XD Another workaround is to let verilator generate a vcd trace instead, though this is going to be a very very large file. IIRC, the attached archive should already contain a dump.fst in the simulation folder. |
Hoooo right, sorry, i missed it XD |
So looking at the wave. A ideal fix would be to prevent a cache line recently loaded to be unloaded so soon. That could be done by extending the refill slots in the DataCache design. |
I am using a patched version of the NaxAsicGen target (mainly to generate AXI memory interfaces and to change memDataWidth and fetchDataWidth to 32 bit).
Note that I am using the
inferred
ramBlocks.I tried running a simple FreeRTOS binary on the core and noticed that the core was getting stuck during two load word instructions:
Essentially, the redo bit is never cleared and the core keeps sending read requests for the same two addresses in the load queue.
If I set the
wayCount=2
for bothFetchCachePlugin
andDataCachePlugin
, the core is no longer stuck and continues to execute just fine.(I have not tested if it is actually necessary to change the
wayCount
for both plugins)Thus, I suspect that there must be some bug that only shows up with
wayCount=1
.The text was updated successfully, but these errors were encountered: