Jump to content

spirit:externalDeclarations


jamal elhaitout

Recommended Posts

Hello Jamal,

The externalDeclarations attribute indicates that the include file contains content that is needed by other files:

image.png.6a04a0d6369856efa42d238c1af52833.png

For instance, I am setting externalDeclarations attribute to true for SystemC header files that define an sc_module. When such modules are instantiated in a SystemC netlist, the SystemC netlist file needs to include those header files because the classes derived from sc_module need to be known. Here is an example:

File ssd_creg_out.h contains:
=============================
class ssd_creg_out : public sc_module {
public:
    SC_HAS_PROCESS(ssd_creg_out);
    ssd_creg_out(sc_module_name name);

    ...
};
      
File ssd_creg_out.xml contains:
===============================
      <spirit:file>
        <spirit:name>../SLMODEL/inc/ssd_creg_out.h</spirit:name>
        <spirit:fileType>systemCSource</spirit:fileType>
        <spirit:isIncludeFile spirit:externalDeclarations="true">true</spirit:isIncludeFile>
        <spirit:logicalName>ssd_slmodel_lib</spirit:logicalName>
      </spirit:file>

IP-XACT design XML file contains:
=================================
        <spirit:componentInstance>
            <spirit:instanceName>u0_creg_out</spirit:instanceName>
            <spirit:componentRef spirit:vendor="nxp.com" spirit:library="ssd" spirit:name="ssd_creg_out" spirit:version="1.0"/>
        </spirit:componentInstance>

SystemC netlist file contains:
==============================
#include "ssd_creg_out.h"  // this include is generated because externalDeclarations is true
class ssd_chip_creg : public sc_module
{
  public:  
  // Constructor  
  SC_HAS_PROCESS(ssd_chip_creg);
  ssd_chip_creg(sc_module_name module_name): sc_module(module_name)
  {
    u0_creg_out = new ssd_creg_out("u0_creg_out");  // requires ssd_creg_out.h to be included
  }
}

Best regards,
Erwin
 

 

 

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