This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How To Check Weather A Handles Is Holding Object Or Not ? |
|
Answer» It is BASICALLY checking if the object is INITIALIZED or not. In SystemVerilog all uninitialized object handles have a special value of null, and therefore whether it is holding an object or not can be found out by comparing the object handle to null. So the code will LOOK like:- 01.usb_packet My_usb_packet; It is basically checking if the object is initialized or not. In SystemVerilog all uninitialized object handles have a special value of null, and therefore whether it is holding an object or not can be found out by comparing the object handle to null. So the code will look like:- 01.usb_packet My_usb_packet; |
|
| 2. |
What Is The Difference Between Initial Block And Final Block? |
|
Answer» There are many difference between initial and final block. I am listing the few differences that is coming to MIND now.
Final block can be used to display statistical/genaral INFORMATION regarding the status of the execution like this:- 1.final begin There are many difference between initial and final block. I am listing the few differences that is coming to mind now. Final block can be used to display statistical/genaral information regarding the status of the execution like this:- 1.final begin |
|
| 3. |
What Is Layered Architecture ? |
|
Answer» In SystemVerilog based constrained random VERIFICATION ENVIRONMENT, the test environment is divided into multiple layered as shown in the figure. It allows verification component re-use ACROSS verification projects. In SystemVerilog based constrained random verification environment, the test environment is divided into multiple layered as shown in the figure. It allows verification component re-use across verification projects. |
|
| 4. |
What Is The Difference Between $rose And Posedge? |
|
Answer» POSEDGE RETURN an event, whereas $rose returns a Boolean VALUE. Therefore they are not interchangeable. posedge return an event, whereas $rose returns a Boolean value. Therefore they are not interchangeable. |
|
| 5. |
What Is The Difference Between Bits And Logic? |
|
Answer» BITS is 2-valued (1/0) and LOGIC is 4-valued (0/1/x/z) bits is 2-valued (1/0) and logic is 4-valued (0/1/x/z) |
|
| 6. |
What Is "scope Resolution Operator"? |
|
Answer» extern keyword ALLOWS out-of-body method declaration in CLASSES. Scope RESOLUTION operator ( :: ) links method declaration to class declaration. class XYZ; extern keyword allows out-of-body method declaration in classes. Scope resolution operator ( :: ) links method declaration to class declaration. class XYZ; |
|
| 7. |
What Is Tagged Union ? |
|
Answer» An union is used to stored multiple different kind/size of data in the same STORAGE location. 1.typedef union{ Now here XYZ union can contain either bit [31:0] data or an int data. It can be written with a bit [31:0] data and read-back with a int data. There is no TYPE-checking done. In the case where we want to enforce that the read-back data-type is same as the written data-type we can use TAGGED union which is declared using the QUALIFIER tagged. Whenever an union is defined as tagged, it stores the tag information along with the value (in expense of few extra bits). The tag and values can only be updated together using a statically type-checked tagged union expression. The data member value can be read with a type that is consistent with current tag value, making it impossible to write one type and read another type of value in tagged union. (the details of which can be found in section 3.10 and 7.15 of SV LRM 3.1a). 01.typedef union tagged{ An union is used to stored multiple different kind/size of data in the same storage location. 1.typedef union{ Now here XYZ union can contain either bit [31:0] data or an int data. It can be written with a bit [31:0] data and read-back with a int data. There is no type-checking done. In the case where we want to enforce that the read-back data-type is same as the written data-type we can use tagged union which is declared using the qualifier tagged. Whenever an union is defined as tagged, it stores the tag information along with the value (in expense of few extra bits). The tag and values can only be updated together using a statically type-checked tagged union expression. The data member value can be read with a type that is consistent with current tag value, making it impossible to write one type and read another type of value in tagged union. (the details of which can be found in section 3.10 and 7.15 of SV LRM 3.1a). 01.typedef union tagged{ |
|
| 8. |
What Is "this"? |
|
Answer» "this" POINTER REFERS to CURRENT INSTANCE. "this" pointer refers to current instance. |
|
| 9. |
What Is The Need Of Alias In Sv? |
|
Answer» The VERILOG has one-way ASSIGN statement is a unidirectional assignment and can CONTAIN delay and STRENGTH change. To have bidirectional short-circuit connection SystemVerilog has added alias statement. The Verilog has one-way assign statement is a unidirectional assignment and can contain delay and strength change. To have bidirectional short-circuit connection SystemVerilog has added alias statement. |
|
| 10. |
How To Randomize Dynamic Arrays Of Objects? |
|
Answer» class ABC; class ABC; |
|
| 11. |
What Is Cross Coverage ? |
|
Answer» Queue has a CERTAIN ORDER. It's hard to insert the data WITHIN the queue. But LINKEDLIST can easily insert the data in any location. Queue has a certain order. It's hard to insert the data within the queue. But Linkedlist can easily insert the data in any location. |
|
| 12. |
What Is Circular Dependency And How To Avoid This Problem ? |
|
Answer» 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 1.... 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 1.... |
|
| 13. |
Write A Clock Generator Without Using Always Block. |
|
Answer» USE of forever begin end. If it is a complex always BLOCK statement like always (@ posedge clk or negedge reset_) always @(posedge clk or negedge reset_) begin if(!reset_) begin // Using forever : slightly complex but doable forever begin Use of forever begin end. If it is a complex always block statement like always (@ posedge clk or negedge reset_) always @(posedge clk or negedge reset_) begin if(!reset_) begin // Using forever : slightly complex but doable forever begin |
|
| 14. |
What Is The Use Of Modports ? |
|
Answer» MODPORTS are part of Interface. Modports are USED for specifing the direction of the SIGNALS with RESPECT to various modules the interface connects to.
Modports are part of Interface. Modports are used for specifing the direction of the signals with respect to various modules the interface connects to. |
|
| 15. |
What Is The Difference Between Program Block And Module ? |
|
Answer» Program block is newly added in SystemVerilog. It serves these PURPOSES
Having said this the major difference between module and program blocks are
Program block is newly added in SystemVerilog. It serves these purposes Having said this the major difference between module and program blocks are |
|
| 16. |
What Is The Difference Between Byte And Bit [7:0]? |
|
Answer» BYTE is SIGNED WHEREAS BIT [7:0] is UNSIGNED. byte is signed whereas bit [7:0] is unsigned. |
|
| 17. |
Explain About Pass By Ref And Pass By Value? |
|
Answer» Pass by value is the default method through which arguments are passed into FUNCTIONS and tasks. Each SUBROUTINE retains a local copy of the argument. If the arguments are changed within the subroutine declaration, the changes do not AFFECT the caller. In pass by reference functions and tasks directly access the specified variables passed as arguments.Its like passing pointer of the variable. task pass(int i) // task pass(var int i) pass by reference Pass by value is the default method through which arguments are passed into functions and tasks. Each subroutine retains a local copy of the argument. If the arguments are changed within the subroutine declaration, the changes do not affect the caller. In pass by reference functions and tasks directly access the specified variables passed as arguments.Its like passing pointer of the variable. example: task pass(int i) // task pass(var int i) pass by reference |
|
| 18. |
Without Using Randomize Method Or Rand,generate An Array Of Unique Values? |
|
Answer» 1.... 1.... |
|
| 19. |
What Is Solve And Before Constraint ? |
|
Answer» 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. 1.... The solution of the constraint doesn't change with solve before construct. But the PROBABILITY of choosing a PARTICULAR solution change by it. 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. 1.... The solution of the constraint doesn't change with solve before construct. But the probability of choosing a particular solution change by it. |
|
| 20. |
What Are Bi-directional Constraints? |
|
Answer» 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)). 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)). |
|
| 21. |
What Is $root? |
|
Answer» $root refers to the TOP level instance in SystemVerilog 1.package ABC; $root refers to the top level instance in SystemVerilog 1.package ABC; |
|
| 22. |
What Is The Difference Between Rand And Randc? |
|
Answer» rand - Random Variable, same value might come before all the the possible value have been returned. Analogous to THROWING a DICE. randc - Random Cyclic Variable, same value doesn't GET returned until all possible value have been returned. Analogous to picking of CARD from a deck of card without replacing. Resource INTENSIVE, use sparingly/judiciously rand - Random Variable, same value might come before all the the possible value have been returned. Analogous to throwing a dice. randc - Random Cyclic Variable, same value doesn't get returned until all possible value have been returned. Analogous to picking of card from a deck of card without replacing. Resource intensive, use sparingly/judiciously |
|
| 23. |
How To Call The Task Which Is Defined In Parent Object Into Derived Class ? |
|
Answer» super.task_name(); super.task_name(); |
|
| 24. |
What Is The Use Of $cast? |
|
Answer» Type casting in SV can be done either VIA static casting (', ', ') or DYNAMIC casting via $cast task/function. $cast is very similar to dynamic_cast of C++. It checks WHETHER the casting is possible or not in run-time and errors-out if casting is not possible. Type casting in SV can be done either via static casting (', ', ') or dynamic casting via $cast task/function. $cast is very similar to dynamic_cast of C++. It checks whether the casting is possible or not in run-time and errors-out if casting is not possible. |
|
| 25. |
What Is The Use Of Packages? |
|
Answer» In Verilog declaration of data/task/function within modules are specific to the module only. They can't be shared between two modules. Agreed, we can ACHIEVE the same via cross module referencing or by including the files, both of which are known to be not a great solution. The package construct of SystemVerilog aims in solving the above issue. It allows having global data/task/function declaration which can be used across modules. It can contain module/class/function/task/constraints/covergroup and many more declarations (for complete list please refer section 18.2 of SV LRM 3.1a) The content inside the package can be ACCESSED using EITHER scope resolution operator (::), or using import (with option of referencing PARTICULAR or all content of the package). 01.package ABC; In Verilog declaration of data/task/function within modules are specific to the module only. They can't be shared between two modules. Agreed, we can achieve the same via cross module referencing or by including the files, both of which are known to be not a great solution. The package construct of SystemVerilog aims in solving the above issue. It allows having global data/task/function declaration which can be used across modules. It can contain module/class/function/task/constraints/covergroup and many more declarations (for complete list please refer section 18.2 of SV LRM 3.1a) The content inside the package can be accessed using either scope resolution operator (::), or using import (with option of referencing particular or all content of the package). 01.package ABC; |
|
| 26. |
What Is The Dfference Between Always_combo And Always@(*)? |
|
Answer» From SystemVerilog LRM 3.1a:-
A small SystemVerilog code snippet to illustrate #5 01.module dummy; From SystemVerilog LRM 3.1a:- A small SystemVerilog code snippet to illustrate #5 01.module dummy; |
|
| 27. |
List The Predefined Randomization Methods. |
Answer»
|
|
| 28. |
What Is Scope Randomization? |
|
Answer» Scope randomization ins SYSTEMVERILOG allows assignment of unconstrained or constrained random value to the variable within current scope 01.module MyModule; Scope randomization ins SystemVerilog allows assignment of unconstrained or constrained random value to the variable within current scope 01.module MyModule; |
|
| 29. |
What Is The Difference Between $random() And $urandom()? |
| Answer» | |
| 30. |
What Data Structure You Used To Build Scoreboard? |
|
Answer» In SV, we use mailbox to get data from different modules and compare the result. class Scoreboard; function new(mailbox drvr2sb,mailbox rcvr2sb); task start(); In VMM, we use channels to CONNECT all the modules and compare the result. class Scoreboard extends vmm_xactor; function new(string inst = "class", task main(); In SV, we use mailbox to get data from different modules and compare the result. class Scoreboard; function new(mailbox drvr2sb,mailbox rcvr2sb); task start(); In VMM, we use channels to connect all the modules and compare the result. class Scoreboard extends vmm_xactor; function new(string inst = "class", task main(); |
|
| 31. |
What Is The Difference Between Mailbox And Queue? |
|
Answer» A queue is a variable-size, ordered collection of homogeneous elements. A Queue is analogous to one dimensional unpacked array that grows and shrinks automatically. Queues can be used to model a LAST in, first out buffer or first in, first out buffer. // Other DATA type as REFERENCE int q[$] = { 2, 4, 8 }; A mailbox is a communication mechanism that allows messages to be exchanged between processes. Data can be sent to a mailbox by one process and retrieved by another. A queue is a variable-size, ordered collection of homogeneous elements. A Queue is analogous to one dimensional unpacked array that grows and shrinks automatically. Queues can be used to model a last in, first out buffer or first in, first out buffer. // Other data type as reference int q[$] = { 2, 4, 8 }; A mailbox is a communication mechanism that allows messages to be exchanged between processes. Data can be sent to a mailbox by one process and retrieved by another. |
|
| 32. |
What Is The Need Of Virtual Interfaces ? |
|
Answer» An interface encapsulate a group of inter-related wires, along with their directions (via modports) and synchronization details (via clocking block). The major usage of interface is to simplify the connection between modules. But Interface can't be instantiated inside program block, class (or SIMILAR non-module entity in SystemVerilog). But they needed to be driven from VERIFICATION environment like class. To solve this issue virtual interface concept was INTRODUCED in SV. Virtual interface is a data type (that implies it can be instantiated in a class) which hold reference to an interface (that implies the class can DRIVE the interface using the virtual interface). It provides a mechanism for separating abstract models and test programs from the actual signals that make up the design. Another big advantage of virtual interface is that class can dynamically CONNECT to different physical interfaces in run time. An interface encapsulate a group of inter-related wires, along with their directions (via modports) and synchronization details (via clocking block). The major usage of interface is to simplify the connection between modules. But Interface can't be instantiated inside program block, class (or similar non-module entity in SystemVerilog). But they needed to be driven from verification environment like class. To solve this issue virtual interface concept was introduced in SV. Virtual interface is a data type (that implies it can be instantiated in a class) which hold reference to an interface (that implies the class can drive the interface using the virtual interface). It provides a mechanism for separating abstract models and test programs from the actual signals that make up the design. Another big advantage of virtual interface is that class can dynamically connect to different physical interfaces in run time. |
|
| 33. |
What Are The Types Of Coverages Available In Sv ? |
|
Answer» Using covergroup : VARIABLES, expression, and their CROSS Using COVER keyword : PROPERTIES Using covergroup : variables, expression, and their cross Using cover keyword : properties |
|
| 34. |
What Are The Ways To Avoid Race Condition Between Testbench And Rtl Using Systemverilog? |
|
Answer» There are mainly following WAYS to avoid the race condition between testbench and RTL using SYSTEM VERILOG There are mainly following ways to avoid the race condition between testbench and RTL using system verilog |
|
| 35. |
What Is The Need Of Clocking Blocks ? |
Answer»
- Clock specification
EXAMPLE : 01.Module M1(ck, enin, din, enout, dout); - Clock specification Example : 01.Module M1(ck, enin, din, enout, dout); |
|
| 36. |
Explain The Difference Between Data Types Logic And Reg And Wire ? |
|
Answer» Wire are Reg are present in the verilog and system verilog adds one more data type called logic. Wire : Wire data type is used in the continuous assignments or ports list. It is treated as a wire So it can not hold a value. It can be driven and read. Wires are used for connecting different MODULES. Reg : Reg is a date storage element in system verilog. Its not a actual HARDWARE register but it can store values. Register retain there value until next assignment statement. Logic : System verilog added this additional datatype extends the rand EG type so it can be driven by a single driver such as gate or MODULE. The main difference between logic dataype and reg/wire is that a logic can be driven by both continuous assignment or blocking/non blocking assignment. Wire are Reg are present in the verilog and system verilog adds one more data type called logic. Wire : Wire data type is used in the continuous assignments or ports list. It is treated as a wire So it can not hold a value. It can be driven and read. Wires are used for connecting different modules. Reg : Reg is a date storage element in system verilog. Its not a actual hardware register but it can store values. Register retain there value until next assignment statement. Logic : System verilog added this additional datatype extends the rand eg type so it can be driven by a single driver such as gate or module. The main difference between logic dataype and reg/wire is that a logic can be driven by both continuous assignment or blocking/non blocking assignment. |
|
| 37. |
What Is Factory Pattern ? |
|
Answer» Factory Pattern Concept : Methodologies like OVM and VMM make heavy use of the factory concept. The factory method pattern is an object-oriented design pattern. Like other creational patterns, it deals with the problem of creating objects (products) without specifying the exact class of object that will be created. The factory method design pattern handles this problem by DEFINING a separate method for creating the objects, whose subclasses can then override to specify the derived type of product that will be created. More generally, the term factory method is often used to refer to any method whose main purpose is creation of objects. Or in simple terms factory pattern help in creation of the object when you dont know the exact type of the object. the normal way of creating the object is : 01.// Normal Type based object creation Factory Pattern Concept : Methodologies like OVM and VMM make heavy use of the factory concept. The factory method pattern is an object-oriented design pattern. Like other creational patterns, it deals with the problem of creating objects (products) without specifying the exact class of object that will be created. The factory method design pattern handles this problem by defining a separate method for creating the objects, whose subclasses can then override to specify the derived type of product that will be created. More generally, the term factory method is often used to refer to any method whose main purpose is creation of objects. Or in simple terms factory pattern help in creation of the object when you dont know the exact type of the object. the normal way of creating the object is : 01.// Normal Type based object creation |
|
| 38. |
What Is Callback ? |
|
Answer» In computer PROGRAMMING, a callback is executable code that is passed as an argument to other code. It ALLOWS a lower-level SOFTWARE LAYER to call a SUBROUTINE (or function) defined in a higher-level layer. In computer programming, a callback is executable code that is passed as an argument to other code. It allows a lower-level software layer to call a subroutine (or function) defined in a higher-level layer. |
|