Jump to content

How to represent a c++ object ?


Recommended Posts

Hi guys ,

 

I'm representing a systemC TLM platform in IP-XACT, I finished with systemC modules. Now, each systemC module representing a functional hardware block has to be attached to a c++ object in order to represent some non functional information.

Please, is it possible to represent this information within IP-XACT ??

 

Thanks

Link to comment
Share on other sites

Hi,

 

In IP-XACT, you can reference a file that contains the c++ code. The XML file below defines a component tlmip which contains a view named TLM. That view references a fileSet named TLM. The two files in that fileSet are supposed to implement the TLM view. If you instantiate this component tlmip and you set the TLM view for that instance, then you can derive that you need to compile the tlmip.cpp file and that you need the include file tlmip.h for that.

 

Best regards,

Erwin

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<spirit:component xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009 http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009/index.xsd">
    <spirit:vendor>nxp.com</spirit:vendor>
    <spirit:library>dp</spirit:library>
    <spirit:name>tlmip</spirit:name>
    <spirit:version>1.0</spirit:version>
    <spirit:busInterfaces>
        <spirit:busInterface>
            <spirit:name>TLM_Slave</spirit:name>
            <spirit:busType spirit:version="2011-1.0" spirit:name="TLM2GP" spirit:library="ieee1666" spirit:vendor="accellera.org"/>
            <spirit:abstractionType spirit:version="2011-1.0" spirit:name="TLM2GP_tlm" spirit:library="ieee1666" spirit:vendor="accellera.org"/>
            <spirit:slave>
                <spirit:memoryMapRef spirit:memoryMapRef="RegisterMap"/>
            </spirit:slave>
            <spirit:portMaps>
                <spirit:portMap>
                    <spirit:logicalPort>
                        <spirit:name>TLMSOCKET</spirit:name>
                    </spirit:logicalPort>
                    <spirit:physicalPort>
                        <spirit:name>socket</spirit:name>
                    </spirit:physicalPort>
                </spirit:portMap>
            </spirit:portMaps>
        </spirit:busInterface>
    </spirit:busInterfaces>
    <spirit:memoryMaps>
        <spirit:memoryMap>
            <spirit:name>RegisterMap</spirit:name>
            <spirit:addressBlock>
                <spirit:name>Registers</spirit:name>
                <spirit:baseAddress spirit:resolve="immediate">0x0</spirit:baseAddress>
                <spirit:range spirit:resolve="immediate">0x400</spirit:range>
                <spirit:width spirit:resolve="immediate">32</spirit:width>
                <spirit:usage>register</spirit:usage>
                <spirit:access>read-write</spirit:access>
            </spirit:addressBlock>
            <spirit:addressUnitBits>8</spirit:addressUnitBits>
        </spirit:memoryMap>
    </spirit:memoryMaps>
    <spirit:model>
        <spirit:views>
            <spirit:view>
                <spirit:name>TLM</spirit:name>
                <spirit:envIdentifier>*:*:*</spirit:envIdentifier>
                <spirit:language>systemc</spirit:language>
                <spirit:modelName>tlmip</spirit:modelName>
                <spirit:fileSetRef>
                    <spirit:localName>TLM</spirit:localName>
                </spirit:fileSetRef>
            </spirit:view>
        </spirit:views>
        <spirit:ports>
            <spirit:port>
                <spirit:name>socket</spirit:name>
                <spirit:transactional>
                    <spirit:transTypeDef>
                        <spirit:typeName>tlm::tlm_target_socket<32></spirit:typeName>
                        <spirit:typeDefinition>tlm.h</spirit:typeDefinition>
                    </spirit:transTypeDef>
                    <spirit:service>
                        <spirit:initiative>provides</spirit:initiative>
                        <spirit:serviceTypeDefs>
                            <spirit:serviceTypeDef>
                                <spirit:typeName spirit:implicit="true">tlm_fw_transport_if</spirit:typeName>
                            </spirit:serviceTypeDef>
                        </spirit:serviceTypeDefs>
                    </spirit:service>
                </spirit:transactional>
            </spirit:port>
        </spirit:ports>
    </spirit:model>
    <spirit:fileSets>
        <spirit:fileSet>
            <spirit:name>TLM</spirit:name>
            <spirit:file>
                <spirit:name>../SLMODEL/inc/tlmip.h</spirit:name>
                <spirit:fileType>systemCSource</spirit:fileType>
                <spirit:isIncludeFile spirit:externalDeclarations="true">true</spirit:isIncludeFile>
                <spirit:logicalName>tlmiplib</spirit:logicalName>
            </spirit:file>
            <spirit:file>
                <spirit:name>../SLMODEL/src/tlmip.cpp</spirit:name>
                <spirit:fileType>systemCSource</spirit:fileType>
                <spirit:logicalName>tlmiplib</spirit:logicalName>
                <spirit:dependency>../SLMODEL/inc</spirit:dependency>
            </spirit:file>
        </spirit:fileSet>
    </spirit:fileSets>
</spirit:component>

 

Link to comment
Share on other sites

Hi Emna,

 

I am not sure that I understand you. You speak of c++ objects. In IP-XACT you cannot make references to c++ objects. You can only reference files. Furthermore, you can specify the sc_module name in a view. You can also make multiple views. So in the example above, you can make two views:

 

        <spirit:views>
            <spirit:view>
                <spirit:name>TLM</spirit:name>
                <spirit:envIdentifier>*:*:*</spirit:envIdentifier>
                <spirit:language>systemc</spirit:language>
                <spirit:modelName>tlmip</spirit:modelName>
                <spirit:fileSetRef>
                    <spirit:localName>TLM</spirit:localName>
                </spirit:fileSetRef>
            </spirit:view>
             <spirit:view>
                <spirit:name>TLM-AT</spirit:name>
                <spirit:envIdentifier>*:*:*</spirit:envIdentifier>
                <spirit:language>systemc</spirit:language>
                <spirit:modelName>tlmip_at</spirit:modelName>
                <spirit:fileSetRef>
                    <spirit:localName>TLM-AT</spirit:localName>
                </spirit:fileSetRef>
            </spirit:view>
       </spirit:views>

 

The view named TLM contains modelName tlmip meaning that the sc_module is named tlmip (defined in the file tlmip.cpp). The view named TLM-AT contains modelName tlmip_at meaning that the sc_module is named tlmip_at (for instance defined in another file tlmipat.cpp in an additional fileSet TLM-AT.

 

When you have two instances of this component, let's say u0 and u1, you can choose the view for each instance in the IP-XACT design configuration XML file. E.g.:

 

    <spirit:viewConfiguration>
        <spirit:instanceName>u0</spirit:instanceName>
        <spirit:viewName>TLM</spirit:viewName>
    </spirit:viewConfiguration>
    <spirit:viewConfiguration>
        <spirit:instanceName>u1</spirit:instanceName>
        <spirit:viewName>TLM-AT</spirit:viewName>
    </spirit:viewConfiguration>

 

This will tell your SystemC netlister that it needs to instantiate u0 as tlmip and u1 as tlmip_at. Also you can derive that you will need to compile both files tlmip.cpp and tlmipat.cpp.

 

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