Question :- Difference between mailbox and queue ? 1) A mailbox is a built-in class around a queue that uses semaphores to control access to the ends of a queue. A mailbox only has FIFO element ordering whereas you can access the head, tail, or middle elements of a queue. You typically use a mailbox when there are multiple threads reading and writing data and you need the atomic test-and-set operation of semaphore to know when the mailbox is full or empty. 2) A queue is just a data structure, and a mailbox is an higher level concept that is built around a combination of queues and semaphores. If you have only one process reading and writing to the data structure, there is no need to use a mailbox. However if there are more than one thread, a mailbox is a convenient class to use. But if you have multiple threads, and need access to any position in the queue, you will need to write your own class to do that. The mailbox concept is in many other programming languages, so...
Posts
Showing posts from June, 2017
UVM Interview Questions
- Get link
- X
- Other Apps
1} What is UVM factory? Ans:- UVM Factory is used to manufacture (create) UVM objects and components. Apart from creating the UVM objects and components the factory concept essentially means that you can modify or substitute the nature of the components created by the factory without making changes to the testbench. For example, if you have written two driver classes, and the environment uses only one of them. By registering both the drivers with the factory, you can ask the factory to substitute the existing driver in the environment with the other type. The code needed to achieve this is minimal and can be written in the test. 2. What is the difference between new() and create? Ans: We all know about new() method that is used to allocate memory to an object instance. In UVM (and OVM), the create() method causes an object instance to be created from the factory. This allows you to use factory overrides to replace the desired object with an object of a dif...