-
Notifications
You must be signed in to change notification settings - Fork 60
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
Infinite RAW stall in floating-point code #304
Comments
Hi and thanks for the bug report and for the easy-to-reproduce case. I tried running the attached code and verified that indeed this seems to be a bug (actually, it seems like there are several bugs here). It'll take me some time to fix them :) I hope to have some time next week-end. Thanks a lot and to your students for contributing to raising the quality of our simulator! |
I have one question to you: could you please allow me to use your code as a unit test for EduMIPS64, releasing it as GPL code? That will allow me to use it as a regression test once I fix the bug(s). Thanks! |
Thanks for your reply – that was fast! Yes, you may use the code as needed. --Joan
Dr. Joan Carletta
Associate Dean for Undergraduate Studies
College of Engineering
The University of Akron
Akron, OH 44325-3901
Office: 330-972-7691
www.uakron.edu/engineering/<http://www.uakron.edu/engineering/>
[Wordmark for The University of Akron]
From: Andrea Spadaccini <notifications@github.com>
Reply-To: EduMIPS64/edumips64 <reply@reply.github.com>
Date: Sunday, April 5, 2020 at 4:27 PM
To: EduMIPS64/edumips64 <edumips64@noreply.github.com>
Cc: "Carletta,Joan E" <carlett@uakron.edu>, Author <author@noreply.github.com>
Subject: Re: [EduMIPS64/edumips64] Infinite RAW stall in floating-point code (#304)
CAUTION: This email originated from outside of The University of Akron.
I have one question to you: could you please allow me to use your code as a unit test for EduMIPS64, releasing it as GPL code? That will allow me to use it as a regression test once I fix the bug(s). Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEduMIPS64%2Fedumips64%2Fissues%2F304%23issuecomment-609477223&data=02%7C01%7Ccarlett%40uakron.edu%7C732ba5181da44807cda408d7d99fc243%7Ce8575dedd7f94ecea4aa0b32991aeedd%7C0%7C0%7C637217152491688199&sdata=%2FrELZvXhHOD%2BKSScuTpo%2FRwx5QlQISfKACmYxfbNbrk%3D&reserved=0>, or unsubscribe<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPCHQIIFASPJCWL2EMMOQH3RLDSS7ANCNFSM4MBLJRCA&data=02%7C01%7Ccarlett%40uakron.edu%7C732ba5181da44807cda408d7d99fc243%7Ce8575dedd7f94ecea4aa0b32991aeedd%7C0%7C0%7C637217152491698153&sdata=nICTExmM2BDfO9qcXwpbANE1bUKgwWh9sbD0r6lfyoE%3D&reserved=0>.
|
Thank you very much! I found and fixed the bug where MEM/WB for one instruction were not executed (4e65f11), just need to add a regression test for it. Unfortunately the bug where MEM/WB are not visible in the Cycle UI is harder to fix and will require a couple of hours of work, I hope to be able to do it next weekend and push out a new release. I hope you can live with the temporary workaround that you found for the time being. Thanks again for the bug reports! |
I truly appreciate the work you’ve done! This will help my students a lot, and we can definitely workaround the MEM and WB stages not being visible in the Cycles window. –Joan
From: Andrea Spadaccini <notifications@github.com>
Reply-To: EduMIPS64/edumips64 <reply@reply.github.com>
Date: Sunday, April 5, 2020 at 6:59 PM
To: EduMIPS64/edumips64 <edumips64@noreply.github.com>
Cc: "Carletta,Joan E" <carlett@uakron.edu>, Author <author@noreply.github.com>
Subject: Re: [EduMIPS64/edumips64] Infinite RAW stall in floating-point code (#304)
CAUTION: This email originated from outside of The University of Akron.
Thank you very much! I found and fixed the bug where MEM/WB for one instruction were not executed (4e65f11<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEduMIPS64%2Fedumips64%2Fcommit%2F4e65f115736d1e629ec2d1ee29f674eb0d97c52a&data=02%7C01%7Ccarlett%40uakron.edu%7C3fc4aefc65bf4902f85d08d7d9b4ef7d%7Ce8575dedd7f94ecea4aa0b32991aeedd%7C0%7C0%7C637217243450507110&sdata=NvQMGsXIFfasrGS7haVGBEnTVCFdePQ8VHSotbwAMm0%3D&reserved=0>), just need to add a regression test for it.
Unfortunately the bug where MEM/WB are not visible in the Cycle UI is harder to fix and will require a couple of hours of work, I hope to be able to do it next weekend and push out a new release.
I hope you can live with the temporary workaround that you found for the time being. Thanks again for the bug reports!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEduMIPS64%2Fedumips64%2Fissues%2F304%23issuecomment-609499166&data=02%7C01%7Ccarlett%40uakron.edu%7C3fc4aefc65bf4902f85d08d7d9b4ef7d%7Ce8575dedd7f94ecea4aa0b32991aeedd%7C0%7C0%7C637217243450517103&sdata=gFCOdNkgIRnhf8nVSpdO1JbEsfUfSEyqsTyEnNqU3%2Bs%3D&reserved=0>, or unsubscribe<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPCHQII4CAFFKF7MD2DIXXTRLEELNANCNFSM4MBLJRCA&data=02%7C01%7Ccarlett%40uakron.edu%7C3fc4aefc65bf4902f85d08d7d9b4ef7d%7Ce8575dedd7f94ecea4aa0b32991aeedd%7C0%7C0%7C637217243450517103&sdata=pysAEvjTLiTg2YwuDrWt1ov2wf9EUST90fWRPc%2BaLiI%3D&reserved=0>.
|
Note to self on things to do:
|
Sorry for the delay, busy week. I hope to have some time this weekend or next week! |
@jcarletta the standalone JAR from the latest commit to Once I manage to fix the second bug as well I'll release a new version (1.2.7) with both fixes. |
This fixes #304, but may not work in all cases.
@jcarletta just released v1.2.7, which should contain a fix for both issues: https://github.com/EduMIPS64/edumips64/releases/tag/v1.2.7. Thanks a lot for the detailed bug report! |
It seems that this bug is appearing in some other place. The following program causes EduMIPS to stall endlessly due to a RAW dependency on F8: .data
v: .space 256
w: .space 256
x: .double 2.0
y: .double 1.5
z: .double 0.0
.text
daddi R1, R0, v
daddi R2, R0, w
daddi R3, R0, 256
ldc1 F2, x(R0)
ldc1 F4, y(R0)
daddi R4, R0, 0
loop1:
dmtc1 R4, F6
daddi R4, R4, 8
cvt.d.l F6, F6
mul.d F8, F2, F6
mul.d F10, F4, F6
dmtc1 R4, F12
daddi R4, R4, 8
cvt.d.l F12, F12
mul.d F14, F2, F12
daddi R1, R1, 16
mul.d F8, F8, F8
daddi R2, R2, 16
sdc1 F10, -16(R2)
mul.d F14, F14, F14
mul.d F16, F4, F12
sdc1 F8, -16(R1) ; here
sdc1 F14, -8(R1)
sdc1 F16, -8(R2)
bne R4, R3, loop1
syscall 0 Weirdly, the I've tried running the program with release 1.2.9 and the latest release on the CI (1.2.9-alpha-bbb71d8). The code is part of a class assignment, so I cannot release it under an open source license for regression tests atm. |
Thanks for the report @hugmanrique, I'll have a look at this as soon as possible! |
I tried running your code and indeed I can see the stall when I enable forwarding. |
The |
I am going to reopen this issue to keep track of the problem. |
I appreciate this! My class is using EduMIPs again this year; it's very helpful to them. |
I found the issue and should have fixed it. @hugmanrique, would you be ok now with me using your sample code as a unit test? |
I'd love to add the test into #649 before merging, if possible @hugmanrique. |
Sure, go ahead. I can now release the code to the public domain. Thank you for the fix! |
This test would have exposed the second reoccurrence of issue #304. Thanks to @hugmanrique for this code.
Added, thanks @hugmanrique ! |
Fixes #304. * fix: do not wipe EX on FP-induced WAW stalls Similar to #305 (which originally fixed #304), add a check on whether EX is empty before inserting a BUBBLE instruction. Also add some more verbose logging to help reason about the flow without having to use a debugger. * test: add a regression test for issue 304 This test would have exposed the second reoccurrence of issue #304. Thanks to @hugmanrique for this code. * fix: fix merge conflict resolution error
The attached code exposes an apparent bug in EduMIPS; I tested in v1.2.6 (standalone) and v1.2.5. For this code, floating-point instructions reach the MEM stage at the same time that an integer instruction does. The integer instruction's MEM and WB stages are apparently never accounted for, and a consequent integer instruction infinitely RAW stalls.
My students found this bug in working on a project. (EduMIPS has been a great learning tool overall for my class.) I've pared out some code that wasn't need to expose the bug, and
added comments about what I see in the cycle window and register values that is not accurate.
Infinite RAW stall code.txt
The text was updated successfully, but these errors were encountered: