Yet Another ServiceLoop() Question

From: Per Bojsen <bojsen_at_.....>
Date: Wed Mar 22 2006 - 20:46:40 PST
Hi,

ServiceLoop() has been stirring again.  Specifically, a question
has arisen about the pseudo code for ServiceLoop() in the 1.1 spec.
This code (on p. 47) consists of two independent loops.  The
first loop handles all pending input messages.  The second loop
handles what we've called service requests.  The way I read this
code the second loop cannot start until all pending input messages
have been sent to the HDL side.

Now, here is a scenario to consider: To make things simple suppose
there is a single input port on the HDL side and one or more
output ports (the exact number does not matter).  Now suppose two
input messages have been sent using Send() before ServiceLoop()
was entered.  Further assume that for whatever reason, the BFM
on the HDL side is keeping ReceiveReady on the input port deasserted.
Assume TransmitReady is also deasserted at the time ServiceLoop() is
entered (any previous message has already been transferred).

When ServiceLoop() is entered, the first while loop will send the
first input message to the port.  TransmitReady will then be asserted.
Now, what happens with the second message?  If the transactor does
not assert ReceiveReady the message cannot be sent to the port since
the first message is still waiting to be transferred.  Hence, the
first while loop will loop forever or at least until the transactor
decides to assert ReceiveReady, that is we have a deadlock.  Is this
a correct interpretation of the pseudo code?  What about the semantics
that was originally for the ServiceLoop() function?

The purpose of the above questions is merely to ensure I understand
the behavior of ServiceLoop() correctly.  I am not suggesting there
may be a problem here.  As we have discussed in the past, there are
many ways that the user can deadlock the system.  This appears to
be one of them.  One possible way to avoid such a deadlock is to
provide feedback to the SW side from the HW side via an output
port or using the input ready propagation mechanism to prevent the
SW side from sending messages when the BFM is not ready/willing to
receive them.

Per
Received on Wed Mar 22 20:46:43 2006

This archive was generated by hypermail 2.1.8 : Wed Mar 22 2006 - 20:46:48 PST