diff options
Diffstat (limited to 'SD-VBS/common')
-rw-r--r-- | SD-VBS/common/c/extra.h | 29 | ||||
-rw-r--r-- | SD-VBS/common/makefiles/Makefile.common | 13 |
2 files changed, 12 insertions, 30 deletions
diff --git a/SD-VBS/common/c/extra.h b/SD-VBS/common/c/extra.h index 3215951..8c67b33 100644 --- a/SD-VBS/common/c/extra.h +++ b/SD-VBS/common/c/extra.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright 2019 Sims Hill Osborne and Joshua Bakita | 2 | * Copyright 2019 Sims Hill Osborne and 2020 Joshua Bakita |
3 | * | 3 | * |
4 | * This header provides facilities by which to separably run and time TACLeBench | 4 | * This header provides facilities by which to separably run and time TACLeBench |
5 | * To use this for paired task timing, define PAIRED (pass CFLAGS=-DPAIRED to make) | 5 | * To use this for paired task timing, define PAIRED (pass CFLAGS=-DPAIRED to make) |
@@ -29,7 +29,7 @@ extern int sched_getcpu(); | |||
29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define LITMUS 0 | 32 | #define LITMUS 1 |
33 | #define MC2 0 | 33 | #define MC2 0 |
34 | #define MMDC_PROF 0 | 34 | #define MMDC_PROF 0 |
35 | 35 | ||
@@ -200,20 +200,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
200 | perror("Unable to migrate to specified CPU"); \ | 200 | perror("Unable to migrate to specified CPU"); \ |
201 | exit(1); \ | 201 | exit(1); \ |
202 | } \ | 202 | } \ |
203 | struct reservation_config res; \ | ||
204 | res.id = gettid(); \ | ||
205 | res.cpu = cpu; \ | ||
206 | res.priority = LITMUS_HIGHEST_PRIORITY; \ | ||
207 | /* we take over half the CPU time (these are ns) */ \ | ||
208 | res.polling_params.budget = ms2ns(3000); \ | ||
209 | res.polling_params.period = ms2ns(3000); \ | ||
210 | res.polling_params.offset = 0; \ | ||
211 | res.polling_params.relative_deadline = ms2ns(3000); \ | ||
212 | /* Not 100% sure that we should use periodic polling */ \ | ||
213 | if (reservation_create(PERIODIC_POLLING, &res) < 0) { \ | ||
214 | perror("Unable to create reservation"); \ | ||
215 | exit(1); \ | ||
216 | } \ | ||
217 | struct rt_task rt_param; \ | 203 | struct rt_task rt_param; \ |
218 | init_rt_task_param(&rt_param); \ | 204 | init_rt_task_param(&rt_param); \ |
219 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ | 205 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ |
@@ -223,7 +209,7 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
223 | rt_param.cls = RT_CLASS_HARD; \ | 209 | rt_param.cls = RT_CLASS_HARD; \ |
224 | rt_param.release_policy = TASK_PERIODIC; \ | 210 | rt_param.release_policy = TASK_PERIODIC; \ |
225 | rt_param.budget_policy = NO_ENFORCEMENT; \ | 211 | rt_param.budget_policy = NO_ENFORCEMENT; \ |
226 | rt_param.cpu = cpu; \ | 212 | rt_param.cpu = _rt_core; \ |
227 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ | 213 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ |
228 | perror("Unable to set real-time parameters"); \ | 214 | perror("Unable to set real-time parameters"); \ |
229 | exit(1); \ | 215 | exit(1); \ |
@@ -244,13 +230,7 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
244 | 230 | ||
245 | #if MC2 | 231 | #if MC2 |
246 | #define MC2_SETUP \ | 232 | #define MC2_SETUP \ |
247 | struct mc2_task mc2_param; \ | 233 | |
248 | mc2_param.res_id = gettid(); \ | ||
249 | mc2_param.crit = CRIT_LEVEL_A; \ | ||
250 | if (set_mc2_task_param(gettid(), &mc2_param) < 0) { \ | ||
251 | perror("Unable to set MC^2 task params"); \ | ||
252 | exit(1); \ | ||
253 | } \ | ||
254 | set_page_color(rt_param.cpu); | 234 | set_page_color(rt_param.cpu); |
255 | #else | 235 | #else |
256 | #define MC2_SETUP | 236 | #define MC2_SETUP |
@@ -261,7 +241,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
261 | perror("Unable to become a real-time task"); \ | 241 | perror("Unable to become a real-time task"); \ |
262 | exit(1); \ | 242 | exit(1); \ |
263 | } \ | 243 | } \ |
264 | reservation_destroy(gettid(), rt_param.cpu); | ||
265 | 244 | ||
266 | #if __arm__ | 245 | #if __arm__ |
267 | // On ARM, manually flush the cache | 246 | // On ARM, manually flush the cache |
diff --git a/SD-VBS/common/makefiles/Makefile.common b/SD-VBS/common/makefiles/Makefile.common index 7fc8824..964ece6 100644 --- a/SD-VBS/common/makefiles/Makefile.common +++ b/SD-VBS/common/makefiles/Makefile.common | |||
@@ -18,8 +18,7 @@ endif | |||
18 | endif | 18 | endif |
19 | 19 | ||
20 | CC=gcc | 20 | CC=gcc |
21 | override CFLAGS += -DGCC -D$(INPUT) -pthread -DCHECK | 21 | override CFLAGS += -DGCC -D$(INPUT) -pthread -I../../../../.. |
22 | |||
23 | COMMON_DIR := $(TOP_DIR)/common/c | 22 | COMMON_DIR := $(TOP_DIR)/common/c |
24 | M_COMMON := $(TOP_DIR)/common/matlab | 23 | M_COMMON := $(TOP_DIR)/common/matlab |
25 | M_TOOLBOX=$(TOP_DIR)/common/toolbox | 24 | M_TOOLBOX=$(TOP_DIR)/common/toolbox |
@@ -29,7 +28,11 @@ PRELOAD_TIMES_DIR := $(TOP_DIR)/preload-times/$(BMARK) | |||
29 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) | 28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) |
30 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) | 29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) |
31 | TOOL_DIR := $(TOP_DIR)/tools | 30 | TOOL_DIR := $(TOP_DIR)/tools |
32 | 31 | LIBLITMUS ?= /home/litmus/liblitmus | |
32 | ifneq ($(shell grep "define LITMUS 1" ../../../../../extra.h),) | ||
33 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | ||
34 | override LDFLAGS += -L${LIBLITMUS} -llitmus | ||
35 | endif | ||
33 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. | 36 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. |
34 | 37 | ||
35 | # Variables exported from the benchmark specific Makefiles: | 38 | # Variables exported from the benchmark specific Makefiles: |
@@ -57,7 +60,7 @@ COMMON_SRC := $(wildcard $(COMMON_DIR)/*.c) | |||
57 | 60 | ||
58 | EXE = | 61 | EXE = |
59 | INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) | 62 | INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) |
60 | COMPILE_C = $(CC) $(CFLAGS) -lm -O2 $(INCLUDES) | 63 | COMPILE_C = $(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) -O2 |
61 | #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) | 64 | #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) |
62 | COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) | 65 | COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) |
63 | COMPILE_PG = $(COMPILE_G) -pg | 66 | COMPILE_PG = $(COMPILE_G) -pg |
@@ -108,7 +111,7 @@ compile-preload: | |||
108 | compile: $(C_SRC) | 111 | compile: $(C_SRC) |
109 | @echo | 112 | @echo |
110 | @echo -e "Benchmark\t\t- $(BMARK)" | 113 | @echo -e "Benchmark\t\t- $(BMARK)" |
111 | @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -lm -w -o $(BMARK)$(EXE) | 114 | @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -lm -w -o $(BMARK)$(EXE) |
112 | 115 | ||
113 | compile-prof: $(C_SRC) | 116 | compile-prof: $(C_SRC) |
114 | @echo | 117 | @echo |