Esterel Technologies
When should I use imported operators in SCADE models?
When do I have the "right" to use an Imported Operator?
An Imported Operator has to:
- be purely functional, that's to say always give the same outputs for a same given set of inputs. In other words, the Imported Operator should not contain any memory (no global or static variables manipulation)
- perform calculations that ALWAYS terminate (no infinite loops)
These two important points have to be handled by the coder. If one of them is not satisfied, the intrinsic properties of any SCADE design (determinism, execution of a cycle within a finite and bounded time) are, a priori, lost.
In which cases should I use imported operators instead of a SCADE representation?
According to the first point, you only have the choice between SCADE representation and imported functions when the operator to design behaves in a purely functional way. Yet, for functions that require the use of finite loops (for, while,…), such as sort algorithms or greatest common divisor computing, SCADE might not be expressive enough. In that case, a direct ADA/C implementation can turn out to be much more effective than the SCADE generated code. Finally, you will generally prefer SCADE for description, and choose direct ADA/C implementation to work around some expressiveness problems (such as for, while,…).
