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

timing/new benchmark: interrupt reaction

How long does an task activation from an interrupt take?
parent 0ebe704f
No related branches found
No related tags found
No related merge requests found
......@@ -21,16 +21,16 @@ DOSEK_BINARY(
)
#DOSEK_BINARY(
# NAME bench-timing-idle_irq
# SYSTEM_DESC idle-irq.oil
# LIBS libtest timing
# SOURCES idle-irq.cc
#)
DOSEK_BINARY(
NAME bench-timing-interrupt_reaction
SYSTEM_DESC irq-task.oil
LIBS libtest timing
SOURCES interrupt-reaction.cc
)
DOSEK_BINARY(
NAME bench-timing-computation_irq
SYSTEM_DESC computation-irq.oil
SYSTEM_DESC irq-task.oil
LIBS libtest timing
SOURCES computation-irq.cc
)
......
......@@ -121,6 +121,28 @@ Interrupt: (minimal interarrival time=10000)
| GCFG Nodes | Bound | IRQs | Ticks | Alarms |
| 4 | 33391 | 4 | 0 | 0 |
* Interrupt Response Time of a System
Starting from the first instruction of the interrupt. How long does it
take till a task executes its first instruction.
** Code
ISR:
1: timing_start()
2: ActivateTask(T1)
3: iret
T1:
10: timing_end()
** Sequence
#+begin_src sh
./run bench-timing-interrupt_reaction 0
#+end_src
#+RESULTS:
| GCFG Nodes | Bound | IRQs | Ticks | Alarms |
| 12 | 475 | 1 | 0 | 0 |
* A task waits for an event, another one sets it
The benchmarks starts with two tasks ready. The higher priorty,
currently running task, is going to sleep for an event. The lower
......
#include "os.h"
#include "test/test.h"
#include "syscall.h"
#include "timing.h"
TEST_MAKE_OS_MAIN( StartOS(0) )
DeclareTask(H1);
ISR2(ISR1) {
timing_start(0);
ActivateTask(H1);
}
TASK(H1) {
timing_end(0);
TerminateTask();
}
void PreIdleHook() {
timing_dump();
ShutdownMachine();
}
......@@ -19,6 +19,7 @@ class PatmosArch(GenericArch):
self.generate_dataobjects_task_stacks()
self.generate_dataobjects_task_entries() # From GenericArch
self.generate_dataobjects_tcbs()
self.generate_dataobject_resources() # We have to generate resource objects, since the patmos compiler is weird.
def generate_dataobjects_task_stacks(self):
"""Generate the stacks for the tasks, including the task pointers"""
......@@ -58,6 +59,15 @@ class PatmosArch(GenericArch):
self.generator.source_file.data_manager.add(tcb, namespace = ("arch",))
subtask.impl.tcb_descriptor = tcb
def generate_dataobject_resources(self):
for resource in self.system_graph.resources:
res = DataObject("const ResourceType", "OSEKOS_RESOURCE_" + resource.name,
str(resource.conf.static_priority),
extern_c=True)
self.generator.source_file.data_manager.add(res)
def generate_isr(self, isr):
isr_desc = self.generator.system_graph.get(Subtask, isr.name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment