itsmyturn Posted June 6, 2012 Report Share Posted June 6, 2012 My code for the driver's connect phase is shown below. I'm creating a simple VIF container object and setting it as a DB object. When I try to retrive it from the driver, I do get the object, but it seems to be of a different type, and my simulation fails at the casting step in the driver. Can someone help me with this. This is my first attempt with UVM. So, it might be a very simple mistake. Any help in this regard is appreciated. I have an initial block in my TB that does something like initial begin typedef myvif_container #(virtual myInterface) myvif_container_t; myvif_container_t myvif_container_h; myvif_container_h = myvif_container_t::type_id::create("myvif_container_h"); set_config_object("*.*driver", "myvif_container", myvif_container_h); .... end function void connect(); uvm_object tmp; typedef myvif_container #(virtual myInterface) myvif_container_t; myvif_container_t myvif_container_h; if (!(get_config_object("myvif_container", tmp))) begin `uvm_fatal(get_type_name(), "VIF container not found") end if (tmp == null) begin `uvm_fatal(get_type_name(), "VIF container is null"); end if (!($cast(myvif_container_h, tmp))) begin `uvm_info(get_type_name(), $psprintf ("container type is %s", tmp.get_type_name()), UVM_NONE); `uvm_fatal(get_type_name(), "Interface container different type") end endfunction : connect class myvif_container #(type VIF=int) extends uvm_object; `uvm_object_param_utils (myvif_container #(VIF)) VIF m_vif_h; function new (string name="vif_container"); super.new(name); endfunction : new endclass : myvif_container Quote Link to comment Share on other sites More sharing options...
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.