**13. What is the difference between mailbox and queue?**

Ans:-

Mailbox are FIFO queue, which allows only atomic operations. They can be bounded/unbounded. A bounded mailbox can suspend the thread (while writing if full, while reading if empty) via get/put task. Thats why mailbox is well suited for communication between threads.

**24. What is the use of $cast?**

Ans:-

Typecasting in SV can be done either via static casting (

**27. What is $unit?**

Ans:-

Refer these 2 doc form more details

- http://www.systemverilog.org/pdf/SystemVerilog_Overall_31A.pdf
- SV LRM 3.1a :: Section 18.3

**28 .What are bi-directional constraints?**

Ans:-

Constraints by-default in SystemVerilog are bi-directional. That implies that the constraint solver doesn't follow the sequence in which the constraints are specified. All the variables are looked simultaneously. Even the procedural looking constrains like if ... else ... and -> constrains, both if and else part are tried to solve concurrently. For example (a==0) -> (b==1) shall be solved as all the possible solution of (!(a==0) || (b==1)).

**29. What is solve...before constraint ?**

Ans:-

In the case where the user want to specify the order in which the constraints solver shall solve the constraints, the user can specify the order via solve before construct. i.e.

... constraint XYZ { a inside {[0:100]|; b < 20; a + b > 30; solve a before b; }

The solution of the constraint doesn't change with solve before construct. But the probability of choosing a particular solution change by it.

**40. What is circular dependency and how to avoid this problem ?**

Ans:-

Over specifying the solving order might result in circular dependency, for which there is no solution, and the constraint solver might give error/warning or no constraining. Example

... int x, y, z; constraint XYZ { solve x before y; solve y before z; solve z before x; .... }

## 0 comments:

## Post a Comment