[Libre-soc-bugs] [Bug 425] DIV overflow not being calculated correctly

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jul 10 03:07:08 BST 2020


--- Comment #6 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment 

> Well, I got the test to fail, the problem is either the pipeline is broken
> to the point where ra and rb in DivSetupStage and lots of other places are
> always 0, or nmigen's simulator is broken where it writes zeros to random
> wires in the .vcd file.

gtkwave unfortunately has bugs.

> I'd have to figure out where to add print statements for debugging or
> something, since there are so many layers of abstraction that I'm a bit lost.

a FSM would be one hell of a lot aimpler.

> I'm not really sure how to write a test case that just sets the inputs of
> the pipeline to values and runs it without needing all the extra stuff for
> handling instruction cancellation, matching against qemu, or matching
> against the model from the Power spec.

the result 0xfffffffd is correct.  it's the overflow calculation that is not.

i tested that by manually setting overflow to zero.

if you check the git commit diff at comment 1 you will see the places where i
added code comments for the locations which need checking.

i also listed the function.

it is possible by using yield x.y.z to drill down the clase structure and print
things that you need.  if they are private variables add them to self.

i typically use print dir(instance) to find the members, then do that again
print dir(instance.subinstance) it is laborious but gets there

i will help more tomorrow when it is not 3am.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list