Jump to content

Recommended Posts

Posted

Dear Guys,

I have got a compile error as bellow:

.../sc_interface.h:67: error: 'sc_core::sc_interface::sc_interface(const sc_core::sc_inteface&)' is private

../producer.h:33: error: within this context

......

My sc code here:

producer.h

class producer : public uvm_component
               , public tlm::tlm_bw_transport_if<tlm::tlm_base_protocol_types>
{
public:
  tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types> b_isocket;
  tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types> nb_isocket;

  producer(sc_module_name nm) : uvm_component(nm)
                              , b_isocket("b_isocket")
                              , nb_isocket("nb_isocket")

    {
      b_isocket(*this);
      nb_isocket(*this);
    }
  UVM_COMPONENT_UTILS(producer)

  void build() {
    cout << "SC producer::build" << endl;
  }

......
}

 

sctop.cpp:


#include "uvm_ml.h"
#include "ml_tlm2.h"
using namespace uvm;
using namespace uvm_ml;

#include "uvm_ml_transaction.h"
#include "sc_global_define.h"
#include "sc_env.h"
#include "producer.h"
 

class sctop : public uvm_component
{
public:
  sc_env * scenv;

  producer prod;
 

  sctop(sc_module_name nm) : uvm_component(nm), prod(prod)
  {
    cout << "SC sctop::sctop name= " << this->name() << " type= " << this->get_type_name() << endl;
  }
  void build() {
    cout << "SC sctop::build " << this->name() << endl;
    scenv = new sc_env("scenv");
  }
  void before_end_of_elaboration() {
    cout << "SC sctop::before_end_of_elaboration " << this->name() << endl;
    std::string full_initiator_b_socket_name =
      ML_TLM2_REGISTER_INITIATOR(prod, PAYLOAD_TYPE, b_isocket , 32);
    std::string full_initiator_nb_socket_name =
      ML_TLM2_REGISTER_INITIATOR(prod, PAYLOAD_TYPE, nb_isocket , 32);
    uvm_ml::uvm_ml_connect(full_initiator_b_socket_name,
               "test.svenv.sv_ref_model.b_target_socket");
    uvm_ml::uvm_ml_connect(full_initiator_nb_socket_name,
               "test.svenv.sv_ref_model.nb_target_socket");
   }
  void connect() {
    cout << "SC sctop::connect " << this->name() << endl;
    if (scenv->ref_model != NULL) {
        uvm_ml_register(&scenv->ref_model->sc_to_sv_port1);
        uvm_ml_register(&scenv->ref_model->sc_to_sv_port2);
    }
    uvm_ml_register(&scenv->data->sv_to_sc_data_export);
    uvm_ml_register(&scenv->config->sv_to_sc_config_export);
  }
  void start_of_simulation() {
    cout << "SC sctop::start_of_simulation " << this->name() << endl;
  }
  void end_of_elaboration() {
    cout << "SC sctop::end_of_elaboration " << this->name() << endl;
  }
  UVM_COMPONENT_UTILS(sctop)
};

UVM_COMPONENT_REGISTER(producer)
UVM_COMPONENT_REGISTER(sctop)

int sc_main(int argc, char** argv) {
  return 0;
}
UVM_ML_MODULE_EXPORT(sctop)

 

 

Can you help me with this?

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...