synchro Synchronisation d'un ou plusieurs
signaux
d'horloge libre avec un signal d'horloge connue
REGLES DE SIMPLIFICATION UTILISEES PAR SIGNAL
L'ensemble des horloges d'un programme SIGNAL, muni de la relation d'ordre d'inclusion notée >= et des opérations d'union notées additivement et d'intersection notées multiplicativement, forme un treillis.
P(X) + P(Y) = P(X) <=> P(X) >= P(Y) P(X) P(Y) = P(Y) <=> P(X) >= P(Y) Commutativite : P(X) + P(Y) = P(Y) + P(X) ; P(X) P(Y) = P(Y) P(X) Idempotence : P(X) + P(X) = P(X) ; P(X) P(X) = P(X) Absorption : P(X) (P(X) + P(Y)) = P(X) ; P(X) + (P(X) P(Y)) = P(X) B logical => P(B) >= T(B) event(E) => T(E) = P(E)
SYNTAXE DES PROCESSUS (programmes) SIGNAL
Les éléments terminaux du langage (mots-clés) sont soulignés
un élément de syntaxe entre crochets ``[ ... ]'' est optionnel
``/'' indique une alternative
processus = process nom =
[ ( paramètres ) ]
{? signaux-entrée
! signaux-sortie }
corps
[ where signaux-locaux
[ processus ; processus ... ]
] end
processus = function nom =
{? signaux-entrée !
signaux-sortie }
paramètres = type nom , nom ...
; type nom , nom ...
signaux-entrée = signaux-sortie = type nom , ...
; type nom , ...
signaux-locaux = type nom [init val / expr-tableau]
, nom ... ; ...
type = [ [ val , ... ] ] type-scalaire
type-scalaire = event / logical / integer /
real / dpreal
corps = ( inst
inst
...
)
inst = nom := expr
inst = { nom , ... }
:= invocation-positionnel
inst = invocation-renommage
inst = nom := expr-tableau
inst = tableau-processus
expr = expression combinant processus élémentaires et
invocations en positionnel de processus à une seule sortie
invocation-positionnel = nom [ ( val , ...
) ] { expr , ... }
invocation-renommage = nom ( [ val , ...
] ) ? nom:nom, ...
! nom:nom, ...
nom = suite de caractères alpha-numériques
val = expression ne contenant que des constantes et/ou des paramètres
% commentaires entre pourcent %
EXEMPLE DE SYNTAXE
process EXEMPLE = () { ? integer A,B,C,D ; real Z ! real W } (| J:=A+B | Y :=BID(2){C} % invocation en positionnel % | BID(5) ? X:D ! Y:Y1 % invocation par identite de nom % | W:=(Y+Y1)*J/Z |) where integer J, Y, Y1 process BID = (integer PARAM) {? integer X ! integer Y } (| Y:=X*PARAM |) end end
EXEMPLES DE PROGRAMMES SIGNAL
% compteur sans fin (equivalent de #) % process cpt = () { ? logical top ! integer n } (| zn := n $1 % P(zn)=P(n) % | n := zn +1 % P(n)=P(zn) % | synchro{n, when top} % P(n)=T(top) % |) where integer zn init 0 end % P(n)=P(zn)=T(top) % % memorisation sur un signal booleen (equivalent de cell) % process mem = () { ? integer e; logical m ! integer s } (| zs := s $1 % P(zs)=P(s) % | s := e default zs % P(s)=P(e)+P(zs) => P(s)>=P(e) % | synchro{s, (event e) default (when m)} |) % P(s)=P(e)+T(m) rappel:T(m)<P(m) % where integer zs init 0 end % P(s)=P(zs)=P(e)+T(m) %
% compteur apres (equivalent de #after) % process cpt_a = () { ? logical top, raz ! integer n } (| zn := n $1 % P(zn)=P(n) % | n := (0 when raz) default (zn +1) % P(n)=T(raz)+P(zn) => P(n)>=T(raz) % | synchro{n, (when top) default (when raz)} |) % P(n)=T(top)+T(raz) % where integer zn init 0 end % P(n)=P(zn)=T(top)+T(raz) % % sablier % process sab = () { ? integer e ! integer n } (| zn := n $1 % P(zn)=P(n) % | n := e default (zn -1) % P(n)=P(e)+P(zn) => P(n)>P(e) % | raz := (zn=1) % P(raz)=P(zn) % | synchro{e, when raz} % P(e)=T(raz) % |) where integer zn init 1; logical raz end % P(n)=P(zn)=P(raz) > T(raz)=P(e) ``demand driven'' %
SYNTAXE DES TABLEAUX DE PROCESSUS ET
DE SIGNAUX DE TYPE TABLEAU
tableau-processus = array nom-index to val
of corps
[ with implicite , ... ]
end
implicite = nom (signal implicitement indexé dans corps)
implicite = nom [0]: nom (dépendance incrémentale)
implicite = nom [.]: nom (dépendance décrémentale)
expr-tableau = [ index expr , ... ]
index = élément / itération
élément = [ val ]:
itération = { [nom-index] [in val] to
val [step val] }:
nom-index = nom (signal implicitement déclaré de type entier)
y := [{to 9}:0, {i in 3 to 8 step 2}:1] where [9]integer yest équivalent a :
y := [[1]:0,[2]:0,[3]:1,[4]:0,[5]:1,[6]:0,[7]:1,[8]:0,[9]:0]
% filtre % process filt = (integer N; [N]real h) { ? real e ! real s } (| w := e window N | array i to N of x := x + w[(N-i)+1] * h[i] % ``x[i] := x[i-1] + w...'' % with x[0]:zero %initialisation d\'ependance incr\'ementale% end | zero := 0.0 | s := x[N] |) where real zero; [N]real x, w init [{to N-1}:0.0] end % P(e)=P(w)=P(x)=P(zero)=P(s) %exemple de contenu de fichier de paramètres (au niveau programme) :
[OL_E_SIGN] 3, [[1]:0.5,[2]0.25,[3]0.25]