diff --git a/app/benchmark/timing/aborted-computation.cc b/app/benchmark/timing/aborted-computation.cc index 0735e2c35ac63cac5370f75375eab51357f491f1..e5e483334457464590137303bc838981cedd993a 100644 --- a/app/benchmark/timing/aborted-computation.cc +++ b/app/benchmark/timing/aborted-computation.cc @@ -17,7 +17,7 @@ TASK(Control) { timing_start(0); ActivateTask(Computation); WaitEvent(ComputationFinished | ComputationAborted); - timing_end(TIMING_POINT_STOP_BEFORE | 0); + timing_end(TIMING_POINT_NO_INTERRUPTS_IN_BLOCK | 0); /* ABB Split Point */ DisableAllInterrupts(); diff --git a/app/benchmark/timing/tmr.cc b/app/benchmark/timing/tmr.cc index 2b76dc3d2560b57742d1065540b35489c867c537..1a31dc76cde6ddeb95a24715f9df7228a2c081f5 100644 --- a/app/benchmark/timing/tmr.cc +++ b/app/benchmark/timing/tmr.cc @@ -25,7 +25,6 @@ TASK(Control) { timing_entry(); - TerminateTask(); } diff --git a/generator/transform/GeneratePML.py b/generator/transform/GeneratePML.py index ec67ba74e7734b0b731d4cb58bfa8339d00860d5..b2bd2a33438fcce16b7e55377c3539def528d9a2 100644 --- a/generator/transform/GeneratePML.py +++ b/generator/transform/GeneratePML.py @@ -14,6 +14,10 @@ def is_TIMING_POINT_STOP_BEFORE(flags): def is_TIMING_POINT_START_INTERRUPT_IN_BLOCK(flags): return (flags & 1) == 1 +def is_TIMING_POINT_NO_INTERRUPTS_IN_BLOCK(flags): + return (flags & 2) == 2 + + class GeneratePML(Analysis, GraphObject): """ FIXME @@ -106,15 +110,20 @@ class GeneratePML(Analysis, GraphObject): visited.add(id(curr)) path = path + [curr] 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 # subtask are not taken. if is_end_state and succ.current_subtask == curr.current_subtask: continue - if succ.current_abb in end_abbs and is_TIMING_POINT_STOP_BEFORE(end_abbs[succ.current_abb]): - # TIMING_POINT_STOP_BEFORE + if is_TIMING_POINT_STOP_BEFORE(end_abbs.get(nabb,0)): end_states[id(curr)] = curr add_to_good_states(path, curr) 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) visited = set() diff --git a/os/timing.cc b/os/timing.cc index a675db914ab2fb878dd7c62b37bef4f8402c9ef6..5a87381853335e0a6ae9be09a0088e6e1d73f588 100644 --- a/os/timing.cc +++ b/os/timing.cc @@ -16,14 +16,14 @@ noinline void timing_start(int circuit) { noinline uint64_t timing_end(int circuit) { 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; return delta; } noinline void timing_print() { for (unsigned i = 0; i < CIRCUIT_MAX; ++i) { - if (circuits_duration[i]) { + if (circuits[i]) { kout << "timing-" << i << " " << circuits_duration[i] << endl; } } diff --git a/os/timing.h b/os/timing.h index 9d066632d60ddcff9c47b0e571ec53cd654c85be..fccb5e0c45d4dbf095bfe670897d418a65bb9afa 100644 --- a/os/timing.h +++ b/os/timing.h @@ -18,6 +18,8 @@ extern "C" { #define timing_loop_bound(low, high) #endif +#define TIMING_POINT_NO_INTERRUPTS_IN_BLOCK 0x200 + #define TIMING_POINT_STOP_BEFORE 0x100 #define TIMING_POINT_START_INTERRUPT_IN_BLOCK 0x100 @@ -25,10 +27,11 @@ extern "C" { #define GENERATE_TIME_CONSUMER(name, amount) \ - extern "C" void noinline name() { \ + extern "C" int noinline name() { \ volatile int i = 0; \ timing_loop_bound(amount, amount) \ for (; i < amount; i++) {}; \ + return i; \ } #define TIMING_MAKE_OS_MAIN(body) \