• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. cannot pass uvm_sequence_item to send_to_dut

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 65
  • Views 13181
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cannot pass uvm_sequence_item to send_to_dut

Sporadic Crash
Sporadic Crash over 7 years ago

Hi all,

Problem: I cannot call within uvm_driver the method send_to_dut with uvm_sequence_item. send_to_dut without argument can access class items of uvm_sequence_item, though.

My example is based on the forum entries run_phase doesn't update SV interface signals and How to use uvm_agent for sequencing . In the original case following done, which is working;

class my_transaction extends uvm_sequence_item;
  rand logic [7:0] load_val;
...
endclass

...

class my_driver extends uvm_driver #(my_transaction);
...
virtual task run_phase(uvm_phase_phase);
  seq_item_port.get_next_item(req);
  send_to_dut();
  seq_item_port.item_done();
endtask

virtual task send_to_dut();
  dut_vi.i_load_val = req.load_val;
endtask

The code above works. Please note that send_to_dut does not take an argument. However if I use

send_to_dut ( req );

and

virtual task send_to_dut (uvm_sequence_item my_req);
dut_vi.i_load_val = my_req.load_val;

... then Incisive complains that load_val in the sent_to_dut task is not a class item.

Where is my mistake?

  • Cancel
  • TAM1
    TAM1 over 7 years ago

    The uvm_driver has a class variable "req" whose type you specify when you created your own driver class. In my_driver, you said it was type "my_transaction" when you specified "...extends uvm_driver #(my_transaction):". However, in your virtual method declaration, you declared an input argument of type "uvm_sequence_item". 

    For the default send_to_dut, "req" is referring to the class variable of type my_transaction. So it has a field load_val. In your specialized send_to_dut method, your argument "my_req" is declared to be of the vanilla type uvm_sequence_item. That does not have a field of type load_val.

    Either typecast the sequence_item handle:

    virtual task send_to_dut (uvm_sequence_item my_req);
    my_transaction send_req;
    $cast(send_req,my_req);
    dut_vi.i_load_val = send_req.load_val;

    Or, change your argument type:

    virtual task send_my_trans_to_dut ( my_transaction my_req );
    ...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information