Jump to content

What phase to connect interface to driver?

Recommended Posts

I'm just getting started with the examples. The ubus example demonstrates getting the virtual ubus_if from uvm_config_db during the build_phase. Since getting that seems like "connecting", why is that not being done in the connect_phase?

function void build_phase(uvm_phase phase);
     if(!uvm_config_db#(virtual ubus_if)::get(this, "", "vif", vif))
       `uvm_fatal("NOVIF",{"virtual interface must be set for: ",get_full_name(),".vif"});
  endfunction: build_phase


Link to comment
Share on other sites

You can connect virtual interfaces in either the build_phase() or the connect_phase() so its a matter of preference & philosophy.

Strictly speaking you're not making a connection - you are assigning a value to the local vif property through the configuration mechanism. Static configuration settings are updated during the build_phase(), so traditionally this is the phase to handle this.

If you were connecting component TLM ports or references, you would do this in the connect_phase() to make sure the start & end points of the connection exist.

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.

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...