diff options
author | Namhoon Kim <namhoonk@cs.unc.edu> | 2016-04-19 16:05:24 -0400 |
---|---|---|
committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2016-04-19 16:05:24 -0400 |
commit | 50b7edbe7e5ae56f7602b2792eed3b7cc51edc1f (patch) | |
tree | 2ecb89cdb74bb7e8f96ae7b4f2ed893978e42d76 | |
parent | 73d907a984439a26b77d6a88cc24d17745eab9a8 (diff) |
ARM support
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | include/atomic.h | 2 | ||||
-rw-r--r-- | src/pgm.cpp | 10 | ||||
-rw-r--r-- | tools/pgmrt.cpp | 7 | ||||
-rw-r--r-- | tools/pingpong.cpp | 4 | ||||
-rw-r--r-- | tools/ringtest.cpp | 2 |
6 files changed, 15 insertions, 15 deletions
@@ -24,16 +24,17 @@ LIBPGM = . | |||
24 | flags-std = -std=gnu++11 | 24 | flags-std = -std=gnu++11 |
25 | #flags-optim = -g -fPIC -march=native | 25 | #flags-optim = -g -fPIC -march=native |
26 | flags-optim = -O2 -fPIC -march=native | 26 | flags-optim = -O2 -fPIC -march=native |
27 | flags-debug = -Wall -Werror -Wno-unused-function -Wno-sign-compare | 27 | flags-debug = -Wall -Wno-unused-function -Wno-sign-compare |
28 | flags-api = -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread | 28 | flags-api = -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread |
29 | 29 | ||
30 | # Comment out 'flags-litmus' to disable Litmus support | 30 | # Comment out 'flags-litmus' to disable Litmus support |
31 | #flags-litmus = -D_USE_LITMUS | 31 | flags-litmus = -D_USE_LITMUS -DCONFIG_PGMRT_SUPPORT |
32 | 32 | ||
33 | # architecture-specific flags | 33 | # architecture-specific flags |
34 | flags-i386 = -m32 | 34 | flags-i386 = -m32 |
35 | flags-x86_64 = -m64 | 35 | flags-x86_64 = -m64 |
36 | flags-sparc64 = -mcpu=v9 -m64 | 36 | flags-sparc64 = -mcpu=v9 -m64 |
37 | flags-arm = -mcpu=cortex-a9 -mtune=native | ||
37 | # default: none | 38 | # default: none |
38 | 39 | ||
39 | # name of the directory that has the arch headers in the Linux source | 40 | # name of the directory that has the arch headers in the Linux source |
diff --git a/include/atomic.h b/include/atomic.h index ec5c09c..8f5d9d8 100644 --- a/include/atomic.h +++ b/include/atomic.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | static inline void __sync_pause() | 6 | static inline void __sync_pause() |
7 | { | 7 | { |
8 | #if (ARCH == x86_64) || (ARCH == i386) || (ARCH == i686) | 8 | #if defined(__i386__) || defined(__x86_64__) |
9 | asm volatile("pause": : :"memory"); | 9 | asm volatile("pause": : :"memory"); |
10 | #else | 10 | #else |
11 | __sync_synchronize(); | 11 | __sync_synchronize(); |
diff --git a/src/pgm.cpp b/src/pgm.cpp index 5e30d32..d332fea 100644 --- a/src/pgm.cpp +++ b/src/pgm.cpp | |||
@@ -1298,7 +1298,7 @@ void* __pgm_swap_edge_buf(edge_t edge, void* new_uptr, bool swap_producer) | |||
1298 | old_hdr = *old_hdr_ptr; | 1298 | old_hdr = *old_hdr_ptr; |
1299 | if(hdr->usersize != old_hdr->usersize) | 1299 | if(hdr->usersize != old_hdr->usersize) |
1300 | { | 1300 | { |
1301 | E("Buffer %p is the wrong size. (is %lu, expected %lu)\n", | 1301 | E("Buffer %p is the wrong size. (is %zu, expected %zu)\n", |
1302 | new_uptr, hdr->usersize, old_hdr->usersize); | 1302 | new_uptr, hdr->usersize, old_hdr->usersize); |
1303 | goto out; | 1303 | goto out; |
1304 | } | 1304 | } |
@@ -1356,7 +1356,7 @@ int pgm_swap_edge_bufs(void* a, void* b) | |||
1356 | 1356 | ||
1357 | if(hdra->usersize != hdrb->usersize) | 1357 | if(hdra->usersize != hdrb->usersize) |
1358 | { | 1358 | { |
1359 | E("Buffers are not the same size: %p:%lu vs %p:%lu\n", | 1359 | E("Buffers are not the same size: %p:%zu vs %p:%zu\n", |
1360 | a, hdra->usersize, b, hdrb->usersize); | 1360 | a, hdra->usersize, b, hdrb->usersize); |
1361 | goto out; | 1361 | goto out; |
1362 | } | 1362 | } |
@@ -3977,15 +3977,15 @@ int pgm_print_graph(graph_t graph, FILE* outs) | |||
3977 | 3977 | ||
3978 | if(!e->is_backedge) | 3978 | if(!e->is_backedge) |
3979 | { | 3979 | { |
3980 | snprintf(thresh, sizeof(thresh), "(%lu)", e->attr.nr_threshold); | 3980 | snprintf(thresh, sizeof(thresh), "(%zu)", e->attr.nr_threshold); |
3981 | } | 3981 | } |
3982 | else | 3982 | else |
3983 | { | 3983 | { |
3984 | snprintf(thresh, sizeof(thresh), "(%lu, %lu)", e->attr.nr_threshold, e->nr_skips); | 3984 | snprintf(thresh, sizeof(thresh), "(%zu, %zu)", e->attr.nr_threshold, e->nr_skips); |
3985 | } | 3985 | } |
3986 | 3986 | ||
3987 | fprintf(outs, | 3987 | fprintf(outs, |
3988 | "\t%d -> %d [style=%s, color=%s, label=\"%s%s_%s\", headlabel=\"%lu %s\", taillabel=\"%lu\"]\n", | 3988 | "\t%d -> %d [style=%s, color=%s, label=\"%s%s_%s\", headlabel=\"%zu %s\", taillabel=\"%zu\"]\n", |
3989 | e->producer, | 3989 | e->producer, |
3990 | e->consumer, | 3990 | e->consumer, |
3991 | (!e->is_backedge) ? "solid" : "dashed", | 3991 | (!e->is_backedge) ? "solid" : "dashed", |
diff --git a/tools/pgmrt.cpp b/tools/pgmrt.cpp index 865d0ab..9dd9cf1 100644 --- a/tools/pgmrt.cpp +++ b/tools/pgmrt.cpp | |||
@@ -190,7 +190,7 @@ void sleep_ns(uint64_t ns) | |||
190 | { | 190 | { |
191 | int64_t seconds = ns / s2ns(1); | 191 | int64_t seconds = ns / s2ns(1); |
192 | ns -= s2ns(seconds); | 192 | ns -= s2ns(seconds); |
193 | struct timespec ts = {.tv_sec = seconds, .tv_nsec = (int64_t)ns}; | 193 | struct timespec ts = {.tv_sec = (time_t)seconds, .tv_nsec = (time_t)ns}; |
194 | nanosleep(&ts, NULL); | 194 | nanosleep(&ts, NULL); |
195 | } | 195 | } |
196 | 196 | ||
@@ -417,7 +417,6 @@ void work_thread(rt_config cfg) | |||
417 | // param.phase = cfg.phase_ns; | 417 | // param.phase = cfg.phase_ns; |
418 | param.period = cfg.period_ns; | 418 | param.period = cfg.period_ns; |
419 | param.exec_cost = cfg.execution_ns; | 419 | param.exec_cost = cfg.execution_ns; |
420 | param.split = cfg.split_factor; | ||
421 | if(cfg.cluster >= 0) | 420 | if(cfg.cluster >= 0) |
422 | param.cpu = domain_to_first_cpu(cfg.cluster); | 421 | param.cpu = domain_to_first_cpu(cfg.cluster); |
423 | param.budget_policy = (cfg.budget) ? PRECISE_ENFORCEMENT : NO_ENFORCEMENT; | 422 | param.budget_policy = (cfg.budget) ? PRECISE_ENFORCEMENT : NO_ENFORCEMENT; |
@@ -670,8 +669,8 @@ void validate_rate(node_t n, const std::map<std::string, rate>& rates) | |||
670 | bool __valid = (a == b); | 669 | bool __valid = (a == b); |
671 | 670 | ||
672 | if(!__valid) { | 671 | if(!__valid) { |
673 | printf("%s (%lu = %lu * (%lu / %lu)) " | 672 | printf("%s (%llu = %llu * (%llu / %llu)) " |
674 | "and %s (%lu = %lu * (%lu / %lu)) incompatible\n", | 673 | "and %s (%llu = %llu * (%llu / %llu)) incompatible\n", |
675 | pgm_get_name(preds_w_rates[i-1].first), | 674 | pgm_get_name(preds_w_rates[i-1].first), |
676 | p1, prev.x, scale, prev.y, | 675 | p1, prev.x, scale, prev.y, |
677 | pgm_get_name(preds_w_rates[i].first), | 676 | pgm_get_name(preds_w_rates[i].first), |
diff --git a/tools/pingpong.cpp b/tools/pingpong.cpp index da45ef6..d6f9cbc 100644 --- a/tools/pingpong.cpp +++ b/tools/pingpong.cpp | |||
@@ -110,7 +110,7 @@ void fifo_worker(Args args) | |||
110 | 110 | ||
111 | string name = (args.is_master) ? "A" : "B"; | 111 | string name = (args.is_master) ? "A" : "B"; |
112 | 112 | ||
113 | printf("(fifo) %s: time: %lu (ns) average rtt: %lu (ns) token value: %d\n", name.c_str(), elapsed, avg_round, (int)token); | 113 | printf("(fifo) %s: time: %llu (ns) average rtt: %llu (ns) token value: %d\n", name.c_str(), elapsed, avg_round, (int)token); |
114 | } | 114 | } |
115 | 115 | ||
116 | void mq_worker(Args args) | 116 | void mq_worker(Args args) |
@@ -208,7 +208,7 @@ void mq_worker(Args args) | |||
208 | 208 | ||
209 | string name = (args.is_master) ? "A" : "B"; | 209 | string name = (args.is_master) ? "A" : "B"; |
210 | 210 | ||
211 | printf("(mq) %s: time: %lu (ns) average rtt: %lu (ns) token value: %d\n", name.c_str(), elapsed, avg_round, (int)token); | 211 | printf("(mq) %s: time: %llu (ns) average rtt: %llu (ns) token value: %d\n", name.c_str(), elapsed, avg_round, (int)token); |
212 | } | 212 | } |
213 | 213 | ||
214 | int main(int argc, char** argv) | 214 | int main(int argc, char** argv) |
diff --git a/tools/ringtest.cpp b/tools/ringtest.cpp index 3f2bbb5..faf8b73 100644 --- a/tools/ringtest.cpp +++ b/tools/ringtest.cpp | |||
@@ -95,7 +95,7 @@ void* thread(void* _graph_t) | |||
95 | } | 95 | } |
96 | else | 96 | else |
97 | { | 97 | { |
98 | fprintf(stdout, "%s%d terminates: sum: %lu\n", tabbuf, node.node, sum); | 98 | fprintf(stdout, "%s%d terminates: sum: %llu\n", tabbuf, node.node, sum); |
99 | 99 | ||
100 | if(is_src) | 100 | if(is_src) |
101 | CheckError(pgm_terminate(node)); | 101 | CheckError(pgm_terminate(node)); |