Verification Interview Questions
Verification Interview Questions
Verification Interview Questions
uvm_sequence_item extended from uvm_transaction only, uvm_sequence_item class has more functionality to
support sequence & sequencer features. uvm_sequence_item provides the hooks for sequencer and sequence , So you
can generate transaction by using sequence and sequencer , and uvm_transaction provide only basic methods like
do_print and do_record etc .
Modularity and Reusability – The methodology is designed as modular components (Driver, Sequencer, Agents ,
env etc) which enables reusing components across unit level to multi-unit or chip level verification as well as across
projects.
Separating Tests from Testbenches – Tests in terms of stimulus/sequencers are kept separate from the actual
testbench hierarchy and hence there can be reuse of stimulus across different units or across projects
Simulator independent – The base class library and the methodology is supported by all simulators and hence
there is no dependence on any specific simulator
Better control on Stimulus generation – Sequence methodology gives good control on stimulus generation. There
are several ways in which sequences can be developed which includes randomization, layered sequences, virtual
sequences etc which provides a good control and rich stimulus generation capability.
Easy configuration – Config mechanisms simplify configuration of objects with deep hierarchy. The configuration
mechanism helps in easily configuring different testbench components based on which verification environment
uses it and without worrying about how deep any component is in testbench hierarchy
Factory mechanism – Factory mechanisms simplifies modification of components easily. Creating each
components using factory enables them to be overridden in different tests or environments without changing
underlying code base.
7. What is the super keyword? What is the need of calling super.build() and super.connect()?
Ans:
8. Is uvm is independent of systemverilog ?
Ans: UVM is a methodology based on SystemVerilog language and is not a language on its own. It is a standardized
methodology that defines several best practices in verification to enable efficiency in terms of reuse and is also
currently part of IEEE 1800.2 working group.
9. Can we have a user-defined phase in UVM?
Ans: In addition to the predefined phases available in uvm, the user has the option to add his own phase to a
component. This is typically done by extending the uvm_phase class the constructor needs to call super.new which
has three arguments
Name of the phase task or function
Top down or bottom up phase
Task or function
The call_task or call_func and get_type_name need to be implemented to complete the addition of new phase.
Below is a simple example
Example
class custom_phase extends uvm_phase;
function new();
super.new(“custom”,1,1);
endfunction
uvm_analysis_port
Broadcasts a value to all subscribers implementing a uvm_analysis_imp.
uvm_analysis_imp
Receives all transactions broadcasted by a uvm_analysis_port.
uvm_analysis_export
Exports a lower-level uvm_analysis_imp to its parent.
start_item and finish_item together will initiate operation of a sequence item. If the item has not already been
initialized using create_item, then it will be initialized here to use the default sequencer specified by m_sequencer.
16. What is the difference between UVM RAL model backdoor write/read and front door write/read?
Ans: Fontdoor access means using the standard access mechanism external to the DUT to read or write to a register.
This usually involves sequences of time-consuming transactions on a bus interface.
Backdoor access means accessing a register directly via hierarchical reference or outside the language via the PLI. A
backdoor reference usually in 0 simulation time.
19. What is the difference between Active mode and Passive mode?
Ans: An agent is a collection of a sequencer, a driver and a monitor.
In active mode, the sequencer and the driver are constructed and stimulus is generated by sequences sending
sequence items to the driver through the sequencer. At the same time the monitor assembles pin level activity into
analysis transactions.
In passive mode, only the monitor is constructed and it performs the same function as in an active agent. Therefore,
your passive agent has no need for a sequencer. You can set up the monitor using a configuration object.
The copy() method can be used as needed in the UVM testbench. One common place where the copy() method is used
is to copy the sampled transaction and pass it into a sb_calc_exp() (scoreboard calculate expected) external function
that is frequently used by the scoreboard predictor.
The clone() method calls the create() method (constructs an object of the same type) and then calls the copy() method.
It is a one-step command to create and copy an existing object to a new object handle.
21. What is the UVM factory?
Ans: UCM 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 environment with the other type.
The code needed to achieve this is minimal, and can be written in the test.
Configuration is a mechanism in UVM that higher level components in a hierarchy can configure the lower level
components variables. Using set_config_* methods, user can configure integer, string and objects of lower level
components. Without this mechanism, user should access the lower level component using hierarchy paths, which
restricts re-usability.
This mechanism can be used only with components. Sequences and transactions cannot be configured using this
mechanism. When set_config_* method is called, the data is stored w.r.t strings in a table. There is also a global
configuration table.
Higher level component can set the configuration data in level component table. It is the responsibility of the lower
level component to get the data from the component table and update the appropriate table.
following are the method to configure integer, string and object of uvm_object based class
function void set_config_string (string inst_name, string field_name, string value)
function void set_config_object (string inst_name, string field_name, uvm_object value, bit clone =1)
1. Type overriding
Type overriding means that every time a component class type is created in the Testbench hierarchy, a substitute type
i.e. derived class of the original component class, is created in its place. It applies to all the instances of that component
type.
Syntax:
<original_type>::type_id::set_type_override(<substitute_type>::get_type(), replace);
where “replace” is a bit which is when set equals to 1, enables the overriding of an existing override else existing
override is honoured.
2. Instance overriding
In Instance Overriding, as name indicates it substitutes ONLY a particular instance of the component OR a set of
instances with the intended component. The instance to be substituted is specified using the UVM component
hierarchy.
Syntax:
<original_type>::type_id::set_inst_override(<substitute_type>::get_type(), <path_string>);
A sequence which controls stimulus generation across more than one sequencer, coordinate the stimulus across
different interfaces and the interactions between them. Usually the top level of the sequence hierarchy i.e. 'master
sequence' or 'coordinator sequence'. Virtual sequences do not need their own sequencer, as they do not link directly to
drivers. When they have one it is called a virtual sequencer.
31. What is the symbolic representation of port, export and analysis port?
Ans:
=>Port, =>Export, => Analysis Port
32. What is the difference in usage of $finish and global stop request in UVM?
Ans: The verilog $finish task does actually print the line number and file name along with time where it stopped.
However, global_stop_request() does not.
1. What is the difference between an initial and final block of the system verilog?
Ans. Initial block is getting executed at start of simulation while Final block is getting executed at end of simulation.
Both of them gets executed only once during the simulation, You can schedule an event or have delay in initial block But you can’t schedule an event
or have delay in final block.
2. Explain the simulation phases of System Verilog verification?
Ans. Build phase, connect phase and Run phase
3. What is the Difference between SystemVerilog packed and unpacked array?
Ans.
The term packed array is used to refer to the dimensions declared before the data identifier name
The term unpacked array is used to refer to the dimensions declared after the data identifier name
7. in SystemVerilog which array type is preferred for memory declaration and why?
Ans: Associative arrays are better to model large arrays as memory is allocated only when an entry is written into the array. Dynamic arrays on the
other hand need memory to be allocated and initialized before using.(When the size of the collection is unknown or the data space is sparse, an
associative array is a better option. In associative array, it uses the transaction names as the keys in associative array.
e.g. int array[string];)
8. How to avoid race round condition between DUT and test bench in System Verilog verification?
Ans. In test bench, if driving is done at posedge and reading in DUT is done at the same time , then there is race.
27. What is the difference between the clocking block and modport?
Ans: A clocking block specifies timing and synchronization for a group of signals.
Modports defines inputs and outputs
40. What is the difference between task and function in class and Module?
Ans: A function is meant to do some processing on the input and return a single value, whereas a task is more general and can calculate multiple
result values and return them using output and inout type arguments. Tasks can contain simulation time consuming elements such as @, posedge
and others.
41. Why always blocks are not allowed in the program block?
Ans: Because an always block never terminates, it was kept out of the program block so the concept of test termination would still be there.
44. Explain the difference between fork-join, fork-join_none, and fork- join_any?
Ans:
57. What is the input skew and output skew in the clocking block?
Ans: If an input skew is mentioned for a clocking block, then all input signals within that block will be sampled at skew time units before the clock
event. If an output skew is mentioned for a clocking block, then all output signals in that block will be driven skew time units after the corresponding
clock event.