Jump to content

ambiguous binding for sc_export


Recommended Posts

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

 

Link to comment
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:

 

                  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

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.

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.

×
×
  • Create New...