<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/21/2017 10:26 PM, Joel Sherrill
wrote:<br>
</div>
<blockquote
cite="mid:CAF9ehCUfL7dt7WekUMhf1WX+8ZZGVRiJChuh4nzfG2zhoLjGqQ@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Mar 21, 2017 at 5:17 AM, Jiri
Gaisler <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:jiri@gaisler.se" target="_blank">jiri@gaisler.se</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>The culprit seems to be the CASA instruction. The
leon3 bsp is built to always need this instruction,
regardless if SMP is enabled or not. The sis simulator
does not support CASA at the moment, hence the
failures. The erc32 and leon2 bsp does not use CASA
since the hardware does not support it. If the leon3
bsp is supposed to always require CASA, then it should
be noted in the bsp documentation as not all leon3
hardware actually supports CASA.<br>
</p>
</div>
</blockquote>
<div><br>
</div>
<div>Hmmm... I let this sit so I could think. I wanted to
make sure we didn't</div>
<div>head down a path of needing another BSP variant or
multilib variant</div>
<div>unnecessarily.</div>
<div><br>
</div>
<div>Where is this instruction used? I didn't see it in the
port or BSP. But</div>
<div>again "grep -i cas" has a LOT of output.</div>
<div><br>
</div>
<div>Do all SMP configurations have CASA? </div>
<div><br>
</div>
<div>Is the instruction optional in uniprocessor
configurations? If so, is</div>
<div>there a case where you must use it in uniprocessor
configurations?</div>
<div><br>
</div>
<div>Is this something in gcc (atomics?) that needs to be
more conditional</div>
<div>on the CPU model? And.. could that push us to a
multilib variant?</div>
<div><br>
</div>
<div>Sorry for sounding confused. I just would like to
understand when</div>
<div>the instruction is present and which knob settings we
have to set</div>
<div>and how to know when it is OK to use. So it starts
with knowing</div>
<div>when it is available in HW, when gcc might use it, etc.</div>
</div>
</div>
</div>
</blockquote>
<br>
The CASA (compare and swap) is present in the gcc multi-libbed
libraries such as libatomic.a and libsupc++.a. The CASA is only
present when the -mcpu=leon3 option is used, which is default for
the leon3 bsp. So I think that it would be sufficient to note in the
documentation that the default settings in the leon3 bsp requires
support for CASA in the hardware. By removing -mcpu=leon3 from
CPU_FLAGS in the leon3.cfg, the bsp can be built to work without
CASA in the hardware. I have tested this, and some tests that
previously failed (e.g. cdtest.exe) then worked OK on sis-leon3. I
will however probably not work (well) with SMP.<br>
<br>
Other tests (e.g. sp69.exe) still fails on sis-leon3, but this is a
problem in the leon3 port of sis and I am trying to fix it right
now.<br>
<br>
To simplify testing in the future, I have added support for CASA to
the leon3 port of sis. This makes it possible to test bsps both
without CASA (erc32 & leon2) and with CASA (leon3).<br>
<br>
I will make new patches for sis once I have everything sorted...<br>
<br>
Jiri.<br>
<blockquote
cite="mid:CAF9ehCUfL7dt7WekUMhf1WX+8ZZGVRiJChuh4nzfG2zhoLjGqQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div>Thanks.</div>
<div><br>
</div>
<div>--joel</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p> </p>
<span class="">
<p>Jiri.<br>
</p>
<br>
<div class="m_-1036062497363605894moz-cite-prefix">On
03/19/2017 02:32 PM, Joel Sherrill wrote:<br>
</div>
</span>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">Hi
<div><br>
</div>
<div>I was following up on Gedare's testing and
tried leon3. There</div>
<div>were a surprising number of failures there
with SMP disabled.</div>
<div>This is testing with gdb. Does anyone else
get the same </div>
<div>results with qemu or tsim? Any idea what's
broken?</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>Passed: 458</div>
<div>Failed: 20</div>
<div>Timeouts: 73</div>
<div>Invalid: 3</div>
<div>-------------</div>
<div>Total: 554</div>
<div><br>
</div>
<div>Failures:</div>
<div> cdtest.exe</div>
<div> spintrcritical20.exe</div>
<div> dl05.exe</div>
<div> spintrcritical01.exe</div>
<div> spintrcritical04.exe</div>
<div> spintrcritical10.exe</div>
<div> spintrcritical22.exe</div>
<div> sp69.exe</div>
<div> spintrcritical21.exe</div>
<div> sp11.exe</div>
<div> spintrcritical16.exe</div>
<div> spintrcritical23.exe</div>
<div> psxfile01.exe</div>
<div> spintrcritical05.exe</div>
<div> spintrcritical02.exe</div>
<div> spintrcritical08.exe</div>
<div> psxgetrusage01.exe</div>
<div> spcpucounter01.exe</div>
</div>
<div><br>
</div>
</div>
<br>
<fieldset
class="m_-1036062497363605894mimeAttachmentHeader"></fieldset>
<br>
</div>
</div>
<span class="">
<pre>______________________________<wbr>_________________
devel mailing list
<a moz-do-not-send="true" class="m_-1036062497363605894moz-txt-link-abbreviated" href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a>
<a moz-do-not-send="true" class="m_-1036062497363605894moz-txt-link-freetext" href="http://lists.rtems.org/mailman/listinfo/devel" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a></pre>
</span></blockquote>
</div>
</blockquote></div>
</div></div>
</blockquote>
</body></html>