#include "stdio.h" #include #include #define core_num 0 #define MPAXL2 0x08000010 #define MPAXH2 0x08000014 #define TIMER0_BASE 0x2200000 volatile unsigned int *CNTLO = (volatile unsigned int *)(TIMER0_BASE+0x10); volatile unsigned int *CNTHI = (volatile unsigned int *)(TIMER0_BASE+0x14); volatile unsigned int *PRDLO = (volatile unsigned int *)(TIMER0_BASE+0x18); volatile unsigned int *PRDHI = (volatile unsigned int *)(TIMER0_BASE+0x1C); volatile unsigned int *TCR = (volatile unsigned int *)(TIMER0_BASE+0x20); volatile unsigned int *TGCR = (volatile unsigned int *)(TIMER0_BASE+0x24); void main() { volatile int *ptr, *ptr1; volatile unsigned int * mpaxl2 = (volatile unsigned int *)MPAXL2; volatile unsigned int * mpaxh2 = (volatile unsigned int *)MPAXH2; unsigned int st_u_bef[50]={0}; unsigned int st_u_aft[50]={0}; unsigned int st_l_bef[50]={0}; unsigned int st_l_aft[50]={0}; unsigned int value; int i = 0, j = 0; Cache_Size *size; Cache_getSize(size); *(PRDLO) = 0xFFFFFFFF; *(PRDHI) = 0x0FFFFFFF; *TGCR = ( *(TGCR) | (0x00000003)); *(TCR) = ( *(TCR) | (0x00400040)); TSCL = 0; ptr = (volatile unsigned int *)((0x0c000002) + (0x1000 *core_num)); ptr1 = (volatile unsigned int *)((0x80000000) + (0x1000 *core_num)); *(mpaxh2) = (0x0c00000b + (0x1000 * core_num)); *(mpaxl2) = (0x0c0000bf + (0x1000 * core_num)); *(mpaxh2); *(mpaxl2); *(ptr) = 100; TSCL = 0; while(i < 50) { Cache_wbInvAll(); st_u_bef[i] = (unsigned int)*CNTHI; st_l_bef[i] = (unsigned int)*CNTLO; while(j < 100) { *(ptr+j*64); j++; } st_u_aft[i] = (unsigned int)*CNTHI; st_l_aft[i] = (unsigned int)*CNTLO; printf("After ch1 value is 0x%x 0x%x\n",*CNTHI, *CNTLO); i++; j = 0; } i = 0; while(i < 50) { printf("ch value is 0x%x 0x%x 0x%x 0x%x 0x%x\n",st_u_bef[i],st_l_bef[i],st_u_aft[i],st_l_aft[i],ptr); i++; } }