matteodc Posted September 18, 2014 Report Share Posted September 18, 2014 Hello,I have this compile error: error: base class "tlm::tlm_analysis_if<sc_eq_pkg::eq_transaction>" is ambiguous dut_input.bind(*this); This is my code: using namespace tlm; using namespace sc_eq_pkg; class eq_wrapper_top : public uvm_component , tlm_analysis_if<eq_transaction> , tlm_analysis_port<eq_transaction> { public: sc_export<tlm_analysis_if<eq_transaction> > dut_input; // analysis export tlm_analysis_port<eq_transaction> sc_output; // analysis port //Inputs from transactions //Constructor eq_wrapper_top(sc_module_name nm) : uvm_component(nm) , dut_input("dut_input") , sc_output("sc_output") { dut_input.bind(*this); } Any idea? Thanks Regards Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted September 18, 2014 Report Share Posted September 18, 2014 Why does your "eq_wrapper_top" inherit from an interface and a port? Maybe, you probably just want to drop the tlm_analysis_port<eq_transaction> base class. Or why do you need it? hth,Philipp Quote Link to comment Share on other sites More sharing options...
matteodc Posted September 18, 2014 Author Report Share Posted September 18, 2014 That's a very good question. I thought it was needed to use the port inside the class's method, i.e. Inside the write method of the sc_export I use: sc_output.write(sc_output_trans); Is it the right way? It compiles fine now. Thanks Regards Quote Link to comment Share on other sites More sharing options...
matteodc Posted September 18, 2014 Author Report Share Posted September 18, 2014 Was it a problem of multiple inheritance? Thanks Regards Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted September 18, 2014 Report Share Posted September 18, 2014 That's a very good question. I thought it was needed to use the port inside the class's method, i.e. Inside the write method of the sc_export I use: sc_output.write(sc_output_trans); Is it the right way? Of course you can use members of your class without inheriting from their type. Otherwise, C++ would be an even stranger language than it is already, wouldnt it? Assuming that you do more than just forwarding the dut_input to the sc_output (by calling the write function) in your implementation, yes this can be seen as the right way. Was it a problem of multiple inheritance? Indirectly, yes. You can bind the dut_input either to a port or to another export. As your class claimed to be "both", the compiler can't tell which bind function to call. /Philipp Quote Link to comment Share on other sites More sharing options...
matteodc Posted September 19, 2014 Author Report Share Posted September 19, 2014 Thank you very much Philipp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.