Jump to content

How to describe a templatized SystemC port in IPXact


Recommended Posts

For a Systemc port, sc_port<sc_signal_in_if<bool> > out, the IPxact definition is like

<spirit:port>
        <spirit:name>out</spirit:name>
                <spirit:transactional>
                    <spirit:transTypeDef>
                        <spirit:typeName spirit:constrained="false">sc_port</spirit:typeName>
                    </spirit:transTypeDef>
                    <spirit:service>
                        <spirit:initiative>requires</spirit:initiative>
                        <spirit:serviceTypeDefs>
                            <spirit:serviceTypeDef>
                                <spirit:typeName spirit:constrained="false" spirit:implicit="true">sc_signal_in_if</spirit:typeName>
                                <spirit:parameters>
                                    <spirit:parameter>
                                        <spirit:name>DATA_TYPE</spirit:name>
                                        <spirit:value>bool</spirit:value>
                                    </spirit:parameter>
                                 </spirit:parameters>
                            </spirit:serviceTypeDef>

                        </spirit:serviceTypeDefs>
                    </spirit:service>
                </spirit:transactional>
            </spirit:port>

But I am confused how to express 

sc_port<sc_signal_in_if<sc_uint<DATA_WIDTH> > out,  where DATA_WIDTH is a module template parameter ?

Thanks

Khushi

 

Link to comment
Share on other sites

Hi Kushi, the easy way is to use

<spirit:typeName spirit:constrained="false" spirit:implicit="true">sc_signal_in_if&lt;sc_uint&lt;DATA_WIDTH&gt; &gt;</spirit:typeName>

and skip the parameters section. You need to describe DATA_WIDTH as a module parameter also.

Alternatively, instead of using &lt; and &gt;, you can nest 3 serviceTypeDef elements as describe in 6.12.20.2 in 1685-2014. In each of these 3 elements you describe sc_signal_in_if, sc_uint, and DATA_WIDTH.

Best regards,
Erwin

Link to comment
Share on other sites

  • 4 weeks later...

Hi Erwin

Do you mean something like following

<ipxact:port>
        <ipxact:name>out</ipxact:name>
        <ipxact:transactional>
          <ipxact:initiative>requires</ipxact:initiative>
          <ipxact:transTypeDefs>
            <ipxact:transTypeDef>
              <ipxact:typeName exact="true">sc_port</ipxact:typeName>
              <ipxact:typeParameters>
                <ipxact:serviceTypeDef>
                  <ipxact:typeName implicit="false">sc_signal_in_if</ipxact:typeName>
                  <ipxact:typeParameters>
                    <ipxact:serviceTypeDef>
                      <ipxact:typeName implicit="false">sc_uint</ipxact:typeName>
                      <ipxact:typeParameters>
                        <ipxact:typeParameter>
                            <ipxact:name>param1</ipxact:name>
                            <ipxact:value>DATA_WIDTH</ipxact:value>
                        </ipxact:typeParameter>
                      </ipxact:typeParameters>
                    </ipxact:serviceTypeDef>
                  </ipxact:typeParameters> 
                </ipxact:serviceTypeDef>

              </ipxact:typeParameters>
            </ipxact:transTypeDef>
          </ipxact:transTypeDefs>
        </ipxact:transactional>
      </ipxact:port>

 

Thanks

Khushi

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