jamal elhaitout Posted October 30, 2021 Report Share Posted October 30, 2021 Dear IP-XACT Community, The attribute includeFile/externalDeclarations stills have some ambiguity, what is the purpose exactly ? do you have any SV/VHDL examples showing the use of this attribute ? Thanks Quote Link to comment Share on other sites More sharing options...
kock Posted November 1, 2021 Report Share Posted November 1, 2021 Hello Jamal, The externalDeclarations attribute indicates that the include file contains content that is needed by other files: 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.