diff options
Diffstat (limited to 'arch/v1')
| -rw-r--r-- | arch/v1/arch.c | 32 | ||||
| -rw-r--r-- | arch/v1/arch_vars.py | 7 |
2 files changed, 36 insertions, 3 deletions
diff --git a/arch/v1/arch.c b/arch/v1/arch.c index f336dd6..a5f9dd4 100644 --- a/arch/v1/arch.c +++ b/arch/v1/arch.c @@ -47,6 +47,7 @@ void arch_core_save(FILE *f, const struct Core *core) { fwrite(&core->wmb1, sizeof(uint64_t), 1, f); fwrite(&core->wdea, sizeof(uint64_t), 1, f); fwrite(core->weva, sizeof(uint64_t), MVEC_SIZE, f); + fwrite(core->xeva, sizeof(uint64_t), MVEC_SIZE, f); #else (void)f; (void)core; @@ -66,6 +67,7 @@ void arch_core_load(FILE *f, struct Core *core) { fread(&core->wmb1, sizeof(uint64_t), 1, f); fread(&core->wdea, sizeof(uint64_t), 1, f); fread(core->weva, sizeof(uint64_t), MVEC_SIZE, f); + fread(core->xeva, sizeof(uint64_t), MVEC_SIZE, f); #else (void)f; (void)core; @@ -415,6 +417,29 @@ void _bswap(struct Core *core, uint64_t pix) { proc->mb0s = proc->mb1s; proc->mb1a = tmpa; proc->mb1s = tmps; + +#if defined(DATA_PUSH_PATH) + // Memory block swap events mark all addresses within both blocks + for (uint64_t i = 0; i < proc->mb0s; i++) { + uint64_t addr = proc->mb0a + i; + +#if defined(MVEC_LOOP) + ++core->xeva[mvec_loop(addr)]; +#else + ++core->xeva[addr]; +#endif + } + + for (uint64_t i = 0; i < proc->mb1s; i++) { + uint64_t addr = proc->mb1a + i; + +#if defined(MVEC_LOOP) + ++core->xeva[mvec_loop(addr)]; +#else + ++core->xeva[addr]; +#endif + } +#endif } _increment_ip(core, pix); @@ -872,7 +897,7 @@ void arch_push_data_header(void) { } // Memory events - char *eprefs[] = { "wev" }; + char *eprefs[] = { "wev", "xev" }; int eprefs_cnt = sizeof(eprefs) / sizeof(eprefs[0]); for (int i = 0; i < CORES; ++i) { @@ -996,7 +1021,7 @@ void arch_push_data_line(void) { } // TODO: insert write memory events - char *eprefs[] = { "wev" }; + char *eprefs[] = { "wev", "xev" }; int eprefs_cnt = sizeof(eprefs) / sizeof(eprefs[0]); for (int i = 0; i < CORES; ++i) { @@ -1005,6 +1030,8 @@ void arch_push_data_line(void) { if (!strcmp("wev", eprefs[j])) { in = g_cores[i].weva; + } else if (!strcmp("xev", eprefs[j])) { + in = g_cores[i].xeva; } // Compress event data @@ -1057,6 +1084,7 @@ void arch_push_data_line(void) { core->wdea = 0; memset(core->weva, 0, sizeof(uint64_t) * MVEC_SIZE); + memset(core->xeva, 0, sizeof(uint64_t) * MVEC_SIZE); } } #endif diff --git a/arch/v1/arch_vars.py b/arch/v1/arch_vars.py index c794a29..4fb6bb2 100644 --- a/arch/v1/arch_vars.py +++ b/arch/v1/arch_vars.py @@ -84,6 +84,7 @@ class ArchVars: ("uint64_t", "wdea", ""), # writes within dead code counter ("uint64_t", "weva", f"[{2 ** args.mvec_pow}]"), # write events array + ("uint64_t", "xeva", f"[{2 ** args.mvec_pow}]"), # memory block swap events array ] self.mvec_loop = False @@ -143,5 +144,9 @@ class ArchVars: f"wev_{i}": { "table": f"wev_{i}", } for i in range(args.cores) - } + } | { + f"xev_{i}": { + "table": f"xev_{i}", + } for i in range(args.cores) + }, } |
