From 94696e1054a40785b5e909eb035f4385a179a191 Mon Sep 17 00:00:00 2001 From: Gabor Dozsa Date: Fri, 28 Oct 2016 15:26:36 +0100 Subject: [PATCH] Add dist-gem5 support Signed-off-by: Gabor Dozsa --- marker.h | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/marker.h b/marker.h index 2473668..80d002d 100644 --- a/marker.h +++ b/marker.h @@ -130,6 +130,7 @@ void m5_work_end(uint64_t x, uint64_t y) {} #define GEM5_STAT 1 #define GEM5_CHCK 2 #define GEM5_EXIT 4 +#define GEM5_DIST 8 #define GEM5_WORK 16 inline int env2int(const char *name) @@ -151,21 +152,28 @@ inline int env2int(const char *name) } #define MARKER_START(rank) \ - if((rank==0)&&(_ARM_MARKER > 0)&&(_GEM5_MARKER > 0)) { \ - if(_GEM5_MARKER & GEM5_CHCK) \ - m5_checkpoint(_GEM5_CHCK_DELAY,_GEM5_CHCK_PERIOD); \ - if(_GEM5_MARKER & GEM5_STAT) { \ - if(_GEM5_STAT_DELAY||_GEM5_STAT_PERIOD) \ - m5_dumpreset_stats(_GEM5_STAT_DELAY,_GEM5_STAT_PERIOD); \ - else \ - m5_reset_stats(0,0); \ - } \ - } + if((_ARM_MARKER > 0)&&(_GEM5_MARKER > 0)) { \ + if((rank==0)||(_GEM5_MARKER & GEM5_DIST)) { \ + if(_GEM5_MARKER & GEM5_CHCK) \ + m5_checkpoint(_GEM5_CHCK_DELAY,_GEM5_CHCK_PERIOD); \ + if(_GEM5_MARKER & GEM5_STAT) { \ + if(_GEM5_STAT_DELAY||_GEM5_STAT_PERIOD) { \ + m5_dumpreset_stats(_GEM5_STAT_DELAY,_GEM5_STAT_PERIOD); \ + } else { \ + m5_reset_stats(0,0); } \ + } \ + } \ + } + + #define MARKER_STOP(rank) \ - if((rank==0)&&(_ARM_MARKER > 0)&&(_GEM5_MARKER > 0)) { \ - if(_GEM5_MARKER & GEM5_STAT) m5_dumpreset_stats(0,0); \ - if(_GEM5_MARKER & GEM5_EXIT) m5_exit(0); \ - if(_GEM5_MARKER & GEM5_CHCK) m5_checkpoint(0,0); \ + if((_ARM_MARKER > 0)&&(_GEM5_MARKER > 0)) { \ + if((rank==0)||(_GEM5_MARKER & GEM5_DIST)) { \ + if(_GEM5_MARKER & GEM5_STAT) m5_dumpreset_stats(0,0); \ + if(_GEM5_MARKER & GEM5_EXIT) m5_exit(0); \ + if((_GEM5_MARKER & GEM5_CHCK)&&(!(_GEM5_MARKER & GEM5_EXIT))) \ + m5_checkpoint(0,0); \ + } \ } #define MARKER_BEGIN(x, y) \ if(_GEM5_MARKER & GEM5_WORK) { \