RE: [sv-ec] When does the mailbox put task block

From: Clifford E. Cummings <cliffc_at_.....>
Date: Tue Nov 15 2005 - 17:48:38 PST
Hi, Chris -

I agree with Dave's comments but let me be very specific with answers to 
your questions below.

At 08:10 AM 11/9/2005, Rich, Dave wrote:
>Chris,
>
>There was a similar discussion about semaphores two months back. You have 
>to guarantee true FIFO ordering, so that if some other thread was already 
>waiting to do a put, they have to be serviced first.
>
>Dave
>
>
> > -----Original Message-----
> > From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Chris
> > Spear
> > Sent: Wednesday, November 09, 2005 3:30 AM
> > To: sv-ec@eda.org
> > Subject: [sv-ec] When does the mailbox put task block
> >
> > When does a mailbox put() block?  According to the LRM:
> >
> >       "If the mailbox was created with a bounded queue the process
> >       shall be suspended until there is enough room in the queue."
> >
> > These seems ambigious to me.  Does the message get placed into the queue
> > then the process is blocked?

No (my interpretation)

> > If I create a mailbox with a size of 1, does the first put() block, or the
> > second?

Second put blocks. First put places the message into the mailbox, which 
completes its duty. The first put completes and exits. The message is in 
the mailbox. The second put cannot put because the mailbox is full (until 
the message is getted(I know, there is no such word!)) and so it 
FIFO-queues waiting to put, but unlike the semaphore, we don't have the 
put-multiple FIFO question that we debated a while back.

> > Can a mailbox be configured so that the source produces one message, does
> > a put() which blocks immediately until the drain removes it with a get()?
> > This does not seem likely.

If I understand correctly, I agree that this cannot happen.

> > Here is my interpretation:
> >
> > If the mailbox was created with a bounded queue, put() will check if the
> > queue is full.  If the queue is not full, put() shall place the message in
> > the queue and return immediately.  If the queue is full, the put shall
> > block until the queue becomes non-full, at which point it shall place the
> > message into the queue and return."

I agree with this interpretation.

> > /*********************************************************
> > Chris Spear              Verification Specialist
> > Synopsys, Inc.           Phone 508-263-8114      ..  __@
> > 377 Simarano Drive       Fax   508-263-8123        _`\<,_
> > Marlboro, MA 01752 USA   Cell  508-254-7223    .. (*)/ (*)
> > Spear_ f rom _Synopsys.com       http://Chris.Spear.net
> > *********************************************************/
> >

----------------------------------------------------
Cliff Cummings - Sunburst Design, Inc.
14314 SW Allen Blvd., PMB 501, Beaverton, OR 97005
Phone: 503-641-8446 / FAX: 503-641-8486
cliffc@sunburst-design.com / www.sunburst-design.com
Expert Verilog, SystemVerilog, Synthesis and Verification Training
Received on Tue Nov 15 17:49:52 2005

This archive was generated by hypermail 2.1.8 : Tue Nov 15 2005 - 17:50:47 PST