Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

UVM Sequencer with a transfer function

Status
Not open for further replies.

Yankie

Newbie level 4
Joined
Dec 12, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,345
Hi,

Is it possible to have a UVM sequencer that takes an object from UVM sequence and sends only a subset of the object to the driver?

E.g

class RECT extends uvm_sequence_item;
int length, breadth, area, perimeter;
endclass

class CIR
int radius;
endclass

class driver extends uvm_driver #(CIR);
seq_item_port.get_next_item(req);
seq_item_port.item_done();
endclass

Is it possible to have a sequencer that would take object of class RECT, copy it's data in to CIR object and then send this CIR object to driver?
class seqr extends uvm_sequence #(RECT);
CIR obj_CIR;

virtual task body()
obj_CIR = new();
`uvm_create_on(req, m_sequencer);
obj_CIR = req.length;
start_item(obj_CIR);
finish_item(obj_CIR);
endtask

endclass

Thanks !!
 

Yankie,

This is typical of any layered protocol. You can do what you want with the following corrections

Code:
obj_CIR = CIR::type_id::create("circle");
req = RECT::type_id::create("rectangle");
if (req.randomize())  else `uvm_fatal(<some message>);
obj_CIR.radius = req.length;
start_item(obj_CIR);
finish_item(obj_CIR);

You should always construct your classes with the create method instead of new() so the test can make overrides later.
`uvm_create_on(req, m_sequencer); is the same as `uvm_create(req);, but I don't recommend ever using the sequence macros. There are too many different flavors, and it is hard to read the code unless you memorize all of them.
You probably did not remember that `uvm_create does not randomize the item.

If your sequences are much more complicated that what you have shown, you may want to look at https://verificationacademy.com/cookbook/Sequences/Layering
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top