UVM_ERROR

Hi,

I’m getting a error for following code of uvm_driver,
Can you help on this.

  begin
      sequence_item req;
      @ (MDPORT.cb);
      seq_item_port.get_next_item(req); // Gets the sequence_item 
      MDPORT.cb.lframe <= 1; // Start of frame
      for(int i = 0; i < 8; i++) begin // Send nibbles
        @(MDPORT.cb);
        MDPORT.cb.data <= req.data[3:0];
        req.data = req.data >> 4;
      end
      MDPORT.cb.lframe <= 0; // End of frame
      seq_item_port.item_done(); // Indicates that the sequence_item has been consumed
    end

ERROR:Unresolved hierarchical reference to “seq_item_port.get_next_item./0/” from module “\package my_pkg.ac_lpc_driver” (module not found).

Thanks,
Prawin

In reply to Prawin kumar:

Can you how you’ve declared your driver? Also do you use any special UVM library version or standard?

Srini

In reply to Srini @ CVCblr.com:

class ac_lpc_driver extends uvm_driver #(sequence_item);

//uvm_macros

//sequence_item req;

// interface declaration

 uvm_analysis_port#(sequence_item)seq_item_port;

function new(string name = "ac_lpc_driver", uvm_component parent = null);
  super.new(name, parent);
  seq_item_port=new("port",this);
endfunction
 
//build_phase
  
task run_phase(uvm_phase phase);


  // Default conditions:
  MDPORT.cb.lframe <= 0;
  MDPORT.cb.data <= 0;
  fork
  forever
    begin
      sequence_item req;
      @ (MDPORT.cb);
      seq_item_port.get_next_item(req); // Gets the sequence_item 
      MDPORT.cb.lframe <= 1; // Start of frame
      for(int i = 0; i < 8; i++) begin // Send nibbles
        @(MDPORT.cb);
        MDPORT.cb.data <= req.data[3:0];
        req.data = req.data >> 4;
      end
      MDPORT.cb.lframe <= 0; // End of frame
      seq_item_port.item_done(); // Indicates that the sequence_item has been consumed
    end
  forever begin
    @(MDPORT.cb);
    if (MDPORT.cb.lframe === 1'b1) begin
      $display($time);
    end
  end
  join_none
endtask: run_phase

endclass: ac_lpc_driver

Thanks,

In reply to Prawin kumar:

Two questions:
(1) What is sequence_item?
(2) Is your driver connected to your sequencer in the Agent?

BTW you can skip the declaration of req.

In reply to Prawin kumar:

Hi Prawin,

You have declared seq_item_port as analysis port and trying to use built in methods of seq_item_port. Analysis port doesn’t have these methods and hence you are getting above error.
You can remove the below line as seq_item_port is implicitly declared in uvm_driver. Hope it helps.

uvm_analysis_port#(sequence_item)seq_item_port;


Regards,
Shivakumar

Hi Prawin,

I will tell you what I understood from your question. Correct me if I am wrong.

  1. “sequence_item” is a class extended from “uvm_sequence_item”.
  2. You have written the “sequence_item” class definition inside a file. That file should be included in a package so that it gets compiled. The inclusion order should be for example
package my_pkg;
  `include "sequence_item.sv"
  ...
  ...
  `include "my_driver.sv"
endpackage

So, it’s the “sequence_item” class gets compiled first & then, the driver gets compiled. Please try this & let me know if this works for you.

Thanks,
Santosh

In reply to chr_sue:

Hi chr_sue,

  1. sequence_item is class extends from uvm_sequence_item.
  2. yes, am connected sequencer and driver in agent only

sequence_item is “req” declaration
sequence_item req;

Thanks,

In reply to Shivakumar AN:

Hi Shivakumar AN,

Ok i’ll remove that, but you have any other method?
because of port declaration mandatory right???

Thanks,

In reply to santosh vaddisetty:

Hi santosh vaddisetty,

yes santosh your correct ,am coded like that only but little bit change as follows

package my_pkg;
class sequenc_item extends from uvm_sequenc_item


endclass


class ac_lpc_driver extend from uvm_driver


endclass
endpackage

So can you tell me what wrong behind the code for that error.

Thanks,

In reply to Prawin kumar:

Hi Prawin,

seq_item_port is already declared in base class uvm_driver which you are extending from. So no need to declare it again in your ac_lpc_driver class.
Also you have declared it as analysis_port which is causing the error. get_next_item is a built in method of seq_item_port and not of analysis_port.


Regards,
Shivakumar

In reply to Shivakumar AN:

Hi Shivakumar AN,

Ok, i’ll try that,

Thanks,
Prawin

In reply to Prawin kumar:

Hi Shivakumar,

it’s compiled now, but with fatal error shown below,

code: if (!uvm_config_db#(virtual ac_lpc_if)::get(this, “”, “vif”, vif)) begin
`uvm_fatal(“ac_lpc_agent”, “No virtual interface specified for this agent instance”)

Error: uvm_test_top.env.agent [ac_lpc_agent] No virtual interface specified for this agent instance

Thanks,

In reply to Prawin kumar:

It seems there is no uvm_config_db set command from the toplevel module of your UVM testbench or you are limiting the access by specifying a wrong hierarchical Path in the set Command.

In reply to chr_sue:

Hi,

I’m not clear of your statement.

In reply to Prawin kumar:

If you want to retrieve a value from the config_db using the get command, you have to perform a set command to the config_db, to make sure there is a corresponding value in the config_db.
For the virtual interface the set will be done in the toplevel module of your UVM testbench.

In reply to chr_sue:
Hi,
Can you tell me why am getting this error?

 function void build_phase(uvm_phase phase);
 env = ac_lpc_env::type_id::create("env", this);
    //test_seq = ac_lpc_tx_seq::type_id::create("test_seq",this);
    sequencer = ac_lpc_sequencer::type_id::create("test_seq",this);
    
    if(!uvm_config_db#(virtual ac_lpc_if)::get(this, "", "vif", vif)) begin
      `uvm_fatal("ac_lpc_test", "No virtual interface specified for this test  instance")
    end 
    uvm_config_db#(virtual ac_lpc_if)::set( this, "env", "vif", vif);
  endfunction

ERROR: uvm_test_top [ac_lpc_test] No virtual interface specified for this test instance.

Thanks,

In reply to Prawin kumar:

Hi Prawin,

You are getting this error because for every uvm_config_db get, there must be a corresponding set from the higher hierarchy. Looks like you have missed to set this interface from your TB Top. Please check for similar set code in your TB top:

uvm_config_db #(virtual ac_lpc_if)::set (null, “*”, “vif”, vif);

Also you can refer to some examples of set-get and complete UVM environment from below links. I would suggest you to go through these examples and videos.


Regards,
Shivakumar

In reply to Shivakumar AN:

Hi shiva,

I made it shiva but in driver am getting error again .

ERROR: uvm_test_top.env.driver [ac_lpc_driver] No virtual interface specified for this driver instance

Thanks,

In reply to Prawin kumar:

Can you try after changing
uvm_config_db#(virtual ac_lpc_if)::set( this, “env”, “vif”, vif);
to
uvm_config_db#(virtual ac_lpc_if)::set( this, “*”, “vif”, vif);

Giving * will make sure all the below hierarchy components can get from higher hierarchy.

Thanks,
Shivakumar

In reply to Shivakumar AN:

Hi,

before error in ‘test’ hierarchy

Now at ‘env’.

ERROR; uvm_test_top.env [ac_lpc_env] No virtual interface specified for this env instance.