aboutsummaryrefslogtreecommitdiff
path: root/arch/v1/arch.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/v1/arch.c')
-rw-r--r--arch/v1/arch.c32
1 files changed, 30 insertions, 2 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