-
Notifications
You must be signed in to change notification settings - Fork 265
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
axi_dw_downsizer: Fix i_forward_b_beats_queue
underflow
#323
Conversation
d228ebf
to
033bb1b
Compare
The first commit modifies the testbench to replicate the error originally found in Occamy. You can see from the Gitlab CI that the first commit fails with a I would revert the first commit and then I believe this should be ready to merge. If the |
b8e8d28
to
db0714c
Compare
I think it would be valuable to ensure this corner case is triggered in the future to prevent this fix from being removed, so it would be great if we could figure out a way to keep this task triggering the error as part of the CI. Could we trigger this with a few individual transactions? |
Thanks Michael :) It's been a long time so I have to familiarize myself with this again, but I'll look into options to keep it triggered. Probably have some notes in an old WR, but I remember it not being trivial. I'll let you know ASAP. |
db0714c
to
7c3bd9a
Compare
@micprog I've looked into this again, but it's not trivial to replicate the error in a manner which can be consistently tested by the CI. At this point I think we should just merge this accepting the risk you highlighted. If you give me green light, I will drop the first commit which was used to reproduce the error, such that the CI does not timeout. Then we should be able to merge. |
7c3bd9a
to
8c14809
Compare
@colluca Sorry for the delay. I see what you mean. I rebased the branch on master, let's make sure the current CI is passing with this fix. I also looked through the fix a bit more and understand what it aims to achieve. While it achieves what you are looking for, there may be some performance gain to be had by not only asserting --- a/src/axi_dw_downsizer.sv
+++ b/src/axi_dw_downsizer.sv
@@ -736,7 +736,7 @@ module axi_dw_downsizer #(
automatic addr_t slv_port_offset = AxiSlvPortStrbWidth == 1 ? '0 : w_req_q.aw.addr[idx_width(AxiSlvPortStrbWidth)-1:0];
// Valid output
- mst_req.w_valid = !forward_b_beat_full;
+ mst_req.w_valid = !(forward_b_beat_full && w_req_q.aw.len == 0);
mst_req.w.last = w_req_q.aw.len == 0;
mst_req.w.user = slv_req_i.w.user ; |
@micprog what you describe sounds correct to me, and the specific expression in the RTL looks correct as well. Good catch :) |
@colluca I found a way to force the error by forcing significant stalls on the B channel. Please check out the testbench modification and let me know if it makes sense to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another good catch, and LGTM :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good to merge now!
I will resort the commits a bit to update the TB appropriately and rebase on master |
Forces error fixed in #323
fd0ab24
to
165264b
Compare
Ensures last W beat is not sent if B fifo is full, allowing all W beats except last to pass.
e598510
to
d378616
Compare
The
forward_b_beat_push
signal should be asserted every time the lastW
handshake in a burst occurs on the master port. However, pushing to the FIFO should also be conditional onforward_b_beat_full
not being asserted.The way this second condition was ensured allowed the
W
handshake to occur, without tracking it through a push to the queue. The correspondingB
handshake would then trigger a pop, causing an underflow in the FIFO counter.This PR corrects this behaviour, by stalling the
W
handshake until the FIFO is no longer full, so it is ensured that pushing to the FIFO is possible.