From b5871ab969c66eb27974b078e0efe44e268d112c Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Thu, 2 Nov 2023 01:31:40 +0100 Subject: use char array --- testn.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/testn.c b/testn.c index 84815aa..36a15c3 100644 --- a/testn.c +++ b/testn.c @@ -1,14 +1,19 @@ #include #include #include +// 256 bytes = 4 * 64 = 4 * cachelines +// with 4-way associative cache one row +// traverse each set. +// With 8-way associative cache the col number +// should be doubled. +#define COLS 256 #define ROWS 1024 -#define COLS 64 #define VFL 6291456 #ifndef OFF #define OFF 0 #endif -char arr[ROWS*4][(COLS+OFF)*4] __attribute__((aligned(4096))); +char arr[ROWS][COLS+OFF*4] __attribute__((aligned(4096))); char arr2[VFL]; int main() { -- cgit v1.2.3-70-g09d2