Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
3cb309df
Commit
3cb309df
authored
Jul 29, 2016
by
Jerome Hugues
Browse files
* Document usage of REAL related API calls
parent
60a10ef8
Changes
3
Hide whitespace changes
Inline
Side-by-side
resources/runtime/python/test/rma.aadl
0 → 100644
View file @
3cb309df
--
This
AADL
model
illustrates
how
to
conduct
schedulability
analysis
--
using
Cheddar
,
and
then
code
generation
of
periodic
tasks
.
--
--
Two
periodic
tasks
run
in
parallel
,
without
interaction
.
Tasks
--
parameters
allows
RMA
analysis
package
RMAAadl
public
-----------------
--
Subprograms
--
-----------------
subprogram
Hello_Spg_1
properties
source_language
=>
(
C
);
source_name
=>
"user_hello_spg_1"
;
source_text
=>
(
"hello.c"
);
end
Hello_Spg_1
;
subprogram
Hello_Spg_2
properties
source_language
=>
(
C
);
source_name
=>
"user_hello_spg_2"
;
source_text
=>
(
"hello.c"
);
end
Hello_Spg_2
;
-------------
--
Threads
--
-------------
thread
Task
end
Task
;
thread
implementation
Task
.
impl_1
calls
Mycalls
:
{
P_Spg
:
subprogram
Hello_Spg_1
;
};
properties
Dispatch_Protocol
=>
Periodic
;
Priority
=>
1
;
Period
=>
1000
ms
;
Compute_Execution_time
=>
0
ms
..
3
ms
;
Deadline
=>
1000
ms
;
end
Task
.
impl_1
;
thread
implementation
Task
.
impl_2
calls
Mycalls
:
{
P_Spg
:
subprogram
Hello_Spg_2
;
};
properties
Dispatch_Protocol
=>
Periodic
;
Priority
=>
2
;
Period
=>
500
ms
;
Compute_Execution_time
=>
0
ms
..
5
ms
;
Deadline
=>
500
ms
;
end
Task
.
impl_2
;
---------------
--
Processor
--
---------------
processor
cpu
end
cpu
;
processor
implementation
cpu
.
impl
properties
Scheduling_Protocol
=>
(
POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL
);
end
cpu
.
impl
;
---------------
--
Processes
--
---------------
process
node_a
end
node_a
;
process
implementation
node_a
.
impl
subcomponents
Task1
:
thread
Task
.
impl_1
;
Task2
:
thread
Task
.
impl_2
;
end
node_a
.
impl
;
------------
--
System
--
------------
system
rma
end
rma
;
system
implementation
rma
.
impl
subcomponents
node_a
:
process
node_a
.
impl
;
cpu
:
processor
cpu
.
impl
;
properties
Actual_Processor_Binding
=>
(
reference
(
cpu
))
applies
to
node_a
;
end
rma
.
impl
;
end
RMAAadl
;
resources/runtime/python/test/rma.real
0 → 100644
View file @
3cb309df
theorem check_scheduling
foreach e in system_set do
check(1=1);
end check_scheduling;
resources/runtime/python/test/test.py
View file @
3cb309df
...
...
@@ -7,45 +7,25 @@ def main ():
'''Test function'''
err
=
ocarina
.
load
(
"rma.aadl"
);
# load a file
print
'load("rma.aadl")'
print
err
if
err
[
1
]
!=
None
:
print
'info message: '
,
err
[
1
]
if
err
[
2
]
!=
[]:
print
'warning message: '
,
err
[
2
]
if
err
[
3
]
!=
[]:
print
'error message: '
,
err
[
3
]
sys
.
exit
(
2
)
print
'load("rma.aadl"),:'
,
err
err
=
ocarina
.
load
(
"deployment.aadl"
);
# load a file
print
'load("deployment.aadl")'
if
err
[
1
]
!=
None
:
print
'info message: '
,
err
[
1
]
if
err
[
2
]
!=
[]:
print
'warning message: '
,
err
[
2
]
if
err
[
3
]
!=
[]:
print
'error message: '
,
err
[
3
]
sys
.
exit
(
2
)
print
'load("deployment.aadl"):'
,
err
err
=
ocarina
.
analyze
();
# analyze models
print
'ocarina.analyze()'
if
err
[
1
]
!=
None
:
print
'info message: '
,
err
[
1
]
if
err
[
2
]
!=
[]:
print
'warning message: '
,
err
[
2
]
if
err
[
3
]
!=
[]:
print
'error message: '
,
err
[
3
]
sys
.
exit
(
2
)
print
'ocarina.analyze():'
,
err
err
=
ocarina
.
instantiate
(
"rma.impl"
);
# instantiate system
print
'ocarina.instantiate("rma.impl")'
if
err
[
1
]
!=
None
:
print
'info message: '
,
err
[
1
]
if
err
[
2
]
!=
[]:
print
'warning message: '
,
err
[
2
]
if
err
[
3
]
!=
[]:
print
'error message: '
,
err
[
3
]
sys
.
exit
(
2
)
print
'ocarina.instantiate("rma.impl"):'
,
err
err
=
ocarina
.
add_real_library
(
"rma.real"
);
print
err
;
err
=
ocarina
.
set_real_theorem
(
"check_scheduling"
);
print
err
;
err
=
ocarina
.
generate
(
ocarina
.
Backends
.
real_theorem
);
print
err
;
if
__name__
==
"__main__"
:
main
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment