Systemverilog UVM QA
Systemverilog UVM QA
Systemverilog UVM QA
- A new() is used for constructing object whereas new[] is used to declare a dynamic array.
- A constructor function does not have a return type. When you use a constructor, the left
hand side of the assignment determines the return type.
Myths and misconception surrounding constructors are abound. We will try to disspell some of
them here.
It is not illegal not to have a constructor for each class, though having one will be a good
practice for your peace of mind.
Although it is customary to name a constructor as 'new', any other name is fine too.
Triangle t = my_new();
On the contrary, it is always a good idea to make your constructor flexible by passing
arguments to it. For example, we can customize our own new() defined
within Triangle as:
Corresponding to this, the definition of new() within the class Triangle will look like (with
arbitrarily chosen types for first_arg, second_arg, etc.):
Refer https://pcisig.com/faq?field_category_value%5B%5D=pci_express_3.0&keys=
For PCIe question answers
- This clock synchronizes the parallel interface between the PHY and the MAC . PLL generates
clock is called PCLK which is output from physical coding sub layer to Media access control
layer. PCLK 125MHz for 16-bit and 250MHz for 8-bit data width. For more detail please refer
PIPE architecture.
- The PCIe3.0 is providing 985 Mb/s of speed for each lane.
- Giga transfers per second GT/s are the same thing (in this case) as gigabits per second Gb/s
is called bandwidth, speed as well as bit rate.
The PLL generates the PCLK used in synchronizing the parallel PHY/MAC Interface based on the CLK
input. The PCLK frequency is 125 MHz for 16-bit implementations and 250 MHz for 8-bit
implementations. The PLL will produce a 250 MHz clock used as an input to the 8B/10B encoder and
decoder and the elastic buffer. The PLL will produce a 2.5 GHz clock that is used as an input to the
SERDES and the clock recovery circuitry.
How does the PCIe 3.0 8GT/s "double" the PCIe 2.0 5GT/s bit rate?
- The PCIe 2.0 bit rate is specified at 5GT/s, but with the 20 percent performance overhead of
the 8b/10b encoding scheme, the delivered bandwidth is actually 4Gbps. PCIe 3.0 removes
the requirement for 8b/10b encoding and uses a more efficient 128b/130b encoding
scheme instead. By removing this overhead, the interconnect bandwidth can be doubled to
8Gbps with the implementation of the PCIe 3.0 specification. This bandwidth is the same as
an interconnect running at 10GT/s with the 8b/10b encoding overhead. In this way, the
PCIe 3.0 specifications deliver the same effective bandwidth, but without the prohibitive
penalties associated with 10GT/s signaling, such as PHY design complexity and increased
silicon die size and power. The following table summarizes the bit rate and approximate
bandwidths for the various generations of the PCIe architecture: PCIe architecture Raw bit
rate Interconnect bandwidth Bandwidth per lane per direction Total bandwidth for x16 link
Refer http://www.hardwaresecrets.com/everything-you-need-to-know-about-the-pci-
express/3/
2.5 GHz
Base Clock Speed: PCIe 3.0 = 8.0GHz, PCIe 2.0 = 5.0GHz, PCIe 1.1 = 2.5GHz
Data Rate: PCIe 3.0 = 1000MB/s, PCIe 2.0 = 500MB/s, PCIe 1.1 = 250MB/s
Total Bandwidth: (x16 link): PCIe 3.0 = 32GB/s, PCIe 2.0 = 16GB/s, PCIe 1.1 = 8GB/s
Data Transfer Rate: PCIe 3.0 = 8.0GT/s, PCIe 2.0= 5.0GT/s, PCIe 1.1 = 2.5GT/s
What is the data width in PCIe?
Data width is 8 bit or 16 bit between MAC layer and PCS layer as per PIPE specification.
- To easily discriminate data and control at receiver as well as it ensures that encoded data
stream has certain amount of 0’s and 1’s transition to avoid long stream of continuous 1’s
and 0’s(DC).
- If data is received properly and buffer space is available at the Rx to accept that data
ACK(acknowledgement) is given to Tx else NAK(not acknowledgement) is given to Tx.
- With sequesce.start(sequencer);
- With `uvm_do
- No.
- In recovery state speed changes. Read PCIe QA document for this answer.
- When CS is low and R / W is low, the memory chip writes the data on the data bus into the
location indicated by the address bus. This allows the microprocessor to store data into
memory.
- When CS is low and R / W are high, the memory chip drives the data bus with the data
from the location indicated by the address bus. This allows the microprocessor to load data
out of memory into registers.
- Int dyna_arr[];
Dyna_arr = new[5];
Dyna_arr = dyna_arr({0,2},4); // 3rd element deleted(not sure need to find solution)
- Factory is used to register and create components and objects. If we don’t use factory we
cannot override them.
- The min and max functions find the smallest and largest elements in an array. Note that
these functions return a queue, not a scalar as you might expect.(Page-43 chris spear)
Logic to sum 3, 6, 9, …, 50. Find the even numbers from this.(LSB= 0/1 its even/odd)
- Associative array is used if we want to create an array with elements at random locations. In
it if assign any value to any location then only memory will get allocated, otherwise memory
won’t get allocated.
Write logic for array to change its values in reverse order keep first and last values same.
Write a transaction class in SV. How to give few conditions to data fields in this class?
- When the lane reversal is set incorrectly on an analyzer the user will only be able to record
ordered sets. Ordered sets such as Training or Skip sequences transmit the same symbol
simultaneously on all active lanes, and consequently they are not affected by lane ordering.
However DLLP and TLP packets are sensitive to lane ordering and must start with an SDP
or STP symbol in Logical lane#0. If these symbols are being transmitted on physical lane#3
with respect to the analyzer input and lane reversal has not been configured, an analyzer
will detect no valid packet start.
What is raise_objection and drop_objection?
- To stop simulation at the end of test when all phases have got executed.
- We can also use drain_time to stop simulation.
- Sequencer
Start_item(tx);
Assert(Tx.randomize);
Finish_item(tx);
- Driver
Seq_item_port.get_next_item(tx);
Seq_item_port.item_done();
- Virtual Sequence decides which Agent’s (multiple agents and multiple interfaces with DUT)
Sequence will start first and the order of Sub-Sequences execution.
- A virtual sequence does not itself interact with a sequencer, it can be started without a
sequencer.
- Virtual sequences are typically used to coordinate the behavior of multiple agents (though
strictly speaking a sequence that coordinates multiple agents need not be a virtual
sequence.
- In UVM, Virtual Sequence can be implemented using 2 approaches.
- In the 1st approach, Virtual Sequence will contain itself the handles of the Agent’s
Sequencers on which the Sub-Sequences are to be executed.
- In the 2nd approach, Virtual Sequence will run on a Virtual Sequencer which is of type
uvm_sequencer. In this approach, Virtual Sequencer will contain the target Agent
Sequencer’s handle.
http://www.learnuvmverification.com/index.php/2016/02/23/how-virtual-sequence-works-
part-1/
PVIP questions
- Using uvm_field_* macros define transaction required methods. So use UVM_NOPACK for
excluding atomic creation of packing and unpacking method.
- `uvm_field_int(length, UVM_ALL_ON|UVM_NOPACK)
The `uvm_field_* macros are invoked inside of the `uvm_*_utils_begin and `uvm_*_utils_end
(`uvm_object_utils_begin or `uvm_component_utils_begin) macro blocks to form “automatic”
implementations of the core data methods: copy, compare, pack, unpack, record, print, and
sprint.
`uvm_field_int(ARG,FLAG)
ARG is an integral property of the class, and FLAG is a bitwise OR of one or more flag settings as
described in Field Macros above.
- U can extend constraint class and rewrite new constraints Or you can assert constraint off
and specify inline constraints while randomizing transaction object.
What us $bits?
pack_field_int
- Packs the integral value (less than or equal to 64 bits) into the pack array. The size is the
number of bits to pack, usually obtained by $bits.
- packer.pack_field_int(da,$bits(da));
Mobiveil questions
SGL in NVMe
Is it possible to connect sequencer and driver with analysis ports and scoreboard and monitor
with seq_item_port/export ?
- No. The seq_item_port is used exclusively for the sequencer/driver. The methods contained
within the seq_item_port are usable only by sequences and not meant for any other use.
- The seq_item_port is a specific type of port which allows bi-directional communication
between the sequencer and driver. There are several additional methods provided by it
which enable sequences to function.
Types of responses in AXI
How many numbers of completion queues in NVMe and how many entries in one completion
queue?