<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mv="http://macVmlSchemaUri" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:Consolas;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2139570937;
mso-list-type:hybrid;
mso-list-template-ids:1575786118 -1830881662 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:45.0pt;
text-indent:-27.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Consolas">Hello Joel:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">She is using the following function:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:Consolas">uint64_t rtems_clock_get_uptime_nanoseconds (void)
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:Consolas">Returns the system uptime in nanoseconds.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Is this a monotonic time source? Could something preempt this function?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Could she also use:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:45.0pt;text-indent:-27.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-family:Consolas"><span style="mso-list:Ignore">1)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-family:Consolas">The RTEMS Rate Monotonic Manager, or the<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:45.0pt"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:45.0pt;text-indent:-27.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-family:Consolas"><span style="mso-list:Ignore">2)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-family:Consolas">POSIX clock_gettime() ?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Regards,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">-----------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">* Amalaye Oyake *<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">* Instrument Product Software Development Group */\ *<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">* Jet Propulsion Laboratory, Pasadena *|| *<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">* /||\ *<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">**************************************************^^***<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Consolas;color:black">From: </span>
</b><span style="font-family:Consolas;color:black">users <users-bounces@rtems.org> on behalf of Janet Schneider <janetsc@fb.com><br>
<b>Date: </b>Wednesday, December 7, 2016 at 1:38 PM<br>
<b>To: </b>"joel@rtems.org" <joel@rtems.org><br>
<b>Cc: </b>"users@rtems.org" <users@rtems.org><br>
<b>Subject: </b>Re: 1kHz timer behavior on Cyclone V<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<div id="divtagdefaultwrapper">
<p><span style="font-family:Consolas;color:black">Hi - thanks for the responses!<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">It is a very simple application that is only processing a 1 kHz timer for the purposes of this test. There is no other CPU load on the system. The only thing I do right now when the timer fires is calculate
the time difference since the last timer fired. Once a second, I output the average, min and max for that second.<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">I do have a delay it the main task, since it is just sitting there idle. Would that account for such an increase in the time between the timer firing?<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">I will try the POSIX API next.<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">Thank you,<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black">Janet<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:Consolas">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-family:Consolas;color:black">From:</span></b><span style="font-family:Consolas;color:black"> Joel Sherrill <joel@rtems.org><br>
<b>Sent:</b> Wednesday, December 7, 2016 1:15:23 PM<br>
<b>To:</b> Janet Schneider<br>
<b>Cc:</b> users@rtems.org<br>
<b>Subject:</b> Re: 1kHz timer behavior on Cyclone V</span><span style="font-family:Consolas">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">On Wed, Dec 7, 2016 at 11:44 AM, Janet Schneider <<a href="mailto:janetsc@fb.com" target="_blank">janetsc@fb.com</a>> wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div id="m_-775959500229506860divtagdefaultwrapper">
<p><span style="font-family:Consolas;color:black">Hello,<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">I am running a 1kHz timer test on the Altera Cyclone V dev board. I am trying to measure the average time period between the timer firing, and any variance on that latency.<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">I'm seeing an average of 1003 microseconds between the timer firing. About once a second, I see the maximum time between the timer firing go up to 2500-3000 microseconds.<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">There are two sets of timers. One is per clock tick and one is per second.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">My guesses are:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">Do you have a sleep/delay statement in your thread?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">There may be some work updating the time that occurs once per second. The implementation of this area has changed so I don't remember offhand if this is still the case.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div id="m_-775959500229506860divtagdefaultwrapper">
<p><span style="font-family:Consolas;color:black">I'm using rtems_clock_get_uptime_nanoseconds() to measure the time that the timer fires. I have CONFIGURE_MICROSECONDS_PER_TICK set to 500.<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">What happens when the HW interrupt timer fires?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Consolas">--joel<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div id="m_-775959500229506860divtagdefaultwrapper">
<p><span style="font-family:Consolas;color:black">Has anyone else seen this (or something similar)? Any ideas what might be happening here?<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p><span style="font-family:Consolas;color:black">Thanks,<o:p></o:p></span></p>
<p><span style="font-family:Consolas;color:black">Janet<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-family:Consolas"><br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.rtems.org_mailman_listinfo_users&d=DgMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=ipHQnEo1XnvLdE9wWxwn7A&m=PSdN3QZ704zCArL-e2FC8HNKBuxOYGI0eRi5dMuQb4c&s=eTxFRJzt-tRGJuYUztqYK5Oxmhq9j8bfp3the-WZgl4&e=" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></span></p>
</blockquote>
</div>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>