System Verilog Constraint interview Questions
1) What is the most common reason why bugs are missed during the testing of the RTL design?
2) What is Randomization explain briefly?
3) Write a constraint to generate a random value for a ver1 [7:0] within 50 and var2 [7:0] with the non repeated value in every randomization?
4) What is the maximum range of randc variable most of the simulator can support? (Note:- some simulator support more)
5) Write a constraint without an inside function to generate vari value within the range of 34 to 43?
6) Why curly braces used in below constraint?
Constraint c1 {a==110; b==3;}
7) When the randomize function will give return value as zero?
8) How to randomize variable which is not labeled rand?
9) What is constraint solver?
10) Which are data type are randomized
· 2-state, 4-state, integer, string, bit vector, logic, real, enum
11) Write a single constraint to generate a random value for bit [8:0] variable in the below range,
1-34, 127, 129-156, 192-202,257-260
12) What is wrong with the below code? What is the correct process to write the constraint?
Class const;
rand bit [7:0] low, mid, high;
constraint Const_1 {low <mid<high;}
end class
13) What is the use of weighted distribution constraint and how to use it and what are the different types?
14) Write some sample code to using weighted constraint such as it should provide the same value and range value with weight using different types.?
15) Modify the constraint using only one operator so that var value will be var < low or var > high
Class seques;
Rand bit [7:0] var;
Bit [7:0] low,high;
Constraint var_range{var inside {[low:high]}; } // low <= var && var <= high;
Endclass
16) Is constraint are procedural code?
17) There is two constraints is applied to same variable one will generate the value within the range of [25:50] and another expression say variable value should be greater than 40. What should be the value generated, and what is the reason?
18) What is implication operator write a sample code/
19) What is equivalence operator explain briefly, write sample code?
20) What is solve before constraint, explain below code result?
Class solvebefore;
Rand bit ;
Rand bit [1:0] b;
Constraint SB_ab {
(a==0) -> y==0;
Solve a before b;
}
Endclass
21) How to control the multiple constraint blocks?
22) What are in-line constraints?
23) How to add an extra constraint without affecting existing?
24) Explain the below function
· $random
· $urandom
· $urandom_range
· $dist_exponential
· $dist_normal
· $dist_poisson
· $dist_uniform
25) Randomize the below variable such as
Class randvari;
rand bit [7:0] var1, var2, var3, var4;
endclass
i. Randomize all vvariable.
ii. Randomize only var2.
iii. Randomize var1, var4
iv. Randomize var1,var3,var4.
26) What is the problem using signed variables in constraint?
27) How to restrict the array size by using constraint write a code?
28) Write a constraint to create ascending array value ?
29) How to create an array of random unique values?
30) Create a unique array value with the a randc and help of class?
31) What is randcase?
32) In an initial block, construct an exercise object and randomize it, check the status from randomization?
33) What are bidirectional constraint?
For more question please refer Chris spear book page 224-227
please publish the answers of the above questions
ReplyDeleteWmyrrcanehi_Ann Arbor Kenny Bloch Download
ReplyDeletepiedriventif