UVM Specific Interview Qs
UVM Specific Interview Qs
TLM PORTS
ANALYSIS PORTS
REPORTING MECHANISM
FACTORY REGISTRATION
CONFIGURATION DATABASE
RAL MODEL
VIRTUAL SEQUENCES
UVM PHASES
Prasanthi Chanda
1. Write a UVM testbench that implements a producer and a
consumer using TLM blocking ports. Ensure that the producer
generates 10 integer values, and the consumer retrieves and
logs them.
task body();
`uvm_info("BASE_SEQ", "Running base sequence", UVM_MEDIUM)
endtask
endclass
task body();
`uvm_info("EXT_SEQ", "Running extended sequence", UVM_MEDIUM)
endtask
endclass
class tb_test extends uvm_test;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
base_sequence seq;
seq = base_sequence::type_id::create("seq");
seq.start(null);
endtask
endclass
task body();
`uvm_info("VSEQ", "Starting virtual sequence", UVM_MEDIUM)
fork
start_child_sequence(seqr1);
start_child_sequence(seqr2);
join
`uvm_info("VSEQ", "Completed virtual sequence", UVM_MEDIUM)
endtask
task body();
T transaction;
transaction = T::type_id::create("transaction");
start_item(transaction);
finish_item(transaction);
endtask
endclass
task body();
uvm_sequence_item trans;
trans = uvm_sequence_item::type_id::create("trans");
trans.randomize();
start_item(trans);
finish_item(trans);
`uvm_info("RANDOM_SEQ", $sformatf("Generated random transaction:
%0s", trans), UVM_MEDIUM)
endtask
endclass
task body();
T transaction;
transaction = T::type_id::create("transaction");
start_item(transaction);
finish_item(transaction);
`uvm_info("PARAM_SEQ", $sformatf("Processing transaction: %0s",
transaction), UVM_MEDIUM)
endtask
endclass
class tb_test extends uvm_test;
param_sequence #(uvm_sequence_item) seq;
// Chain to sequence B
sequence_B seq_b = sequence_B::type_id::create("seq_b");
seq_b.start(null);
endtask
endclass
task body();
uvm_sequence_item trans;
trans = uvm_sequence_item::type_id::create("trans_B");
start_item(trans);
finish_item(trans);
`uvm_info("SEQ_B", "Sequence B completed", UVM_MEDIUM)
endtask
endclass
19. Explain the concept of TLM Ports in UVM and discuss their
impact on modularity and scalability in complex testbenches.
TLM (Transaction-Level Modeling) ports in UVM are used to communicate
between components at a higher abstraction level. These ports allow
data to be sent and received between different components without
worrying about the underlying physical communication mechanism.
There are several types of TLM ports, including blocking and non-
blocking ports, and they play a crucial role in making testbenches
modular and scalable.
TLM ports contribute to scalability by decoupling the components,
allowing testbenches to be easily extended. This decoupling of modules
makes it simpler to add new functionality or components, thereby
increasing the modularity of the testbench. For example, a sequencer
may use a TLM port to send sequences of transactions to a driver, and
the driver can receive these transactions independently without being
aware of the sequence details.
20. How do Analysis Ports and Analysis FIFOs work together in
UVM, and how can they improve the debugging process in
complex testbenches?
Analysis Ports and Analysis FIFOs in UVM are used to transmit data
between components in a way that supports multiple subscribers
(listeners). An analysis port allows data to be written, while an analysis
FIFO (First In, First Out) acts as a buffer between the producer and
consumers. The use of an Analysis FIFO ensures that data can be buffered
before being processed by the consumer, which is critical when the
consumer is not always ready to receive data at the same time the
producer is generating it.
These mechanisms help improve debugging by enabling the collection of
information from various parts of the testbench without causing
synchronization issues. Multiple listeners can subscribe to the same
Analysis Port, enabling the monitoring of different components in parallel.
This allows users to track and analyze the flow of data throughout the
testbench, making it easier to identify issues and isolate problems.