Closed nuaaysh closed 4 years ago
Hi, Yes, that's correct. TASTE is used to model the complete system, that can then be made of multiple functions implemented either in SDL with Opengeode, or with other languages such as C, Ada, or Simulink. TASTE generates the code that orchestrates the execution of the system with threads, a scheduler and a middleware to distribute the messages.
Thank you!
So, The simplicity of SDL focuses on the functionality modelling by EFSM (Extended Finite State Machine), but AADL supports the Behaviour Annex (also a kind of state machine) and the BLESS Annex, so I hope to know the differences among them, I am reading these three languages, and try to find respective advantages and disadvantages.
So why did you select SDL to model the function? Which kind of functions are suitable for SDL specifications? (The motivation is asynchronous communication?)
Could you please give me some suggestions?
In TASTE we use AADL only for the logical and physical architectures. The logical architecture in TASTE is nearly identical, from a semantic point of view, to the SDL communication diagram, with the following exceptions:
AADL allows to explicitely expose synchronous interfaces (SDL has remote procedures, but the communication is not visible on the diagram)
cyclic interfaces: with AADL we can specify that a function is periodic, which cannot be done in SDL (we have to use SDL timers and the model must explicitely set the timer)
AADL allows to add properties to any part of the model, which is very convenient. We added for example the property "implementation language" that allows to specify that a specific block will be implemented in SDL while another one in C++.
The physical architecture does not exist in SDL - actual processes, threads, shared resources, and binding of functions on actual hardware.
AADL's behavioural annex is in my opinion a bad idea. There is no need for a new syntax and semantics for state machines, and obviously, that can only cover a tiny part of what SDL can do.
We selected SDL because it is a properly defined language (solid standard) with clear and complete syntax and semantics to cover state machines. It scales up well and has been used for long time with success in many domains (like telecommunication and aeronautics).
SDL is formal enough to allow simulation, code generation and formal verification of properties (with model checking). In my opinion it is just the right language for the behavioural modelling of embedded systems - together with Simulink for control laws, and Ada for low-level coding.
Thanks for your detailed introduction!
But I am not so clear why we select SDL, because people may say SCADE is good at behavioural modelling, AADL behavioural Annex is also a standard, focusing on behavioural modelling,... All of them have complete syntax and semantics and are successful to be adopted to develop many applications.
SDL has one advantage that it uses ASN.1 to exchange message. Also SDL uses EFSM to model functionality, TASTE project uses SCADE, SDL, C, Ada, etc to model behaviours,
But I check all available materials (papers from you and Jérôme Hugues, presentation of taste), I don't find an explanation of how to select the right language to model specific behaviours. Maybe for Aviation software, we select AADL+SCADE; for telecommunication software, we use AADL+SDL; But for other new domains, we should know why we use SDL.
Many Thanks!
Q2: I find the SDL procedure_call can't be assigned to other variables, but I can define a procedure_call has a return type. So can a procedure return a value?
I know an Ada procedure doesn't have a return, only an Ada function can return something, so I guess the SDL procedure_call likes the Ada procedure. Also, I check the source code from ogAST.py: line 449 writes: 'Procedure calls content is identical to Outputs', I'm confused about this sentence.
Sorry, about question2, the procedure_call should be the procedure.
In my opinion you should use SDL whenever you have communicating state machines in your system, which is the case of most embedded systems (and telecommunication protocols, etc).
I am not sure the AADL Behavioural Annex can compare to SDL (no tools, no graphical view or editors, no code generators, not even a website.. and the standard is commercial). SDL in comparison is a complete language, and the support of ASN.1 and data manipulation is essential to model real systems.
SCADE is a synchronous data flow modelling tool. It compares more to Matlab Simulink but with more formal foundations (Lustre). Use it to model control laws.
I hope that answers your question about the selection of the language.
Regarding the SDL procedures: they can return a value in two ways: with a return statement, or using in/out parameters.
There is an example in the test-recursion
testcase.
You have to declare the procedure signature in a textbox inside the procedure like this:
And then you can call the procedure from a TASK symbol:
The generated code will look like this:
Thanks! I learn a lot from your reply! But sorry for question two, I didn't describe my question well.
About Q2, for instance, I declare a procedure with a return type:
If I use a Task symbol, it is OK, the generated Ada code is a function with a return type, but if I use the call symbol, I can't use an assignment ':='. And If I only save the procedure name and the parameter, it's OK, but the generated Ada code is an Ada procedure. So does it mean I can use a procedure with a return type in the procedure call.
That's correct, the CALL symbol cannot be used to get the return value. If there is a return value as you point out, you must use a TASK symbol. Sorry I do not understand what you mean about the Ada procedure and what is the question.
Thanks a lot.
About the Ada procedure, I just would like to express the Ada procedure doesn't have a return statement. So if I use an SDL procedure in a CALL symbol, the generated Ada code doesn't include a return statement.
My third question is about the type of channel.
Q3: Is it a nodelaying channel at the current version (between process and ENV)? If I use a delaying channel, what is the generated Ada code?
In fact, I find OpenGEODE only accepts a subset of SDL92 and some features of SDL2000, for instance, structure information is missing (TASTE does it). There is no information about the type of channel within the source OpenGEODE code.
Q4: do you have a detailed BNF for OpenDEODE? Within the source project, sdl92.g includes many details but some of them are useless, for instance, we only have one block and one process. ogAST.py also says the system's blocks & channels are list type... If the BNF document is missing, I could try to write one and maybe you could give me some suggestions when you're free.
I also check some test examples, it's really helpful for me to understand how to design SDL model within OpenGEODE. Thanks!
Thanks a lot.
About the Ada procedure, I just would like to express the Ada procedure doesn't have a return statement. So if I use an SDL procedure in a CALL symbol, the generated Ada code doesn't include a return statement.
Sorry I still do not understand the question. If the SDL procedure has no "returns" statement in the declaration then an Ada procedure will be generated, otherwise an Ada function will be generated.
Dear Author,
Hello, I am coming back.
Q5: OpeGEODE in my Ubuntu20 only works on the root mode, how can I use it on user-mode?
Recently I tried to install OpenGEODE on my Ubuntu, but I meet a very strange question:
After I complete the command "sudo make full-install", it returns I installed successfully, and the execution file is located in the path "/.local/bin/". So I add the path to PATH and update the environment.
However, I can't use the opengeode command in user-mode ($), if I use "sudo opengeode" or (#), it works!
In user-mode: it returns an error:
Traceback (most recent call last):
File "/usr/bin/opengeode", line 5, in
I try to google it, it seems this error is related to Python.
But I have no idea how to fix it, could you please give me some suggestions?
Best wishes,
The instructions in the README are misleading - sorry.
Run without sudo:
$ make install
And add ~/.local/bin to your PATH
sudo is needed only to install the dependencies. I will update the instructions and the makefile
Now I can't just run the command 'make install', maybe I used the command 'sudo make full-install' before.
So, can I just remove the '~/opengeode' folder? And then git clone again and install opengeode.
If I run the command 'make install', the terminal reports an error as below:
shyuan@shyuan:~/opengeode$ make install
Processing /home/shyuan/opengeode
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-req-build-0blxy1zh/setup.py'"'"'; __file__=
'"'"'/tmp/pip-req-build-0blxy1zh/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);
code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
egg_info --egg-base /tmp/pip-req-build-0blxy1zh/pip-egg-info
cwd: /tmp/pip-req-build-0blxy1zh/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-0blxy1zh/setup.py", line 12, in <module>
import opengeode
File "/tmp/pip-req-build-0blxy1zh/opengeode/__init__.py", line 27, in <module>
from . import opengeode
File "/tmp/pip-req-build-0blxy1zh/opengeode/opengeode.py", line 48, in <module>
from . import(undoCommands, # NOQA
File "/tmp/pip-req-build-0blxy1zh/opengeode/undoCommands.py", line 21, in <module>
from PySide2.QtGui import *
ModuleNotFoundError: No module named 'PySide2.QtGui'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
make: *** [Makefile:54: install] Error 1
Mmh, that's weird, if you installed dependencies, PySide2 should be there. Can you try the following command:
$ sudo apt install python3-pyside2.*
and report the result?
shyuan@shyuan:~$ sudo apt install python3-pyside2.*
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-pyside2.*
so I try :'sudo apt-get install python3-pyside2.*' It works, and I need 10ms to download all packages
No errors, all information is here:
shyuan@shyuan:~$ sudo apt-get install python3-pyside2.*
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed
(...)
Need to get 51.0 MB of archives.
After this operation, 209 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:27 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 python3-pyside2.qtgui amd64 5.14.0-1~exp1ubuntu5 [995 kB]
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Ok so you were clearly missing PySide2
Now that it is installed, try again make install
from opengeode folder.
Thanks a lot! Now it works.
Hello,
I have several questions about the tool:
Q1: I find the tool only supports a little structure information, A SDL model accepted by OpenGEODE has one system, one block, and only one process, within the process, we can model some functions using state machines and procedures. We guess the main reason may be that OpenGEODE is a part of the TASTE tool, the structure information could be described by AADL, SDL only focuses on the functionality of systems. Is it right?
I am reading the source code of your tool and the latest recommendation ITU-T Z.100 (2019). The latest version may help me to understand SDL. So I will have other questions about your tool soon.
Could you please give me some suggestions when you are free? Many Thanks!
Best wishes,