SV Interview Questions
SV Interview Questions
VERILOG
interview
HANDBOOK
Basic Level Questions
1. Difference between byte a and bit [7:0] a.
Both bit and byte are 2-state data types and can store 8-bit or 1-byte data. The difference
between them is that ‘bit’ is unsigned whereas ‘byte’ is a signed integer.
3. Why logic is introduced in SV? Or Why reg and wires are not
sufficient?
In Verilog behavior modeling, always, and initial procedural blocks use reg data type
whereas, in dataflow modeling, continuous assignment uses wire data type.
SystemVerilog allows driving signals in the ‘assign’ statements and procedural blocks
using logic data type. The logic is a 4-state data type that allows capturing the Z or X
behavior of the design.
Example: Example:
Output: Output:
array[2] = 2 array[2][3] = 1
array[1] = 4 array[2][2] = 2
array[0] = 6 array[2][1] = 3
array[2][0] = 4
array[1][3] = 5
array[1][2] = 6
array[1][1] = 7
array[1][0] = 8
array[0][3] = 9
array[0][2] = 10
array[0][1] = 11
array[0][0] = 12
8. Difference between dynamic and associative arrays
Dynamic Array Associative array
Memory needs to be allocated before For bounded queues, the size needs to be
using it i.e. array size is required to be allocated. For unbounded queue can store
allocated first. unlimited entries.
new[ ] is used to create array memory. Queue [<size>] for bounded queue size.
Queue [$] for unbounded queue
Similar to the fixed array, any array Usually, head or tail elements are accessed.
element can be accessed. But queues also offer functionality to
access any element of the queue.
The size can be increased using a new [ For unbounded queues, the size of the
] method to find out larger contiguous queue expands using push_back or
memory space and existing array push_front methods. The new data
elements get copied in new space. elements get added similar to linked list
node addition.
10. Difference between structure and union
Unions are similar to structures that can contain different data types members except
they share the same memory location. Hence, it is a memory-efficient data structure. But
it also restricts the user to use one member at a time.
A pass-by-reference argument passing mechanism does not copy arguments locally but
reference to the original arguments is passed. This also means that any change in values
for the argument inside the subroutine will affect the original values of the variables,
function int fn_multiply(ref int a, b);
EXAMPLE
13. Why do we need randomization in SystemVerilog?
Need for Randomization
As per the increasing complexity of the design, there are high chances to have more bugs
in the design when it is written for the first time. To verify DUT thoroughly, a verification
engineer needs to provide many stimuli. There can be multiple cross combinations of
variables in a real system. So, it is not possible practically to write directed cases to verify
every possible combination. So, it is very much required to have randomization in the
verification testbench.
Advantages of Randomization
1) It has the capability of finding hidden bugs with some random combination.
2) Constraint-based randomization provides possible random values instead of a
complete random range.
3) It provides flexibility to have random values based on user-defined probability.
4) SystemVerilog randomization provides flexibility to disable randomization for a
particular variable in a class as well as disable particular constraints based on the
requirement.
5) It saves time and effort in verification instead of writing a test for every possible
scenario.
1) As per System Verilog scheduling semantic, System Verilog events are scheduled in
the following order.
Active region → Non-blocking region → Reactive region.
2) The non-blocking assignments (RHS) are evaluated in the active region and updates
their LHS in the NBA region (Non-blocking region).
When the design module assigns some value to a variable in the initial block and the
testbench module tries to access the same variable (in the initial block) and perform
some action, race around condition is expected to occur.
Example:
Design Code:
module tb_mod_top;
wire [3:0] out;
dut_example DUT(out);
tb_pro tb(out);
endmodule
Output:
Design assigned out is 2
16. Difference between === and == operators?
The output of “==” can be 1, 0, or X. The output would be ‘x’, if you compare two variables
if one or both the variables have one or more bits as X.
The output of “===” can only be 0 or 1. It is used to compare ‘x’ or ‘z’, whereas ambiguous
values can not be compared using the ‘==’ operator.
17. What are SystemVerilog interfaces and why are they introduced?
System Verilog provides an interface construct that simply contains a bundle of sets of
signals to communicate with design and testbench components.
In Verilog for the addition of new signals, it has to be manually changed everywhere that
module has been instantiated. System Verilog made it easier to add new signals in the
interface block for existing connections.
Advantages:
SystemVerilog Modport
Within an interface to declare port directions for signals modport is used. The modport
also put some restrictions on interface access.
Syntax:
modport <name> ( input <port_list>, output <port_list>);
Advantage of modport
1) Modport put access restriction by specifying port directions that avoid driving of
the same signal by design and testbench.
2) Directions can also be specified inside the module.
3) Modport provide input, inout, output, and ref as port directions
4) Multiple modports can be declared for different directions for monitor and driver.
Examples:
modport TB (output a,b, en, input out, ack);
modport RTL (input clk, reset, a,b, en, output out, ack);
Syntax:
clocking <clocking_name> (<clocking event>);
<signals>
endclocking
Advantages of clocking block
1) It provides a group of signals that are synchronous with a particular clock in DUT
and testbench
2) Provides a facility to specify timing requirements between clock and signals.
Example:
interface my_int (input bit clk);
logic [7:0] data;
logic enable;
//Clocking Block
endinterface
Syntax:
<cross_coverage_label> : cross <coverpoint_1>, <coverpoint_2>,...,
<coverpoint_n>
Example:
bit [7:0] addr, data;
bit [3:0] valid;
bit en;
Code coverage deals with covering design code metrics. It tells how many lines of code
have been exercised w.r.t. block, expression, FSM, signal toggling.
1) Block coverage – To check how many lines of code have been covered.
2) Expression coverage – To check whether all combinations of inputs have been driven
to cover expression completely.
3) FSM coverage – To check whether all state transitions are covered.
4) Toggle coverage – To check whether all bits in variables have changed their states.
Note:
1) Code coverage does not specify that the code behavior is correct or not. It is
simply used to identify uncovered lines, expressions, state transitions, dead code,
etc. in the design. Hence, it does not indicate design quality.
2) Verification engineers aim to achieve 100% code coverage.
3) There are industry tools available that show covered and missing code in code
coverage.
Functional Coverage
Code coverage deals with covering design code metrics. It tells how many lines of code
have been exercised w.r.t. block, expression, FSM, signal toggling.
1) Block coverage – To check how many lines of code have been covered.
2) Expression coverage – To check whether all combinations of inputs have been
driven to cover expression completely.
3) FSM coverage – To check whether all state transitions are covered.
4) Toggle coverage – To check whether all bits in variables have changed their states.
23. Write rand constraint on a 3 bit variable with distribution 60% for
0 to 5 and 40% for 6,7. Write coverpoint for the same.
class rand_class;
rand bit [2:0] value;
covergroup c_group;
cp1: coverpoint value {bins b1= {[0:5]};
bins b2 = {[6:7]};
}
endgroup
endclass
1) Fixed-size array in SystemVerilog: Array size is fixed throughout the simulation. Its
value will be initialized with a ‘0’ value.
The fixed size array can be further classified as a single-dimensional,
multidimensional array, packed, and unpacked array
2) Dynamic array in SystemVerilog: An array whose size can be changed during run
time simulation, is called dynamic array.
3) Associative array in SystemVerilog: An associate array is used where the size of a
collection is not known or data space is sparse.
Intermediate level questions
1. How to find indexes associated with associative array items?
An array manipulation method find_index can be used for the indices of an associative
array. Example:
function void find_index_method();
int idx_q[$], idx;
int qsize;
In fork-join_any, all processes start simultaneously and join_any will wait for any one
process to be completed.
In fork-join_none, all processes start simultaneously and join_none will not wait for any
process to be completed.
So, we can say that fork-join and fork-join_any is blocked due to process execution time,
whereas fork-join_none is not blocked due to any process.
A structure can contain different Classes allow objects to create and delete
members of different data types. dynamically.
Data members of structure are visible Data members of class can be protected and
to everyone will not be visible outside of class.
Example:
int array [];
array = new[8] (array); // Resizing of an array and copy old array content
new() – To create an object for the class, commonly known as ‘class constructor’.
class transaction;
endclass
Deep Copy:
The deep copy is the same as shallow copy except nested created objects are also copied
by writing a custom method. Unlike shallow copy, full or deep copy performs a complete copy
of an object.
9. What is inheritance?
An Inheritance allows users to create an extended class from the existing class. The
existing class is commonly known as base class or parent class and the newly created
extended class is known as a derived class or child class or subclass. This promotes code
reuse and can lead to more efficient verification by having common functionality in the
base class.
Refer to an example:
class parent_trans;
bit [31:0] data;
module class_example;
initial begin
child_trans c_tr;
c_tr = new();
c_tr.data = 5; // child class is updating property of its base class
c_tr.id = 1;
The ‘super’ keyword is used in a child or derived class to refer to class members of its
immediate base class.
Refer to an example:
class parent_trans;
bit [31:0] data;
module class_example;
initial begin
child_trans c_tr;
c_tr = new();
c_tr.data = 5;
c_tr.display();
end
endmodule
‘this’ keyword:
To refer to class properties or methods of the current class instance, this keyword is
used. In simple terms, this keyword is a handle of the current class object. It shall be used
only in non-static class methods. The ‘this’ keyword resolves the ambiguity of a compiler
when class properties and arguments passed to class methods are the same.
Refer to an example:
class transaction;
bit [31:0] data;
int id;
module class_example;
initial begin
transaction tr = new(5, 1);
$display("Value of data = %0h, id = %0h", tr.data, tr.id);
end
endmodule
Advantages
1) It makes code more reusable. The common functionality can be kept in the base
class and derived class-based functionality will be alone in its inherited or child
class. Thus it helps to write the code more modular.
2) Improves code readability and easy for code maintenance as common logic can
be placed in the base class itself.
3) Provides an encapsulation that allows objects to expose only required
functionality.
4) A new class can be added easily instead of modifying existing class functionality.
Thus it enablesflexibility.
12. What is a virtual function?
A virtual function or task from the base class can be overridden by a method of its child
class having the same signature (same method name and arguments).
In simple words, When a child class handle is assigned to its base class. On calling a
method using a base class handle, the base class method will be executed. On declaring
a method as a virtual method, a base class handle can call the method of its child class.
Usage:
module class_example;
initial begin
parent_trans p_tr;
child_trans c_tr;
c_tr = new();
p_tr = c_tr;
c_tr.data = 10;
c_tr.id = 2;
p_tr.data = 5;
p_tr.id = 1;
p_tr.display();
end
endmodule
13. What is the use of a scope resolution operator?
The scope resolution operator is used to
module class_example;
initial begin
transaction::id = 5;
transaction::disp(transaction::id);
//transaction::data = 2; // illegal
//transaction::auto_disp(transaction::id); // illegal
end
endmodule
task transaction::delay();
#50;
$display("Time = %0.0t, delayed data = %0d", $time, data);
endtask
module class_example;
transaction tr;
initial begin
tr = new();
tr.data = 100;
tr.id = 1;
tr.display();
tr.delay();
end
endmodule
function pkg_funct();
$display("Inside pkg_funct");
endfunction
endpackage
//-------------------------------
import pkg::*;
module package_example;
initial begin
transaction tr = new();
tr.display();
pkg_funct();
end
endmodule
A virtual function from the base class A pure virtual function is a method that
can be overridden by a method of its makes it mandatory for methods to be
child class having the same signature implemented in derived classes whose
(same function name and arguments). prototypes have been specified in an
abstract class.
If there is no implementation in the If a derived class doesn’t overwrite the pure
derived class, the base class’s virtual function, it will remain abstract and
implementation is executed. cannot be
instantiated.
Declared by using the keyword ‘virtual’ Declared by using the keyword ‘pure virtual’
in the base class. in the base class.
Example: Example:
class parent_trans; virtual class parent_trans;
bit [31:0] data; bit [31:0] data;
int id; int id;
p_tr.data = 5;
p_tr.id = 1;
p_tr.display();
end
endmodule
15. What is a virtual interface and its need?
An interface represents signals that are used to connect design modules or testbench to
the DUT and is commonly known as a physical interface. The design and physical
interface are static in nature. Hence, they can not be used dynamically. In modern
testbench, randomized class objects are used and connect to the design dynamically.
Hence, to bridge the gap between the static world of modules and the dynamic world of
objects, a virtual interface is used as a pointer or handle for an actual interface.
...
endclass
Refer to an example:
module class_example;
transaction tr1;
transaction #(3,int) tr2;
initial begin
tr1 = new();
tr2 = new();
tr1.data = 7;
tr1.id = 15;
tr1.display();
tr2.data = 7;
tr2.id = 15;
tr2.display();
end
endmodule
On randomizing, any values within 5’h0 to 5’h1F will be generated with equal probability
randc Keyword
On randomizing an object, the randc keyword provides random value without repeating
the same value unless a complete range is covered. Once all values are covered, the
value will repeat. This ensures that to have all possible values without repeating the
same value unless every value is covered.
1. pre_randomize()
2. post_randomize()
A sequence of execution of methods:
pre_randomize() -> randomize() -> post_randomize()
pre_randomize method
It is used to do an activity just before randomization. This may involve disabling
constraint for a particular variable (constraint_mode(0))or disabling randomization itself
(rand_mode(0)). Refer disable randomization for more details.
post_randomize method
It is used to do an activity after randomization. This may involve printing randomized
values of a class variable. Override the randomized value of a class variable.
Example:
class seq_item;
rand bit [7:0] val1;
rand bit [7:0] val2;
endclass
module constraint_example;
seq_item item;
initial begin
item = new();
item.randomize();
end
endmodule
Refer to an example,
class seq_item;
rand bit [7:0] val1, val2, val3, val4;
rand bit t1, t2;
module constraint_example;
seq_item item;
initial begin
item = new();
repeat(5) begin
item.randomize();
$display("val1 = %0d, val2 = %0d, val3 = %0d, val4 = %0d", item.val1,
item.val2, item.val3, item.val4);
$display("t1 = %0h, t2 = %0h", item.t1, item.t2);
end
end
endmodule
21. Is it possible to override existing constraints?
Yes, there are two ways to do so
1) Inline constraint:
class seq_item;
rand bit [7:0] val1, val2;
module constraint_example;
seq_item item;
initial begin
item = new();
repeat(5) begin
item.randomize();
$display("Before inline constraint: val1 = %0d, val2 = %0d",
item.val1, item.val2);
2) Inheritance:
class parent;
rand bit [5:0] value;
constraint value_c {value > 0; value < 10;}
endclass
module constraint_inh;
parent p;
child c;
initial begin
p = new();
c = new();
repeat(3) begin
p.randomize();
$display("Parent class: value = %0d", p.value);
end
repeat(3) begin
c.randomize();
$display("Child class: value = %0d", c.value);
end
end
endmodule
22. Difference between :/ and := operators in randomization
Both are used to assign weightage to different values in the distribution constraints.
:/ Operator
Refer to an example:
class seq_item;
rand bit [7:0] value1;
rand bit [7:0] value2;
endclass
module constraint_example;
seq_item item;
initial begin
item = new();
repeat(5) begin
item.randomize();
$display("value1 (with :/) = %0d, value2 (with :=)= %0d", item.value1,
item.value2);
end
end
endmodule
Output:
Example:
int value;
std::randomize(value) with {
};
Refer to an example:
class seq_item;
rand bit [5:0] value;
rand bit sel;
constraint value_c {value == get_values(sel);}
module constraint_example;
seq_item item;
initial begin
item = new();
repeat(3) begin
item.randomize();
$display("constraint value = %0h", item.value);
end
$display("On functiopn call: value = %0h", item.get_values(1));
end
endmodule
25. Write a constraint - divisible by 5.
class constraint_example;
rand bit[3:0] val;
constraint value_c { val % 5 == 0; }
endclass
module constraint_example;
seq_item item;
initial begin
item = new();
item.randomize();
$display("Before disabling constraint");
$display("item: value1 = %0d, value2 = %0d", item.value1, item.value2);
Example:
class seq_item;
rand bit [7:0] value1;
rand bit [7:0] value2;
endclass
module constraint_example;
seq_item item;
initial begin
item = new();
item.randomize();
$display("Before disabling randomization: value1 = %0d, value2 = %0d",
item.value1, item.value2);
static casting is only Dynamic casting is used to cast the assigned values to
applicable to fixed data the variables that might not be ordinarily valid.
types.
It is a simple and efficient It is more complex and less efficient than static casting
process
Compile failure will be seen It can detect and handle errors during runtime.
for casting failure.
Example: The same memory location is accessed by two different cores. To avoid
unexpected results when cores try to write or read from the same memory location, a
semaphore can be used.
Example:
module semaphore_example();
semaphore sem = new(1);
task write_mem();
sem.get();
$display("Before writing into memory");
#5ns // Assume 5ns is required to write into mem
$display("Write completed into memory");
sem.put();
endtask
task read_mem();
sem.get();
$display("Before reading from memory");
#4ns // Assume 4ns is required to read from mem
$display("Read completed from memory");
sem.put();
endtask
initial begin
fork
write_mem();
read_mem();
join
end
endmodule
Clocking Skew:
The input or output clocking block signals can be sampled before or after some time unit
delay known as clocking skew. It is declared as:
This means input signals is sampled #2 time unit before the clocking event and output
signals are driven after #3 time units after the clocking event.
32. What are the types of assertions?
Assertions are used to check design rules or specifications and generate warnings or
errors in case of assertion failures.
Types of assertions:
$monitor To monitor signal values upon its changes and executes in the postpone
region.
$strobe To display strings, variables, and expressions at the end of the current time
slot i.e. in the postpone region.
initial begin
d1 = 4; d2 = 5;
#5 d1 = 2; d2 = 3;
end
initial begin
$display("At time %0t: {$display A} -> d1 = %0d, d2 = %0d", $time, d1,
d2);
$monitor("At time %0t: {$monitor A} -> d1 = %0d, d2 = %0d", $time, d1,
d2);
$write("At time %0t: {$write A} -> d1 = %0d, d2 = %0d", $time, d1, d2);
$strobe("At time %0t: {$strobe A} -> d1 = %0d, d2 = %0d", $time, d1, d2);
#5;
covergroup c_group;
cp1: coverpoint addr {ignore_bins b1 = {1, 10, 12};
ignore_bins b2 = {2=>3=>9};
}
endgroup
c_group cg = new();
...
...
endmodule
Example:
covergroup c_group;
cp1: coverpoint addr {ignore_bins b1 = {1, 10, 12};
ignore_bins b2 = {2=>3=>9};
}
cp2: coverpoint data {illegal_bins b3 = {1, 10, 12};
illegal_bins b4 = {2=>3=>9};
}
endgroup
36. How do you define callback?
SystemVerilog callback
The callbacks are used to alter the behavior of the component without modifying its
code. The verification engineer provides a set of hook methods that helps to customize
the behavior depending on the requirement. A simple example of callbacks can be the
pre_randomize and post_randomize methods before and after the built-in randomize
method call.
Callback usage
1) Allows plug-and-play mechanism to establish a reusable verification environment.
2) Based on the hook method call, the user-defined code is executed instead of the
empty callback method.
Simply, callbacks are the empty methods that can be implemented in the derived class
to tweak the component behavior. These empty methods are called callback methods
and calls to these methods are known as callback hooks.
Callback Example
In the below example, modify_pkt is a callback method and it is being called in the
pkt_sender task known as callback hook.
The driver class drives a GOOD packet. The err_driver is a derived class of the driver class
and it sends a corrupted packet of type BAD_ERR1 or BAD_ERR2 depending on the
inject_err bit.
If the inject_err bit is set, then a corrupted packet will be generated otherwise a GOOD
packet will be generated.
Driver code:
class driver;
pkt_type pkt;
task pkt_sender;
std::randomize(pkt) with {pkt == GOOD;};
modify_pkt;
endtask
Environment code:
`include "driver.sv"
class env;
bit inject_err;
driver drv;
err_driver drv_err;
function new();
drv = new();
drv_err = new();
endfunction
task execute;
if(inject_err) drv = drv_err;
// Sending a packet
drv.pkt_sender();
$display("Sending packet = %s", drv.pkt.name());
endtask
endclass
Output:
DPI also allows calling functions and tasks from other languages or vice-versa using
import/ export methods. These methods can communicate with the help of arguments
and return value.
Import method
SystemVerilog can call functions or tasks (methods) implemented in a foreign language,
such methods are called import methods
import “DPI-C” function <return_type> <function_name> (<arguments if any>)
C file:
#include <stdio.h>
SV file:
module tb;
initial
begin
$display("Before add function call");
addition(4,5);
$display("After add function call");
end
endmodule
Output:
C file:
#include <stdio.h>
//#include <svdpi.h>
void c_caller() {
printf("Calling addition function from c_caller\n");
addition(4, 5);
SV file:
module tb;
initial
begin
c_caller();
end
endmodule
Output:
Syntax:
sequence_exp |-> property_exp
Type of Implication
1. Overlapped implication
2. Non-overlapped implication
Overlapped implication
The overlapped implication operator is denoted by the |-> symbol.
The evaluation of the consequent starts immediately on the same clock cycle if the
antecedent holds true.
Example:
property prop;
@(posedge clk) valid |-> (a ##3 b);
endproperty
Non-overlapped implication
The non-overlapped implication operator is denoted by the |=> symbol.
The evaluation of the consequent starts in the next clock cycle if the antecedent holds
true.
The consequent is not evaluated if the antecedent is not true.
Example:
property prop;
@(posedge clk) valid |=> (a ##3 b);
endproperty
39. What all bins are generated by the following code
coverpoint addr {bins b1 = {1, 10, 12};
2 state variables – 0
4 state variables – X
Protected access qualifiers: A protected class member can not be accessed outside
class scope except access by their child classes.
initial begin
repeat(3) begin
repeat(8)
$display("data = %0d", my_randc());
$display("------------");
end
end
endmodule
Example:
int value;
std::randomize(value) with {
value inside {5, 10, 15, 20};
};
$rose(<signal>) is evaluated to be true for value changes happening across two clocking
events from 0 or x or z to 1.
Transaction
The transaction is a packet that is driven to the DUT or monitored by the monitor as a
pin-level activity.
In simple terms, the transaction is a class that holds a structure that is used to
communicate with DUT.
Generator
The generator creates or generates randomized transactions or stimuli and passes them
to the driver.
Driver
The driver interacts with DUT. It receives randomized transactions from the generator
and drives them to the driven as a pin level activity.
Monitor
The monitor observes pin-level activity on the connected interface at the input and
output of the design. This pin-level activity is converted into a transaction packet and
sent to the scoreboard for checking purposes.
Agent
An agent is a container that holds the generator, driver, and monitor. This is helpful to
have a structured hierarchy based on the protocol or interface requirement.
Scoreboard
The scoreboard receives the transaction packet from the monitor and compares it with
the reference model. The reference module is written based on design specification
understanding and design behavior.
Environment
An environment allows a well-mannered hierarchy and container for agents,
scoreboards.
Testbench top
The testbench top is a top-level component that includes interface and DUT instances. It
connects design with the testbench.
Test
The test is at the top of the hierarchy that initiates the environment component
construction and connection between them. It is also responsible for the testbench
configuration and stimulus generation process.
Verification Architecture
In the verification architectural phase, engineers decide what all verification components
are required.
Verification Plan/ Testplan
The verification plan includes a test plan(list of test cases that target design features),
functional coverage planning, module/block assignments to the verification engineers,
checker, and assertion planning. The verification plan also involves planning for how
verification components can be reused at system/ SOC level verification.
Testbench Development
As a part of testbench development, verification engineers develop testbench
components, interface connections with the DUT, VIP integration with a testbench, inter-
component connections within testbench (like monitor to scoreboard connection), etc.
Testcase Coding
A constraint-based random or dedicated test case is written for single or multiple
features in the design. A test case also kicks off UVM-based sequences to generate
required scenarios.
Simulation/ Debug
In this phase, engineers validate whether a specific feature is targetted or not, If not,
again test case is modified to target the feature. With the help of a checker/ scoreboard,
the error is reported if the desired design does not behave as expected. Using waveform
analysis or log prints, the design or verification environment is judged and a bug is
reported to the design team if it comes out to be a design issue otherwise, simulation is
re-run after fixing the verification component.
Analyze Metrics
Assertions, code, and functional coverage are common metrics that are used as analysis
metrics before we close the verification of the design.
This allows testing interrupt is generated due to the stimulus and testbench is calling an
appropriate ISR to service the interrupt.
9. What is layered architecture in Verification?
Layered architecture involves structuring the verification environment into various
layers or levels that help to provide abstraction, scalability, reusability, etc.
Testbench Top and Test Layer: The testbench top is a top-level component that
includes interface and DUT instances. It connects the design with the test bench. The
reset, clock generation, and its connection with DUT is also done in testbench top.
The test is at the top of the hierarchy that initiates the environment component
construction and connection between them. It is also responsible for the testbench
configuration and stimulus generation process.
Coverage Layer: Coverage collection mechanisms track different aspects of the DUT
that have been exercised during simulation. This includes functional coverage, code
coverage, and assertion coverage, providing insights into the verification completeness
and identifying any areas that require additional testing.
The scoreboard receives the transaction packet from the monitor and compares it with
the reference model. The reference module is written based on design specification
understanding and design behavior.
Both are used to verify the correctness of the design in the verification environment
component. They are connected using a mailbox in a SystemVerilog-based verification
environment.
Useful for complex design Useful for smaller and simpler design verification.
verifications
12. How will be your approach if code coverage is 100% but functional
coverage is too low?
This can be possible when
1. Functional coverage bins (may be auto bins) generated for wide variable
range which is not supported by design.
2. Cross check if code coverage exclusions are valid so that it should not give
false interpretation of 100% code coverage.
3. Functional coverage implemented for feature (were planned during initial
project phasing), but those are not supported by the design now.
13. How will be your approach if functional coverage is 100% but code
coverage is too low?
This can be possible when