-
Notifications
You must be signed in to change notification settings - Fork 141
Fix factorial.out #45
Comments
There are a few problems at once.
|
Thus the solution might be as one of the following:
|
|
Let's assume that |
The problem is that instruction |
That is pretty clear. I'm wondering which way should I choose to resolve the problem. To clarify I get it right:Now the only way of determining the RAW and WAR hazards is keeping the "state" of a register. When the write to register happen, it's considered to be The scheme fails, when the reads and writes are not in that strict order, like in our case:
Possible workarounds:I haven't found any hardware implementation of plain stalling algorithm, everywhere only the bypassing unit is described (and more complex pipelining, e.g. with score-boarding).
That solves a problem but introduces a kind of scoreboard just for almost nothing.
|
Please try to merge this version: viktor-prutyanov@ec693c5, it looks better, maybe it solves all the issues. |
Well, tried to run it, and unfortunately it failed. I will try to deal with it and find an error, maybe it is worth to find some small mistake. (Now it falls into endless loop right from the beginning, so something very mere error is likely to occur) |
Found an error. The variable
That was predictable though, as double write without reads among them should be specially handled in some of the ways. |
But in general the code is somewhat clearer and more readable. Probably I should enhance it, taking best from different variants? Or I may try to look for other assignment 4 accomplishments. |
If |
I'll proceed with merge, please wait until I finish it |
Done, you may proceed with your changes |
Thank you, I will proceed. |
It is the reason I like to set the most strict compiling rules :-) |
Yeah, it could have been incomparably easier to find the error source if those options had been enabled! |
I see some random bug, it occurs sometimes with different instruction opcodes:
|
I will review it. |
I found the reason, but I want you to find it too. |
Well, this is really intriguing. I have spent a couple of hours trying to reproduce this bug, but didn't manage to get such an error. Thus just started to examine the code... That's something tricky :-) I'm wondering how such an instruction, I will postpone the investigation a little bit, if you don't mind, as it is very time-consuming and won't probably give a wished result. |
Valgrind finds the problem instantly:
|
Problem with Factorial program.
To reproduce:
Error message:
The text was updated successfully, but these errors were encountered: