ucb-bar / berkeley-hardfloat

Other
287 stars 87 forks source link

FSqrt returns two valid responses for one input. #15

Closed ccelio closed 7 years ago

ccelio commented 7 years ago

TL;DR: I am sending one fsqrt request to hardfloat.DivSqrtRecF64. I get back one response the cycle after and then a second response back ~20 cycles later.

Waveform below.


I am using commit (f38b8beeb3fbce40ee3d9c1e132c8f60ed05f4aa) which is what rocket-chip master uses (as well as the boom-devel branch of rocket-chip).


Questions:


screenshot 2017-03-25 at 11 53 32 pm
ccelio commented 7 years ago

I have set io.sqrtOp high because I assumed it was a DontCare if inValid is low. Reading ./docs/*.txt seems to imply that's the case.

In each clock cycle, input `inValid' is expected to be stable very early in   
the cycle.  The same is true of inputs `sqrtOp' and `b' whenever `inValid'    
is asserted.                                                                  

This particular error test-case would not trigger, but I'm not sure if that's just masking the issue.

aswaterman commented 7 years ago

Your assumptions about the interface seem to me to be correct.

It's impossible to tell where the bug is without the full waveform. It looks like there are other operations in flight before the operation in question, so is it not possible that the first response is to a previous request, rather than to the operation in question?

ccelio commented 7 years ago

Okay, looks like the problem is on my end.

I had counted requests and responses by eye and thought they were equal, but on closer inspection one request is held high waiting for ready to go high, but somehow misses a cycle of ready and stays high too long.

aswaterman commented 7 years ago

cool, thanks for sorting it out

ccelio commented 7 years ago

And thanks for the sanity check.