<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: rdtsc equivalent on v4?</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201642#M9317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I program a spare DMA Timer to free-run at an appropriate rate, and use that for all "real time" measurements. Having it run at 1MHz is very convenient for the software as it doesn't involve any "human time to clock tick" conversions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following assumes that the timer is running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* * Define an architecture-neutral microsecond function. For * the mcf5329 CPU we're suing DMA Timer 1 to count * microseconds. */#define DEBUG_US()  (MCF_DTIM1_DTCN)

...
uint32_t nTimer = DEBUG_US();

... Do whatever ...

nTimer = DEBUG_US() - nTimer;
printf("Whatever took %dus\n", nTimer);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2012 08:14:44 GMT</pubDate>
    <dc:creator>TomE</dc:creator>
    <dc:date>2012-02-08T08:14:44Z</dc:date>
    <item>
      <title>rdtsc equivalent on v4?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201640#M9315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;does anyone have an idea how to best get something equivalent to the x86 rdtsc instruction on a v4 core (mcf548x specifically) for reading out a cycle count?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was considering using the second slice timer to count down from ffffffff, read the SCNT register&amp;nbsp; use the inverted value. The problem with that is that this is supposed to work from userspace, and the MBAR region is locked down to kernel accesses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Klaus&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2008 00:51:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201640#M9315</guid>
      <dc:creator>klaus</dc:creator>
      <dc:date>2008-11-13T00:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: rdtsc equivalent on v4?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201641#M9316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Did you ever come up with a solution to this. I'm trying measure CPU clock frequency. I was thinking of counting instructions in a loop and them using a timer to measure the time it took.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 02:07:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201641#M9316</guid>
      <dc:creator>mon3al</dc:creator>
      <dc:date>2012-02-07T02:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: rdtsc equivalent on v4?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201642#M9317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I program a spare DMA Timer to free-run at an appropriate rate, and use that for all "real time" measurements. Having it run at 1MHz is very convenient for the software as it doesn't involve any "human time to clock tick" conversions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following assumes that the timer is running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* * Define an architecture-neutral microsecond function. For * the mcf5329 CPU we're suing DMA Timer 1 to count * microseconds. */#define DEBUG_US()  (MCF_DTIM1_DTCN)

...
uint32_t nTimer = DEBUG_US();

... Do whatever ...

nTimer = DEBUG_US() - nTimer;
printf("Whatever took %dus\n", nTimer);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 08:14:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/rdtsc-equivalent-on-v4/m-p/201642#M9317</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2012-02-08T08:14:44Z</dc:date>
    </item>
  </channel>
</rss>

