Jump to content
Sign in to follow this  
SeanChou

[UVM Connect] How to connect tlm_analysis_port from SV to SC?

Recommended Posts

Hi UVM connect export,

I hope to use tlm_analysis_port in direction SV report to SC (I could only find the other direction in uvmc example) so I try to write my own as following.

By printing some message I found the analysis port in SV side has been written, however the SC side write did not be invoked, could some one give some hint to the problem or how to debug it has been connected correctly? (I am new to SC so there could be some stupid mistake, please forgive me if any) thanks!

SC:

class my_subscriber : public sc_module, public tlm_analysis_if <my_pkt> {

virtual void write (const my_pkt &pt) {

//...

}

}

int sc_main (int argc, char** argv[]) {

my_subscriber sub("sub");

// uvm_connect(sub, "my_ap");

// I modified previous line to following 2 lines

// because ambiguous call due to multiple inheritance

uvmc_analysis_port<my_pkt> port (sub.name(), "my_ap");

port.bind(cons);

sc_start();

return 0;

}

SV:

uvmc_tlm1 #(my_pkt)::connect(uvm_ap, "my_ap");

Edited by SeanChou

Share this post


Link to post
Share on other sites

Hi SeanChou,

If you are using vcs tool, there are some examples in <INSTALL_PATH>/doc/examples/systemc/vcs/SV_SC_analysis and <INSTALL_PATH>/doc/examples/systemc/vcs/SC_SV_analysis

These examples might be useful for you.

Regards

Peer Mohammed

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...