-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_df.h
42 lines (30 loc) · 1.24 KB
/
test_df.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Data flow operators to implement testing programs */
/********************************************************
Supported operations:
ifork(dest, width, val, cnt): [Sizes: 2, 1, 1, 1]
If width == 1, then invoke incr(dest, val, cnt)
Else create destinations dest1, dest2
join(dest, dest1, dest2)
incr(dest1, width/2, val, cnt)
incr(dest2, width-width/2, val, cnt)
incr(dest, val, cnt): [Sizes: 2, 1, 1]
If cnt == 0, send val to dest
Else invoke incr(dest, val+1, cnt-1)
join(dest, val1, val2) [Sizes: 2, 1, 1]
Send val1+val2 to dest
sink(val): [Sizes: 1]
Notify agent (must be client) that have value val
********************************************************/
typedef enum { OP_IFORK, OP_INCR, OP_JOIN } opcode_t;
#define NSTAT NSTATA
void do_summary_stat(chunk_ptr smsg);
chunk_ptr build_ifork(dword_t dest, word_t width, word_t val, word_t cnt);
chunk_ptr build_incr(dword_t dest, word_t val, word_t cnt);
chunk_ptr build_join(dword_t dest);
bool do_ifork_op(chunk_ptr op);
bool do_incr_op(chunk_ptr op);
bool do_join_op(chunk_ptr op);
chunk_ptr flush_worker();
/* Global operations by workers */
void start_global(unsigned id, unsigned opcode, unsigned nword, word_t *data);
void finish_global(unsigned id);