// delta_fator from the next original page
int * oldtable_next=&gccachesamplingtbl[oldpage+NUMCORESACTIVE];
for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=((*newtable)+(*oldtable)*main_factor+(*oldtable_next)*delta_factor);
+ (*newtable)=(*newtable)+((*oldtable)*main_factor+(*oldtable_next)*delta_factor)>>BAMBOO_PAGE_SIZE_BITS;
newtable++;
oldtable++;
oldtable_next++;
// the start destination page closes first, now compute the revised
// profiling info for it.
for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=((*newtable)+(*oldtable)*main_factor);
+ (*newtable)=(*newtable)+((*oldtable)*main_factor)>>BAMBOO_PAGE_SIZE_BITS;
newtable++;
oldtable++;
}
int *oldtable_next=&gccachesamplingtbl[oldpage+NUMCORESACTIVE];
for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=((*newtable)+(*oldtable)*main_factor+(*oldtable_next)*delta_factor);
+ (*newtable)=(*newtable)+((*oldtable)*main_factor+(*oldtable_next)*delta_factor)>>BAMBOO_PAGE_SIZE_BITS;
newtable++;
oldtable++;
oldtable_next++;
int *oldtable=&gccachesamplingtbl[oldpage];
for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=((*newtable)+(*oldtable)*to_factor);
+ (*newtable)=(*newtable)+((*oldtable)*to_factor)>>BAMBOO_PAGE_SIZE_BITS;
newtable++;
oldtable++;
}
int * oldtable=&gccachesamplingtbl[oldpage];
for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=((*newtable)+(*oldtable)*tmp_factor);
+ (*newtable)=(*newtable)+((*oldtable)*tmp_factor)>>BAMBOO_PAGE_SIZE_BITS;
newtable++;
oldtable++;
}
int accesscore = 0; // TODO
int * local_tbl = &gccachesamplingtbl_r[page_index*NUMCORESACTIVE];
for(int i = 0; i < NUMCORESACTIVE; i++) {
- int freq = *local_tbl; ///BAMBOO_PAGE_SIZE;
+ int freq = *local_tbl;
printf("%d, ", freq);
if(freq != 0) {
accesscore++;// TODO
local_tbl++;
}
if(accesscore!=0) {
- int * local_tbl = &gccachesamplingtbl_r[page_index];
+ int * local_tbl = &gccachesamplingtbl_r[page_index*NUMCORESACTIVE];
for(int i = 0; i < NUMCORESACTIVE; i++) {
- int freq = *local_tbl; ///BAMBOO_PAGE_SIZE;
+ int freq = *local_tbl;
sumdata[accesscore-1][i]+=freq;
local_tbl++;
}
printf("\n");
}
+ printf("+++++\n");
// TODO printout the summary data
for(int i = 0; i < NUMCORESACTIVE; i++) {
printf("%d ", i);
#ifdef GC_CACHE_ADAPT
// sampling unit to compute access frequency, this should be consistent all the
// time.
-#define GC_CACHE_SAMPLING_UNIT 0x80000
+#define GC_CACHE_SAMPLING_UNIT 0x1000000
// freqeuency to trigger timer interrupt
#define GC_TILE_TIMER_EVENT_SETTING 10000000
#endif
#endif
+#define BAMBOO_SHARED_RUNTIME_PAGE_SIZE (1<<24) //16M
+
#ifdef GC_DEBUG
#include "structdefs.h"
#define BAMBOO_NUM_BLOCKS (NUMCORES4GC*(2+3))
#define BAMBOO_PAGE_SIZE (64 * 64)
+#define BAMBOO_PAGE_SIZE_BITS (12)
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#define BAMBOO_SHARED_MEM_SIZE ((unsigned int)((BAMBOO_SMEM_SIZE) *(BAMBOO_NUM_BLOCKS)))
#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+14)))
#endif
#define BAMBOO_PAGE_SIZE ((unsigned int)(64 * 1024)) // 64K
+#define BAMBOO_PAGE_SIZE_BITS (16)
#ifdef GC_LARGEPAGESIZE
#define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 64 * 1024))
+#define BAMBOO_PAGE_SIZE_BITS (18)
#define BAMBOO_SMEM_SIZE ((unsigned int)(4 * (BAMBOO_PAGE_SIZE)))
#elif defined GC_SMALLPAGESIZE
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#elif defined GC_LARGEPAGESIZE2
#define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 64 * 1024)) // 64K
+#define BAMBOO_PAGE_SIZE_BITS (18)
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#elif defined MGC
#define BAMBOO_SMEM_SIZE ((unsigned int)(16*(BAMBOO_PAGE_SIZE))) // 1M
#endif
#ifdef GC_LARGEPAGESIZE
#define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 1024 * 1024)) // (4096)
+#define BAMBOO_PAGE_SIZE_BITS (22)
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#elif defined GC_SMALLPAGESIZE
#define BAMBOO_PAGE_SIZE ((unsigned int)(256 * 1024)) // (4096)
+#define BAMBOO_PAGE_SIZE_BITS (18)
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#elif defined GC_SMALLPAGESIZE2
#define BAMBOO_PAGE_SIZE ((unsigned int)(256 * 1024)) // (4096) 64
+#define BAMBOO_PAGE_SIZE_BITS (18)
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#else
#define BAMBOO_PAGE_SIZE ((unsigned int)(1024 * 1024)) // (4096)
+#define BAMBOO_PAGE_SIZE_BITS (20)
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#endif // GC_LARGEPAGESIZE
#define BAMBOO_SHARED_MEM_SIZE ((unsigned int)((BAMBOO_SMEM_SIZE) * (BAMBOO_NUM_BLOCKS))) //(1024 * 1024 * 240) //((unsigned long long int)(3.0 * 1024 * 1024 * 1024)) // 3G