Hit Count

Tuesday, April 13, 2010

SV Question- Difference Between Mailbox and Semaphore

Difference between mailbox and semaphore is very standard question asked in System Verilog interview,Some times it is asked indirectly.

Mailobox,Semaphore can pass the object or information(variable).For example, there are multiple driver looking to drive same interface(lets call interface A). If Verifciation environemtn uses Mailbox and provides packet to multiple driver,all of them is allowed access to packet and henace all can drive the interface A. This will create multiple driver on same interface.

In order to avoid this semaphore can be used which ensures that once driver X has access to object only driver X will be able to drive interface A. driver Y will have to wait till driver X returns the key so this will avoid multiple driver driving same interface.

1 comment:

  1. A wise man can learn more from a foolish question than a fool can learn from a wise answer. See the link below for more info.