dev: Add m5 op to toggle synchronization for dist-gem5.

This patch adds the ability for an application to request dist-gem5 to begin/
end synchronization using an m5 op. When toggling on sync, all nodes agree
on the next sync point based on the maximum of all nodes' ticks. CPUs are
suspended until the sync point to avoid sending network messages until sync has
been enabled. Toggling off sync acts like a global execution barrier, where
all CPUs are disabled until every node reaches the toggle off point. This
avoids tricky situations such as one node hitting a toggle off followed by a
toggle on before the other nodes hit the first toggle off.
This commit is contained in:
Michael LeBeane
2016-10-26 22:48:40 -04:00
parent 48e43c9ad1
commit dc16c1ceb8
14 changed files with 193 additions and 37 deletions

View File

@@ -57,6 +57,7 @@ uint64_t m5_readfile(void *buffer, uint64_t len, uint64_t offset);
uint64_t m5_writefile(void *buffer, uint64_t len, uint64_t offset, const char *filename);
void m5_debugbreak(void);
void m5_switchcpu(void);
void m5_togglesync(void);
void m5_addsymbol(uint64_t addr, char *symbol);
void m5_panic(void);
void m5_work_begin(uint64_t workid, uint64_t threadid);

View File

@@ -83,3 +83,4 @@ TWO_BYTE_OP(m5_addsymbol, addsymbol_func)
TWO_BYTE_OP(m5_panic, panic_func)
TWO_BYTE_OP(m5_work_begin, work_begin_func)
TWO_BYTE_OP(m5_work_end, work_end_func)
TWO_BYTE_OP(m5_togglesync, togglesync_func)

View File

@@ -77,6 +77,7 @@
#define syscall_func 0x60 // Reserved for user
#define pagefault_func 0x61 // Reserved for user
#define togglesync_func 0x62
// These operations are for critical path annotation
#define annotate_func 0x55
@@ -121,7 +122,8 @@
M5OP(m5_addsymbol, addsymbol_func, 0); \
M5OP(m5_panic, panic_func, 0); \
M5OP(m5_work_begin, work_begin_func, 0); \
M5OP(m5_work_end, work_end_func, 0);
M5OP(m5_work_end, work_end_func, 0); \
M5OP(m5_togglesync, togglesync_func, 0);
#define FOREACH_M5_ANNOTATION \
M5_ANNOTATION(m5a_bsm, an_bsm); \