<?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>topic Re: Disabling the MPC5554/e200z6 cache in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424181#M968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- I am trying to compare i) versus (ii-1 + ii-2). However, I think I shall actually compare (ii-1 + i) versus (ii-1 + ii-2) - I just noticed that disabling the cache without flushing it yields some strange timing behavior.&lt;/P&gt;&lt;P&gt;- Since the last bit of L1CSR0 disables the unified cache for both instructions and data, I was trying to make it data-only or instruction-only by disabling cache ways for instruction or data replacement.&lt;/P&gt;&lt;P&gt;- I am using copy-back mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I was not too clear in my question: I would like to know if (after a cache flush/invalidate) disabling it via L1CSR0[CE] or disabling all its ways for line replacement are equivalent ways of turning the cache off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Nov 2015 15:00:07 GMT</pubDate>
    <dc:creator>ricardofranca</dc:creator>
    <dc:date>2015-11-19T15:00:07Z</dc:date>
    <item>
      <title>Disabling the MPC5554/e200z6 cache</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424179#M966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While playing with the MPC5554 cache configuration, I am measuring execution times when running some code with several cache configurations. At some point, I tried to deactivate the cache using two different approaches (my code snippets use Green Hills asm syntax):&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i) Using the last bit of L1CSR0&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__asmleaf void turn_cache_off() {&lt;/P&gt;&lt;P&gt;mfspr r3, l1csr0&lt;/P&gt;&lt;P&gt;clrrwi r3, r3, 1&lt;/P&gt;&lt;P&gt;msync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;isync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;mtspr l1csr0, r3&lt;/P&gt;&lt;P&gt;isync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ii) Flushing/invalidating the entire cache, then disabling line replacement in all its ways&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ii-1) Flush+invalidate&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__asmleaf void flush_inv_cache_line(uint32_t flushed_way, uint32_t flushed_set) {&lt;/P&gt;&lt;P&gt;%reg flushed_way %reg flushed_set&lt;/P&gt;&lt;P&gt;mfspr r3, l1finv0&lt;/P&gt;&lt;P&gt;insrwi r3, flushed_way, 5, 3&lt;/P&gt;&lt;P&gt;insrwi r3, flushed_set, 7, 20&lt;/P&gt;&lt;P&gt;li r4, 2&lt;/P&gt;&lt;P&gt;rlwimi r3, r4, 0, 30, 31&lt;/P&gt;&lt;P&gt;msync &lt;/P&gt;&lt;P&gt;mtspr l1finv0, r3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void flush_inv_cache(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t j;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0u; i &amp;lt; 8u; i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (j = 0u; j &amp;lt; 128u; j++)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_inv_cache_line(i, j);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ii-2) Disabling line replacement&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__asmleaf void turn_icache_off() {&lt;/P&gt;&lt;P&gt;mfspr r3, l1csr0&lt;/P&gt;&lt;P&gt;li r4, 15&lt;/P&gt;&lt;P&gt;insrwi r3, r4, 4, 0&lt;/P&gt;&lt;P&gt;li r4, 1&lt;/P&gt;&lt;P&gt;insrwi r3, r4, 1, 8&lt;/P&gt;&lt;P&gt;msync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;isync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;mtspr l1csr0, r3&lt;/P&gt;&lt;P&gt;isync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__asmleaf void turn_dcache_off() {&lt;/P&gt;&lt;P&gt;mfspr r3, l1csr0&lt;/P&gt;&lt;P&gt;li r4, 15&lt;/P&gt;&lt;P&gt;insrwi r3, r4, 4, 4&lt;/P&gt;&lt;P&gt;li r4, 1&lt;/P&gt;&lt;P&gt;insrwi r3, r4, 1, 9&lt;/P&gt;&lt;P&gt;msync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;isync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;mtspr l1csr0, r3&lt;/P&gt;&lt;P&gt;isync&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that my code runs faster with the second approach, which gives me the impression that somehow there is still cache activity somewhere. Do you know what is missing for me to have the same timing behavior in both cases?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 09:37:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424179#M966</guid>
      <dc:creator>ricardofranca</dc:creator>
      <dc:date>2015-11-19T09:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the MPC5554/e200z6 cache</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424180#M967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- I am not sure which two point you are comparing together? ‘ii-1’ vs. ‘ii-2’ that is ‘Flush+invalidate’ vs. ‘Disabling line replacement’?&lt;/P&gt;&lt;P&gt;- MPC5554 has one unified cache, but your code turns icache off and&amp;nbsp; turns dcache off?&lt;/P&gt;&lt;P&gt;- are you using copy-back or write-through mode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 12:49:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424180#M967</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2015-11-19T12:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the MPC5554/e200z6 cache</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424181#M968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- I am trying to compare i) versus (ii-1 + ii-2). However, I think I shall actually compare (ii-1 + i) versus (ii-1 + ii-2) - I just noticed that disabling the cache without flushing it yields some strange timing behavior.&lt;/P&gt;&lt;P&gt;- Since the last bit of L1CSR0 disables the unified cache for both instructions and data, I was trying to make it data-only or instruction-only by disabling cache ways for instruction or data replacement.&lt;/P&gt;&lt;P&gt;- I am using copy-back mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I was not too clear in my question: I would like to know if (after a cache flush/invalidate) disabling it via L1CSR0[CE] or disabling all its ways for line replacement are equivalent ways of turning the cache off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 15:00:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424181#M968</guid>
      <dc:creator>ricardofranca</dc:creator>
      <dc:date>2015-11-19T15:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the MPC5554/e200z6 cache</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424182#M969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pay attention to erratum e3421 (page 25) - cannot this be the reason of your issue?&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/32bit/doc/errata/MPC5554_REVB.pdf"&gt;http://cache.freescale.com/files/32bit/doc/errata/MPC5554_REVB.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 12:40:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/424182#M969</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2015-11-20T12:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the MPC5554/e200z6 cache</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/1459984#M21200</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After all these years, I must find my old hardware to run the code again, but this erratum looks very consistent with the behavior I had described. Thanks a lot for your answer!&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 11:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Disabling-the-MPC5554-e200z6-cache/m-p/1459984#M21200</guid>
      <dc:creator>ricardofranca</dc:creator>
      <dc:date>2022-05-18T11:28:43Z</dc:date>
    </item>
  </channel>
</rss>

