Question: Develop the uvm Seq item code which includes all the below Topics UVM Field Macros, Radix, UVM Flags, Inbuilt methods of Seq item dont use
Develop the uvm Seq item code which includes all the below Topics
UVM Field Macros,
Radix,
UVM Flags,
Inbuilt methods of Seq item
dont use chat gptsample code i am providing
class sqitem extends uvmobject;
rand bit : dataarray; Changed field name and size
rand bit : dynamicarray; Changed field name and size
string model; Changed field name
int dataqueue$; Changed field name
typedef enum red orange, yellow, green, blue, indigo, violet colorset; Enum definition
randc colorset colorlist; Array of random cyclic enum values
uvmobjectutilsbeginsqitem
Registering fields with all operations enabled and appropriate radix
uvmfieldsarrayintdataarray, UVMALLON UVMHEX
uvmfieldarrayintdynamicarray, UVMALLON UVMBIN
uvmfieldstringmodel UVMALLON UVMSTRING
uvmfieldsarrayenumcolorset, colorlist, UVMALLON
uvmfieldqueueintdataqueue, UVMALLON UVMDEC
uvmobjectutilsend
function newstring name sqitem";
super.newname;
endfunction
endclassinclude "uvmmacros.svh
import uvmpkg::;
include sqitem.sv Updated file name
module sqitemtb; Renamed module
sqitem h h; Changed handle names
initial begin
Creating memory for two handles using create
h sqitem::typeid::createh; Updated handle name
h sqitem::typeid::createh; Updated handle name
Creating memory for array and string
hdynamicarray new; Updated size and field name
hmodel "Tesla,Chevrolet,Ford,Hyundai"; Updated field value
hdynamicarray new; Updated size and field name
hmodel BMWAudi,Mercedes,Lexus"; Updated field value
Initialize dataqueue with specific values
hdataqueue ; Updated queue initialization and field name
Adding some values to the queue using pushfront and pushback
hdataqueue.pushfront;
hdataqueue.pushback;
Randomizing both handles
asserthrandomize;
asserthrandomize;
Print the content of both handles
hprint;
hprint;
Compare the two handles and log the result
if hcompareh
uvminfoh and h are matching", UVMHIGH
else
uvminfoh and h are not matching", UVMHIGH
Copy the content of h into h
hcopyh;
Compare the handles again after copying
if hcompareh
uvminfoh and h are matching after copy", UVMHIGH
else
uvminfoh and h are not matching after copy", UVMHIGH
Print the content of both handles after copying
hprint;
hprint;
end
endmodule
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
