[Libre-soc-bugs] [Bug 855] add libre-soc to kestrel
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Mon Jul 4 23:10:56 BST 2022
https://bugs.libre-soc.org/show_bug.cgi?id=855
--- Comment #16 from tpearson at raptorengineering.com ---
Very quick update in advance of a more detailed update tomorrow...
Tracked the main Zephyr problem down to a specific section of mis-executed
assembler:
subf r9,r29,r31
addi r9,r9,999
lis r30,8388
ori r30,r30,39845
rldicr r30,r30,32,31
oris r30,r30,58195
ori r30,r30,63439
mulhd r30,r9,r30
sradi r10,r30,7
sradi r30,r9,63
subf r30,r30,r10
clrldi r30,r30,32
What this is supposed to do is basically:
ceiling_fraction(deadline - now, MSEC_PER_SEC);
where ceiling_fraction is defined as:
#define ceiling_fraction(numerator, divider) \
(((numerator) + ((divider) - 1)) / (divider))
r31 is "deadline", set to 8480 decimal
r29 is "now", set to 480 decimal
The correct output would be 8 decimal, stored in in r30. What's actually
returned is zero, which causes all manner of chaos in the timing systems of
Zephyr.
I've verified this mis-execution on real hardware and in simulation. I'm
working on reducing the test case down and identifying the actual broken
instruction.
I'll also be uploading the requested branches tomrorow, just wanted to get this
out there in case it sparks some ideas in the interim.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list