Jump to content

error: 'sc_core::sc_object' is an inaccessible base of 'In_multiplexer<9, 4>'


acc_sysC

Recommended Posts

Following is the complete error message:

In file included from /classes/eeee720/systemc/systemc-2.3.3/include/systemc:118:0,
                 from /classes/eeee720/systemc/systemc-2.3.3/include/systemc.h:219,
                 from PIMC_main.cpp:2:
/classes/eeee720/systemc/systemc-2.3.3/include/sysc/utils/sc_vector.h: In instantiation of 'sc_core::sc_object* sc_core::sc_vector<T>::object_cast(void*) const [with T = In_multiplexer<9, 4>]':
PIMC_main.cpp:87:1:   required from here
/classes/eeee720/systemc/systemc-2.3.3/include/sysc/utils/sc_vector.h:508:59: error: 'sc_core::sc_object' is an inaccessible base of 'In_multiplexer<9, 4>'
     { return implicit_cast( static_cast<element_type*>(p) ); }
                                                           ^
/classes/eeee720/systemc/systemc-2.3.3/include/sysc/utils/sc_vector.h: In member function 'sc_core::sc_object* sc_core::sc_vector<T>::object_cast(void*) const [with T = In_multiplexer<9, 4>]':
/classes/eeee720/systemc/systemc-2.3.3/include/sysc/utils/sc_vector.h:508:62: warning: control reaches end of non-void function [-Wreturn-type]
     { return implicit_cast( static_cast<element_type*>(p) ); }
 

Can anyone please help me understand this error message? I have no idea where to begin solving this.

Because of this line /classes/eeee720/systemc/systemc-2.3.3/include/sysc/utils/sc_vector.h: In member function 'sc_core::sc_object* sc_core::sc_vector<T>::object_cast(void*) const [with T = In_multiplexer<9, 4>]': 

I thinks it has do with the vector of type In_multiplexer.

I am using In_multiplexer as a single object and as a vector of objects. But it does not complain about the former.

Here is how  I declared them and used them:

N = 9, M =8

SINGLE OBJECT:

    In_multiplexer<N,M/2> AMux0{"AMux0"};

        AMux0.A(A);
        AMux0.B(B);
        AMux0.MODE(AMux0_SRC);
        AMux0.CORES(AMux0_sY);
        AMux0.SEL(AMux0_AIN_ADDR_part_select);
        AMux0.Y(pimcore0_A_part_select);

VECTOR OF OBJECTS:

    sc_vector<In_multiplexer<N,M/2>> AMux{"AMux", N-2};

        for (auto G = 1; G<N-1; ++G)
        {

            AMux[G].A(A);
            AMux[G].B(B);
            AMux[G].MODE(AMux_mode_vec[G]);
            AMux[G].CORES(AMux_core_vec[G]);
            AMux[G].SEL(AMux_sel_vec[G]);
            AMux[G].Y(part_sA[G]);

}


 

Link to comment
Share on other sites

It is not about the vector, it is about your class hierarchy, esp. the inheritance of In_multiplexer. Using a search machine with 'c++ is an inaccessible base of' brings up e.g.  https://stackoverflow.com/questions/39332489/error-a-is-an-inaccessible-base-of-b.

I suspect when declaring In_multiplexer you forgot to publicly inherit from sc_module. So it should look like

template<unsigned X, unsigned Y>
class In_multiplexer : public sc_core::sc_module {
   
};

My suggestion is to revisit your C++ course material as this is basic C++

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