Interview q1
Interview q1
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?
class solvebefore;
rand bit ;
solve a before b; }
endclass
$random
$urandom
$urandom_range
$dist_exponential
$dist_normal
$dist_poisson
$dist_uniform
class randvari;
endclass
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.
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 different type without having to recode.
Ans:- The utils macros define the infrastructure needed to enable the
object/component for correct factory operation.
The reason there are two macros is that the factory design pattern fixes the
number of arguments that a constructor can have. Classes derived from uvm_object
have constructors with one argument, a string name. Classes derived from
uvm_component have two arguments, a name, and a uvm_component parent.
The two `uvm_*utils macros insert code that gives you a factory create a ()
method that delegates call to the constructors of uvm_object or uvm_component. You
need to use the respective macro so that the correct constructor arguments get
passed through. This means that you cannot add extra constructor arguments when you
extend these classes in order to be able to use the UVM factory.
while `uvm_rand_send perform all the above steps except create. User needs to
create sequence / sequence_item.
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 the new phase.
Example:-
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 different type without having to recode.
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.
Ans:- In simpler words, TLM FIFO is a FIFO between two UVM components, preferably
between Monitor and Scoreboard. Monitor keep on sending the DATA, which will be
stored in TLM FIFO, and Scoreboard can get data from TLM FIFO whenever needed.
Ans:- Front door 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.
The drawback of p_sequencer is that once the p_sequencer is defined, one cannot run
the sequence on any other sequencer type.
14) What is the difference between Active mode and Passive mode with respect to the
agent?
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.
15. What are the types of sequencer? Explain each?
Ans:-
> What is the difference between a bit and logic data type?
> What is the difference between logic[7:0] and byte variable in SystemVerilog?