Re: SDL-News: Query on how SAVE works


Subject: Re: SDL-News: Query on how SAVE works
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Wed Mar 21 2001 - 19:39:15 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 -----

vbidarakoppa#opuswave.com at vbidarakoppa#opuswave.com wrote on 21/03/2001
17:16:

> I am aware of the fact that whenever the signal B is encountered , it is put
> back into the Signal Input queue and then it is retrived in the successive
> states.
>
> But what happenes when:
> One B Signal arrives which is Saved, then a consecutive B Signal arrives -
> does the previous B Signal get overwritten or will there be two separate B
> Signals stored in the Signal input queue? Incase there are two separate B
> Signals stored how will the memory for the parameters of the signal get
> allocated?
>
> Your help will be appreciated.

It is probably better to think of the effect of SAVE in the following way.

The SDL specification for a STATE consists of the identity of the state and
the identity of the types of signal that can be consumed in that state. The
name given to a signal is the name of a signal type. The instances of
signals do not have names.

The signals that can be consumed in a state are:

1. those signal given in an INPUT leading to a transition,

and

2. any signal in the "valid input signal set" for that are not mentioned in
a SAVE for that state and not mentioned explicitly in an INPUT. These
signals are consumed and then there is an implicit transition back to the
same state.

So what a SAVE does is prevent a signal type having an implicit transition
back to the same state that consumes the signal.

So if the an instance of signal B arrives and the receiver is in a state
where it B is not consumed (that is there is a SAVE of B), the signal
instance is saved in the input port. If another instance of B arrives, and
the receiver is still in the state, this instance of B will remain in the
input port as well, queued after the first instance.

When some event (such as an A signal leading to a transition to another
state) causes the state to be left, all the B signal instances that have
arrived are still in the input port.

If the next state can consume a B signal leading to a third state (there is
an INPUT for B), only one B instance is consumed. Once the signal instance
has been consumed, it is ceases to exists and therefore cannot be consumed
again.

If the next state did not have an INPUT or SAVE for B, then there is an
implicit transition to the state that consumes a B instance. This will
consumes each instance in turn, so a signal for an INPUT leading to a
transition to another state before any of the B instances will leave these
instances in the input port. What happens next will be determined by the
state that is reached.

How the memory is allocated for each instance is an implementation issue,
but there needs to be memory allocated for each instance, until it is
consumed.

Note that signals are always consumed one at a time, and it is possible for
signals to arrive in the input port faster than they are being consumed even
if there are no SAVE constructs. Obviously if this persists the input port
requires an infinite memory, so in practice receiving signals faster than
they are being consumed can only be allowed as a transient behaviour, and on
average it must be possible to consume signals at least as fast as they are
being received. This is (of course) another implementation issue.

--
Rick Reed - rickreed#tseng.co.uk
Tel:+44 1455 55 96 55 Fax:+44 1455 55 96 58 Mob.:+44 7970 50 96 50

--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