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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×