Jump to content

ambiguous binding for sc_export

Recommended Posts

I have this compile error:


          base class
          "tlm::tlm_analysis_if<sc_eq_pkg::eq_transaction>" is

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>
   sc_export<tlm_analysis_if<eq_transaction> > dut_input; // analysis export
   tlm_analysis_port<eq_transaction> sc_output; // analysis port
   //Inputs from transactions

  eq_wrapper_top(sc_module_name nm) : uvm_component(nm)
                  , dut_input("dut_input")
                  , sc_output("sc_output")

Any idea?




Link to post
Share on other sites

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:



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.



Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...