+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Newbie level 4
    Points: 47, Level: 1

    Join Date
    Dec 2012
    Posts
    5
    Helped
    0 / 0
    Points
    47
    Level
    1

    UVM Sequencer with a transfer function

    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 !!

    •   AltAdvertisement

        
       

  2. #2
    Junior Member level 1
    Points: 91, Level: 1

    Join Date
    Dec 2012
    Location
    CHENG DU, China
    Posts
    15
    Helped
    5 / 5
    Points
    91
    Level
    1

    Re: UVM Sequencer with a transfer function

    One thing I think you can try is using: callback.



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 3
    Points: 6,510, Level: 19
    Achievements:
    Created Blog entry 7 years registered

    Join Date
    Dec 2011
    Location
    Fremont, CA, USA
    Posts
    788
    Helped
    355 / 355
    Points
    6,510
    Level
    19
    Blog Entries
    4

    Re: UVM Sequencer with a transfer function

    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/cook...ences/Layering
    Dave Rich
    Senior Verification Consultant
    Mentor Graphics Corporation



--[[ ]]--