SystemVerilog - FAQ - SystemVerilog Faq - PDF
SystemVerilog - FAQ - SystemVerilog Faq - PDF
HOME
ABOUT US
SYSTEMVERILOG
VLSI RESOURCES
FORUM
FAQ
CONTACT US
NOV
SEARCH
24
SATURDAY
SystemVerilog FAQ?s :
Click on the question to view answer
1/8
11/25/12
declared with randc keyword are randomly distributed. They are cyclic in nature. They support only bit or enumerated data types. The size
is limited.
12. What is the use of always_ff?
Ans: The always_ff can be used to model sequential logic behavior. The always_ff is always synthesizable.
13. What are static and automatic functions?
Ans: For overriding the values in the class, static function is used. Whereas in automatic, when one task is called, two separate memories will
be allocated.
14. What is the procedure to assign elements in an array in systemverilog?
Ans: Assigning arrays in systemverilog uses the replicate operators. Eg: int n[1:2][1:3]={{0,1,2),{3{4}}};
15. What are the types of arrays in systemverilog?
Ans: There are two terminologies associated with the arrays in systemverilog. Packed and unpacked arrays. When the dimensions of arrays are
declared before the object name is referred to as ?packed arrays?. The ?unpacked array? term is used to refer when the dimensions are
declared after the object name. The memory allocation of both packed and unpacked arrays also differs.
E.g.: int [7:0] c1; //packed array
reg r[7:0] //unpacked array
16. What are assertions?
Ans: An assertion specifies a behavior of the system. They a re primarily used to validate a behavior of design. Assertions can also be used to
provide functional coverage and generate input stimulus for validation.
17. What is the syntax for ## delay in assertion sequences?
Ans: Is called as cycle delay syntax: ## 2; fifo.wdata < =8?hAA; //wait for 2 default clocking cycles, then drive wdata.
18. What are virtual classes?
Ans: When we use the same function name in both the base and derived classes, the function in the base class is declared as virtual. The class is
preceded using the keyword virtual before its normal declaration.
19. Why are assertions used?
Ans: Assertions are mainly used to check the behavior of the design whether it is working correctly or not. They are useful in providing the
functional coverage information .i.e. how good the test is and whether the design meets all the requirements for testing. There are mainly
two types of assertions in systemverilog. They are: immediate assertions and concurrent assertions.
20. Explain the difference between data type?s logic and reg and wire.
Ans: Wire is basic data type which does not drive strength
a) wire is used for designing combinational logic. We can assign a single value to a wire by using the assign statement. Wire cannot store
any data.
b) reg data type can be used for storage purpose. reg is used for designing both sequential and combinational circuits. reg data types can
be driven from initial and always block .
c) logic data types are similar to reg data types .
21. What is callback?
Ans: A callback is a built in systemverilog task/function. Suppose if we are transmitting a data using mailbox and you are sending data from
design to transmitter. If you want to get back the data and you need the same data to put back in the scoreboard for comparison, this is
called callback. Any change in the transmitted data can be achieved using the callback routine. Generally callbacks are called bfore
transmission and after receiving the data.
22. What are the ways to avoid race condition between testbench and RTL using SystemVerilog?
Ans: Using program block and clocking block.
23. Explain event regions in systemverilog?
Ans: Active region: simulation of design codes in modules.
Observed region: checking the system verilog assertions.
Reactive region: executing the testbench code.
Postponed region: sampling the design signals for test bench inputs.
24. What are the types of coverages available in systemverilog?
Ans: Functional coverage and code coverage.
www.systemverilog.in/systemverilog.php
2/8
11/25/12
3/8
11/25/12
4/8
11/25/12
5/8
11/25/12
6/8
11/25/12
$display(?Error in randomization?);
$finish;
end
79. What is property in SVA?
Ans: 1. Number of sequences can be combined logically or sequentially to create more complex sequences. SVA provides a key word to
represent these complex sequential behaviors called "property."
2. The basic syntax of a property is as follows.
property name_of_property;
< test expression > or
< complex sequence expressions >
endproperty;
80. What advantages of Assertions?
Ans: In traditional verification approach we will inject random stimulus into the DUT and checks result at output. For complex designs coverage
and debugging is harder.
Assertions come here to improve the verification process.
Increases bug detection possibility at RTL level. Reduces time to develop.
Great help in debug for large nightmare design random tests.
81. What are immediate Assertions?
Ans: Immediate assertion is basically a statement that something must be true, similar to if statement.
If assert evaluates to X, Z or 0, then the assertion fails and the simulator writes an error message.
my_assert:assert(condition1 & condition2)
$display("Passed..");
else
$error("Failed..");
82. What are Assertion severity system level task? What happens if we won?t specify these tasks?
Ans : When we set property and if we wont specify failure case of the property, then by default language dictates simulator should give error as
$error severity level.
$fatal - Run time fatal (quit Simulation)
$error - Run time error. Default according to LRM 3.1a. Vendor specific line commands can change this behavior.
$warning ? Run time warning
$info ? Means this assertion carries no specific severity.
83. What is difference between Concurrent and Immediate assertions?
Ans; Immediate assertion describes a logic behavior at an instant of time, where as concurrent assertion detects behavior over time to be
specified.
84. In which event region concurrent assertions will be evaluated?
Ans: The variables used in a concurrent assertion are sampled in the Preponed region of a time slot and the assertions are evaluated during the
Observe region. Both these regions occur immediately before a clock edge.
85. What are the main components in Concurrent Assertions?
Ans: In concurrent assertion there are three main components.
Sequence
Property
Assert ? property
86. What is Consecutive Repetition Operator in SVA?
Ans : Consecutive Repetition Operator [* ]
It is to specify that a signal or sequence to match continuously for the number of specified clocks.
Syntax: signal or sequence [* n]
Where "n" is the number of times the expression should match repeatedly.
87. What is goto Replication operator in SVA?
Ans : This operator specifies that an expression will match the number of times specified not necessarily on continuous clock cycles.
Ex: x [->4:7]
x has been true 4, 5, 6 or 7 times, not necessarily on consecutive clocks.
88. What is difference between x [->4:7] and x [=4:7] in SVA?
Ans :
www.systemverilog.in/systemverilog.php
7/8
2. Non Overlapping ( )
FEEDBACK
Number of Visits:
www.systemverilog.in/systemverilog.php
Powered by