Subject: Re: SDL-News: calling a procedure defined in other service
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Fri May 23 2003 - 23:10:56 GMT
Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----
Scott Shen at Scott.Shen#holleycomm.com wrote on 22/05/2003 23:42:
> I wonder we can call a procedure defined in other service from a service? Here
> is what I am trying:
> I created a process (process_1), in process_1 I created two services
> (service_1 and service_2); in service_1 I created a procedure (procedure_1)
> and declare it "exported"; at the process_1 scope I declared that procedure_1
> is a "remote". Then, in service_2 I declared procedure_1 as imported and tried
> to call procedure_1 from service_2, no luck. There was no error or any warning
> but my simulation doesn't seem to execute the imported procedure (procedure_1)
> properly. Any clue?
I have this tried it on Telelogic Tau 4.6 and Cinderella 1.3.a23.
I used the model below.
It seems that it works as expected on Tau.
IMPORTED PROCEDURE p1;/*needed by Cinderella - but not SDT*/
Otherwise both tools analysed the model without errors.
A simulation run using Telelogic Tau and sending signal t from the
environment worked as expected and the remote procedure was called (using
the remote procedure call mechanism). I had to symbol step the simulator 2
or 3 times to enter/leave the procedure.
In Cinderella, however, when p1 was called the process entered a "paused"
state. A further single step of the model caused Cinderella to lock up.
It therefore seems that in Cinderella the remote procedure call causes all
the process to wait for the procedure response and other signals - even for
other services and including the procedure call signal itself - are ignored.
The simulated system is therefore deadlocked. Cinderella fails to detect
-- Rick Reed - rickreed#tseng.co.uk Tel:+44 15394 88462 Mob.:+44 7970 50 96 50
SYSTEM S; SIGNAL s, t; CHANNEL c NODELAY FROM ENV TO b WITH s, t; ENDCHANNEL c; BLOCK b REFERENCED; ENDSYSTEM S;
BLOCK b; SIGNALROUTE r FROM ENV TO p WITH s, t; PROCESS p REFERENCED; CONNECT c AND r; ENDBLOCK b;
PROCESS p; REMOTE PROCEDURE p1; SIGNALROUTE r1 FROM ENV TO s1 WITH s; SIGNALROUTE r2 FROM ENV TO s2 WITH t; CONNECT r AND r1, r2; SERVICE s1 REFERENCED; SERVICE s2 REFERENCED; ENDPROCESS p;
SERVICE s1; EXPORTED PROCEDURE p1 REFERENCED;
START; NEXTSTATE wait;
STATE wait; INPUT s; NEXTSTATE wait; ENDSTATE; ENDSERVICE s1;
EXPORTED PROCEDURE p1;
START; RETURN; ENDPROCEDURE p1;
SERVICE s2; IMPORTED PROCEDURE p1;/*needed by Cinderella - but not SDT*/ START; NEXTSTATE wait;
STATE wait; INPUT t; CALL p1; NEXTSTATE wait; ENDSTATE; ENDSERVICE s2;
--End text from Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews --- For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>
This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT