Skip to content
Snippets Groups Projects
Commit 6fc8ff8d authored by Christian Dietrich's avatar Christian Dietrich
Browse files

pml: no_interrupts annotation

The TIMING_POINT_NO_INTERRUPTS_IN_BLOCK annotation forbids the action of
interrupts in the end or begin block to be included into the state
graph.
parent 33588982
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ TASK(Control) { ...@@ -17,7 +17,7 @@ TASK(Control) {
timing_start(0); timing_start(0);
ActivateTask(Computation); ActivateTask(Computation);
WaitEvent(ComputationFinished | ComputationAborted); WaitEvent(ComputationFinished | ComputationAborted);
timing_end(TIMING_POINT_STOP_BEFORE | 0); timing_end(TIMING_POINT_NO_INTERRUPTS_IN_BLOCK | 0);
/* ABB Split Point */ /* ABB Split Point */
DisableAllInterrupts(); DisableAllInterrupts();
......
...@@ -25,7 +25,6 @@ TASK(Control) { ...@@ -25,7 +25,6 @@ TASK(Control) {
timing_entry(); timing_entry();
TerminateTask(); TerminateTask();
} }
......
...@@ -14,6 +14,10 @@ def is_TIMING_POINT_STOP_BEFORE(flags): ...@@ -14,6 +14,10 @@ def is_TIMING_POINT_STOP_BEFORE(flags):
def is_TIMING_POINT_START_INTERRUPT_IN_BLOCK(flags): def is_TIMING_POINT_START_INTERRUPT_IN_BLOCK(flags):
return (flags & 1) == 1 return (flags & 1) == 1
def is_TIMING_POINT_NO_INTERRUPTS_IN_BLOCK(flags):
return (flags & 2) == 2
class GeneratePML(Analysis, GraphObject): class GeneratePML(Analysis, GraphObject):
""" FIXME """ FIXME
...@@ -106,15 +110,20 @@ class GeneratePML(Analysis, GraphObject): ...@@ -106,15 +110,20 @@ class GeneratePML(Analysis, GraphObject):
visited.add(id(curr)) visited.add(id(curr))
path = path + [curr] path = path + [curr]
for succ in curr.get_outgoing_nodes(SavedStateTransition): for succ in curr.get_outgoing_nodes(SavedStateTransition):
abb = curr.current_abb
nabb = succ.current_abb
# Edges that origin from an end state to the same # Edges that origin from an end state to the same
# subtask are not taken. # subtask are not taken.
if is_end_state and succ.current_subtask == curr.current_subtask: if is_end_state and succ.current_subtask == curr.current_subtask:
continue continue
if succ.current_abb in end_abbs and is_TIMING_POINT_STOP_BEFORE(end_abbs[succ.current_abb]): if is_TIMING_POINT_STOP_BEFORE(end_abbs.get(nabb,0)):
# TIMING_POINT_STOP_BEFORE
end_states[id(curr)] = curr end_states[id(curr)] = curr
add_to_good_states(path, curr) add_to_good_states(path, curr)
continue continue
if (is_TIMING_POINT_NO_INTERRUPTS_IN_BLOCK(end_abbs.get(abb,0)) or \
is_TIMING_POINT_NO_INTERRUPTS_IN_BLOCK(start_abbs.get(abb,0))) and \
nabb.subtask.conf.is_isr:
continue
dfs(path, succ) dfs(path, succ)
visited = set() visited = set()
......
...@@ -16,14 +16,14 @@ noinline void timing_start(int circuit) { ...@@ -16,14 +16,14 @@ noinline void timing_start(int circuit) {
noinline uint64_t timing_end(int circuit) { noinline uint64_t timing_end(int circuit) {
uint64_t end = arch_timing_get(); uint64_t end = arch_timing_get();
uint32_t delta = (uint32_t) end - circuits[circuit]; uint32_t delta = (uint32_t) end - circuits[circuit & 0xff];
circuits_duration[circuit & 0xff] = delta; circuits_duration[circuit & 0xff] = delta;
return delta; return delta;
} }
noinline void timing_print() { noinline void timing_print() {
for (unsigned i = 0; i < CIRCUIT_MAX; ++i) { for (unsigned i = 0; i < CIRCUIT_MAX; ++i) {
if (circuits_duration[i]) { if (circuits[i]) {
kout << "timing-" << i << " " << circuits_duration[i] << endl; kout << "timing-" << i << " " << circuits_duration[i] << endl;
} }
} }
......
...@@ -18,6 +18,8 @@ extern "C" { ...@@ -18,6 +18,8 @@ extern "C" {
#define timing_loop_bound(low, high) #define timing_loop_bound(low, high)
#endif #endif
#define TIMING_POINT_NO_INTERRUPTS_IN_BLOCK 0x200
#define TIMING_POINT_STOP_BEFORE 0x100 #define TIMING_POINT_STOP_BEFORE 0x100
#define TIMING_POINT_START_INTERRUPT_IN_BLOCK 0x100 #define TIMING_POINT_START_INTERRUPT_IN_BLOCK 0x100
...@@ -25,10 +27,11 @@ extern "C" { ...@@ -25,10 +27,11 @@ extern "C" {
#define GENERATE_TIME_CONSUMER(name, amount) \ #define GENERATE_TIME_CONSUMER(name, amount) \
extern "C" void noinline name() { \ extern "C" int noinline name() { \
volatile int i = 0; \ volatile int i = 0; \
timing_loop_bound(amount, amount) \ timing_loop_bound(amount, amount) \
for (; i < amount; i++) {}; \ for (; i < amount; i++) {}; \
return i; \
} }
#define TIMING_MAKE_OS_MAIN(body) \ #define TIMING_MAKE_OS_MAIN(body) \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment