Jump to content

How to create and reuse structured ports in IPXACT component definition


Winnie

Recommended Posts

Let's say I have the following structured port in my component. How do I reuse this structured port in the same component (i.e., with a different name)?

<!-- apb structured port -->
<ipxact:port>
  <ipxact:name>apb</ipxact:name>
  <ipxact:structured packed="true">
    <ipxact:struct direction="out"/>
    <ipxact:subPorts>
      <ipxact:subPort>
        <ipxact:name>addr</ipxact:name>
        <ipxact:wire>
          <ipxact:direction>in</ipxact:direction>
          <ipxact:vectors>
            <ipxact:vector>
              <ipxact:left>clog2(RANGE_id)-1</ipxact:left>
              <ipxact:right>0</ipxact:right>
            </ipxact:vector>
          </ipxact:vectors>
        </ipxact:wire>
      </ipxact:subPort>
      <ipxact:subPort>
        <ipxact:name>prot</ipxact:name>
        <ipxact:wire>
          <ipxact:direction>in</ipxact:direction>
          <ipxact:vectors>
            <ipxact:vector>
              <ipxact:left>2</ipxact:left>
              <ipxact:right>0</ipxact:right>
            </ipxact:vector>
          </ipxact:vectors>
        </ipxact:wire>
      </ipxact:subPort>
    </ipxact:subPorts>
  </ipxact:structured>
</ipxact:port>

 

Link to comment
Share on other sites

Hi Winnie,

I agree that we need to provide more explanation. I have some examples in pseudo XML fragments from our IP-XACT what's new presentation from DVCon Europe 2022.

Example 1: SV structure:

typedef struct packed {
	logic [11:0] mySubPort1;
	logic  [3:0] mySubPort2;
} myStruct;

module m(output myStruct myPort);
endmodule

Example 1: IP-XACT fragment for structured port myPort:

name=myPort
structured, packed=true
    struct, direction=out
	subPort
		name=mySubPort1
		wire
			direction=out
			vector=[11:0]
	subPort
        name=mySubPort2
		wire
			direction=out
			vector=[3:0]
	structPortTypeDef
		typeName=myStruct


Example 2: SV interface:

interface itr( input clk );
  logic x,y;
  modport mod1( input x, clk );
  modport mod2( output y );
endinterface

module ip( itr.mod1 z );
endmodule

Example 2: IP-XACT fragment for structured port z:

name=z
structured
    interface
	subPort, isIO=true
        name=clk
		wire
			direction=in
	subPort
        name=x
		wire
			direction=inout
	structPortTypeDef
		typeName=itr
		role=mod1

Hence, the typeName element in structured port has exactly the same purpose as the typeName elements in wire and transactional port elements: it describes the HDL-specific type of the port. The role element is only used for SV interface modports.

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