DPI-C with UVM

Hi,

Can any one provide the solution for this problem.

My test bench completely made with UVM.So i want to access the one of the task in the sequence class from c program.

When i am tried to export the task in the class,I am getting the error like no task found.

So i placed the same task outside class,I am able to export/import the tasks from c.

Now the problem comes here with the sequence,

Here sequence can communicate with the sequencer.but when i moved the task outside the class,task can’t able to talk to the next layer tasks.

Here error is showing that sequencer is not found.

Can any one provide the solution for this type of issue.

Please provide the examples if any.

Thanks,
Kamesh.

In reply to kdasari25:

You can create a static instance of your sequence, then you will be able to access it from outside of the class.


class my_seq extends uvm_sequence;
  static my_seq handle_m;

  `uvm_object_utils(my_seq)

  function new(string name="my_seq");
    super.new(name);
    if(handle_m == null) begin
      handle_m = this;
    end
  endfunction : new

  task t1();
    // access sequencer using m_sequencer for example
  endtask
  // ...
endclass


task t2();
  my_seq::handle_m.t1();
endtask


t2 task is called from C-DPI, then it can access t1() inside the seq class using static instance.

In reply to cuonghle:

Hi,

Thanks for your instant response.
My issue is resolved now.
Thank you very much.

Kamesh.