Jump to content

Problem with usage of create_object


Recommended Posts

Hi,

I has a testbench based on OVM2.0 . i am connverting it to UVM now. I am having a problem with create_object() function.

My OVM code is like the following

class MBfm_seq_item extends ovm_sequence_item;

`ovm_object_utils (MBfm_seq_item)

MasterTransaction dataTransObj;

function new (string name = "MBfm_seq_item");

super.new(name);

$cast(dataTransObj, ovm_factory::create_object("MasterTransaction","dataTransObj"));

endfunction: new

endclass: MBfm_seq_item

Here, MasterTransaction is extended from ovm_transcatiom

I converted it to UVM code as follows

class MBfm_seq_item extends uvm_sequence_item;

`uvm_object_utils (MBfm_seq_item)

MasterTransaction dataTransObj;

function new (string name = "MBfm_seq_item");

super.new(name);

$cast(dataTransObj, uvm_factory::create_object("MasterTransaction","dataTransObj"));

endfunction: new

endclass: MBfm_seq_item

Then its giving the error "Failed to find name 'create_object' in specified scope" for the line $cast(dataTransObj, uvm_factory::create_object("MasterTransaction","dataTransObj"));

I tried with the following too

$cast(dataTransObj,create_object("MasterTransaction","dataTransObj"));

Then its giving an error "Dotted name ('create_object') not found in current scope. Note that hierarchical references are not allowed from within a package or $unit.'

Can somebody help me to solve this problem?

Thanks

Suleesh

Edited by suleesh
Link to comment
Share on other sites

The ovm_factory::create_object() method was deprecated in OVM 2.0.1, and removed in the UVM release. I would recommend transitioning first to OVM 2.1.1 to ensure that you are using the latest OVM methodologies, and then use the OVM-UVM conversion script to migrate to UVM. While it may not work perfectly, it might help in identifying the deprecated features.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...