Jump to content

E100 - port specified outside of module


Recommended Posts

Hi All,

I am modifying an existing functional model for my hardware to make it cycle accurate. I get aforesaid error, for my slightly longer hierarchy of classes. 

class Port {
    tlm_utils::simple_target_socket<Port> socket_; 
}
class Memory {
      Port *port;
}
class TlmMemory::public ExistingMemory{
    Memory *mem;
}

class TlmModule :: public ExistingModule { 
    TlmModule(sc_module_name nm); //socket connection is done here.
    tlm_utils::simple_initiator_socket<TlmModule> socket_; 
    TlmMemory *tlmMem;
}
      
class ExistingModule :: public ExistingModuleBase {
}
      
class ExistingModuleBase :: public ExistingDesignBase {
}
      
class ExistingDesignBase :: public sc_core::sc_module {
}

However I do not get the error with following, however this is not what I would ideally like to do -

class TlmModule :: public ExistingModule, public sc_core::sc_module { 
    TlmModule(sc_module_name nm); //socket connection is done here.
    tlm_utils::simple_initiator_socket<TlmModule> socket_; 
    TlmMemory *tlmMem;
}
      
class ExistingModule :: public ExistingModuleBase {
}
      
class ExistingModuleBase :: public ExistingDesignBase {
}
      
class ExistingDesignBase {
}

I would like request help about why my first method of putting sc_module at the bottom of my class hierarchy is not working.

Thanks. 

Link to comment
Share on other sites

Thanks Eyck. I guess I forgot to add important detail. Class ExistingDesignBase as mentioned in first version - is base for every module in design. There are about 40 modules in the design. And the top level class TlmModule, has few modules inside it. Could this lead up to any issue to sc_module hierarchy ? I observed that this message is thrown from sc_port.cpp if the check for parent of sc_module fails. 

Thanks

 

 

Link to comment
Share on other sites

I guess your problem stem from a particular implementation detail in SystemC: if you have an inheritance hierarchy you should declare all constructor parameters as ' my_module( sc_core::sc_module_name const& nm). For the leaf module can leave it as 'MyModule(sc_core::sc_module_name nm)'. In the second case a copy of the module name is created which manipulates the hierarchy stack of the kernel. I assume this way you srew up your design.

It is save to always pass the sc_module_name by const reference in the constructors. This would makeup for a good rule in a modleing guideline

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