Mailbox & Semaphores in SystemVerilog With Examples
Mailbox & Semaphores in SystemVerilog With Examples
&
Semaphores
Mailboxes
A Mailbox is a communication mechanism that allows messages to be exchanged between processes.
The process which wants to talk to another process posts the message to a mailbox (which stores the messages
temporarily in a system defined memory object) to pass it to the desired process.
• Bounded mailbox
• Unbounded mailbox
Built-in Functions of Mailboxes
Mailbox is a built-in class that provides the following methods:
A semaphore is like a bucket with the number of keys. processes using semaphores must first procure a key
from the bucket before they can continue to execute, All other processes must wait until enough keys are returned
to the bucket.
new(); Create a semaphore with a specified number of keys as argument (default: 1 key)