This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

能否手动映射L2到L1D cache中



对L2数据做读操作时,数据会被缓存在L1Dcache中,L2同L1D之间的cache一致性由硬件自动维护,使用起来很方便,同时也增加了程序运行的效率。

在已经知道接下来要对L2一块内存区域做数据读写的情况下,能否在读写程序执行之前,自主的建立L2到L1D cache之间的联系,或是将此段L2中的数据数据缓存到L1Dcache中。

  • Yun,

             可以用附件中的touch函数来达到您的目的。 在读写数据前先调用一下touch函数

           void touch    (                                                                  

              const void *array,             /* Pointer to array to touch */  
              int         length             /* Length array in bytes     */  

           );                                                                

     

    touch.asm