cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
5,162 Views
Registered: ‎08-23-2012

exporting AXI BASEADDR to xparameters.h from Vivado IP Integrator?

Jump to solution

Hi,

 

I'm migrating an XPS IP core to Vivado IP Integrator. It has two AXI slave interfaces; one of them is an AXI4-Lite slave, the other an AXI4 Slave.

 

In XPS, the MPD defines parameters for the two base addresses, e.g. C_S_AXI_BASEADDR and C_S_AXI_FOO_BASEADDR; these get exported to the XML HW spec during "export to SDK", and during BSP generation with libgen, my software driver's tcl file (proc generate) picks up the parameters and outputs them to xparameters.h with

 

 

xdefine_include_file $drv_handle "xparameters.h" $drv_name "C_S_AXI_BASEADDR" "C_S_AXI_FOO_BASEADDR"

xdefine_canonical_xpars $drv_handle "xparameters.h" $drv_name "C_S_AXI_BASEADDR" "C_S_AXI_FOO_BASEADDR"

 

When I import the pcore into Vivado using the procedure in UG940 "Lab 5: Converting Legacy EDK IP to use in IP Integrator", the resulting IP core's component.xml file does not have any C_S_AXI*_BASEADDR parameters, so neither does the XML hwspec generated by "export to SDK". When I generate the BSP with libgen, xparameters.h assigns the C macros to 0:

 

#define XPAR_MYIP_0_S_AXI_BASEADDR 0x00000000

#define XPAR_MYIP_0_S_AXI_FOO_BASEADDR 0x00000000

 

So how do I pass the base addresses of my IP to my driver in the IP Integrator flow? 

 

I've tried looking at the component.xml / tcl / mdd for some of Xilinx's own IP Integrator cores, but havent't yet been able to figure out what I need to change.

 

Thanks for any help.

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
6,610 Views
Registered: ‎08-23-2012

Re: exporting AXI BASEADDR to xparameters.h from Vivado IP Integrator?

Jump to solution

I think I figured it out. I looked at the component.xml files for Xilinx's mailbox_v2_0 and mutex_v2_0 cores, which can have two or more AXI slave interfaces.

 

It seems that if you don't declare any BASEADDR parameters in your component.xml, IP integrator will automatically create parameters called C_BASEADDR and C_HIGHADDR for one of the AXI slaves / address blocks in your component. If you have more than one slave, it still only creates one pair of C_BASEADDR/C_HIGHADDR parameters.

 

To get a BASEADDR/HIGHADDR parameter for each slave interface, you have to edit your component.xml and copy what the mailbox_v2_0 and mutex_v2_0 cores do, which is 

 

1) explicitly declare a component parameter for each BASEADDR/HIGHADDR parameter you want. e.g. 

	<spirit:parameter>
	  <spirit:name>C_S_AXI_BASEADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_BASEADDR"
					spirit:bitStringLength="32">0xFFFFFFFF</spirit:value>
	</spirit:parameter>
	<spirit:parameter>
	  <spirit:name>C_S_AXI_HIGHADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_HIGHADDR"
					spirit:bitStringLength="32">0x00000000</spirit:value>
	</spirit:parameter>


	<spirit:parameter>
	  <spirit:name>C_S_AXI_FOO_BASEADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_FOO_BASEADDR"
					spirit:bitStringLength="32">0xFFFFFFFF</spirit:value>
	</spirit:parameter>
	<spirit:parameter>
	  <spirit:name>C_S_AXI_FOO_HIGHADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_FOO_HIGHADDR"
					spirit:bitStringLength="32">0x00000000</spirit:value>
	</spirit:parameter>

 

2) If your HDL doesn't use the BASEADDR/HIGHADDR as generics/parameters, don't declare matching modelParameters.

 

3) For each AXI slave's addressBlock, declare two parameters OFFSET_BASE_PARAM and OFFSET_HIGH_PARAM, linking them to the BASEADDR/HIGHADDR component parameters:

 

  <spirit:memoryMaps>
    <spirit:memoryMap>
      <spirit:name>S_AXI</spirit:name>
      <spirit:addressBlock>
        <spirit:name>S_AXI_BLOCK</spirit:name>
        <spirit:baseAddress spirit:format="long" spirit:resolve="immediate">0</spirit:baseAddress>
        <spirit:range spirit:format="long">4096</spirit:range>
        <spirit:width spirit:format="long">32</spirit:width>
        <spirit:usage>register</spirit:usage>
        <spirit:access>read-write</spirit:access>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>OFFSET_BASE_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.S_AXI_BLOCK.OFFSET_BASE_PARAM">C_S_AXI_BASEADDR</spirit:value>
          </spirit:parameter>
          <spirit:parameter>
            <spirit:name>OFFSET_HIGH_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.S_AXI_BLOCK.OFFSET_HIGH_PARAM">C_S_AXI_HIGHADDR</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:addressBlock>
    </spirit:memoryMap>
    <spirit:memoryMap>
      <spirit:name>S_AXI_FOO</spirit:name>
      <spirit:addressBlock>
        <spirit:name>FOO_BLOCK</spirit:name>
        <spirit:baseAddress spirit:format="bitString" spirit:resolve="user" spirit:bitStringLength="32">0</spirit:baseAddress>
        <spirit:range spirit:format="long" spirit:resolve="immediate">4096</spirit:range>
        <spirit:width spirit:format="long">32</spirit:width>
        <spirit:usage>register</spirit:usage>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>OFFSET_BASE_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.FOO_BLOCK.OFFSET_BASE_PARAM">C_S_AXI_FOO_BASEADDR</spirit:value>
          </spirit:parameter>
          <spirit:parameter>
            <spirit:name>OFFSET_HIGH_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.FOO_BLOCK.OFFSET_HIGH_PARAM">C_S_AXI_FOO_HIGHADDR</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:addressBlock>
    </spirit:memoryMap>
  </spirit:memoryMaps>
 

 

Once you assign addresses in the Address Editor and run Validate Design, your IP block should have the parameters C_S_AXI_BASEADDR / HIGHADDR and C_S_AXI_FOO_BASEADDR / HIGHADDR assigned to proper values. (You can look at the block properties in the Block Diagram.) When you export to SDK, the XML HW spec should contain an entry for your IP instance like

 

    <MODULE FULLNAME="/myip_0" HWVERSION="1.0" INSTANCE="myip_0" IPTYPE="PERIPHERAL" MODCLASS="PERIPHERAL" MODTYPE="myip" VLNV="myip.com:ip:myip:1.0">
      <PARAMETERS>
        <PARAMETER NAME="C_S_AXI_BASEADDR" VALUE="0xB0000000"/>
        <PARAMETER NAME="C_S_AXI_HIGHADDR" VALUE="0xB000FFFF"/>
        <PARAMETER NAME="C_S_AXI_FOO_BASEADDR" VALUE="0x43C00000"/>
        <PARAMETER NAME="C_S_AXI_FOO_HIGHADDR" VALUE="0x43CFFFFF"/>
      </PARAMETERS>

 and now your driver's tcl generate procedure should be able to get the correct values for these parameters. 

View solution in original post

2 Replies
Highlighted
Observer
Observer
6,611 Views
Registered: ‎08-23-2012

Re: exporting AXI BASEADDR to xparameters.h from Vivado IP Integrator?

Jump to solution

I think I figured it out. I looked at the component.xml files for Xilinx's mailbox_v2_0 and mutex_v2_0 cores, which can have two or more AXI slave interfaces.

 

It seems that if you don't declare any BASEADDR parameters in your component.xml, IP integrator will automatically create parameters called C_BASEADDR and C_HIGHADDR for one of the AXI slaves / address blocks in your component. If you have more than one slave, it still only creates one pair of C_BASEADDR/C_HIGHADDR parameters.

 

To get a BASEADDR/HIGHADDR parameter for each slave interface, you have to edit your component.xml and copy what the mailbox_v2_0 and mutex_v2_0 cores do, which is 

 

1) explicitly declare a component parameter for each BASEADDR/HIGHADDR parameter you want. e.g. 

	<spirit:parameter>
	  <spirit:name>C_S_AXI_BASEADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_BASEADDR"
					spirit:bitStringLength="32">0xFFFFFFFF</spirit:value>
	</spirit:parameter>
	<spirit:parameter>
	  <spirit:name>C_S_AXI_HIGHADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_HIGHADDR"
					spirit:bitStringLength="32">0x00000000</spirit:value>
	</spirit:parameter>


	<spirit:parameter>
	  <spirit:name>C_S_AXI_FOO_BASEADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_FOO_BASEADDR"
					spirit:bitStringLength="32">0xFFFFFFFF</spirit:value>
	</spirit:parameter>
	<spirit:parameter>
	  <spirit:name>C_S_AXI_FOO_HIGHADDR</spirit:name>
	  <spirit:value spirit:format="bitString"
					spirit:resolve="user"
					spirit:id="PARAM_VALUE.C_S_AXI_FOO_HIGHADDR"
					spirit:bitStringLength="32">0x00000000</spirit:value>
	</spirit:parameter>

 

2) If your HDL doesn't use the BASEADDR/HIGHADDR as generics/parameters, don't declare matching modelParameters.

 

3) For each AXI slave's addressBlock, declare two parameters OFFSET_BASE_PARAM and OFFSET_HIGH_PARAM, linking them to the BASEADDR/HIGHADDR component parameters:

 

  <spirit:memoryMaps>
    <spirit:memoryMap>
      <spirit:name>S_AXI</spirit:name>
      <spirit:addressBlock>
        <spirit:name>S_AXI_BLOCK</spirit:name>
        <spirit:baseAddress spirit:format="long" spirit:resolve="immediate">0</spirit:baseAddress>
        <spirit:range spirit:format="long">4096</spirit:range>
        <spirit:width spirit:format="long">32</spirit:width>
        <spirit:usage>register</spirit:usage>
        <spirit:access>read-write</spirit:access>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>OFFSET_BASE_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.S_AXI_BLOCK.OFFSET_BASE_PARAM">C_S_AXI_BASEADDR</spirit:value>
          </spirit:parameter>
          <spirit:parameter>
            <spirit:name>OFFSET_HIGH_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.S_AXI_BLOCK.OFFSET_HIGH_PARAM">C_S_AXI_HIGHADDR</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:addressBlock>
    </spirit:memoryMap>
    <spirit:memoryMap>
      <spirit:name>S_AXI_FOO</spirit:name>
      <spirit:addressBlock>
        <spirit:name>FOO_BLOCK</spirit:name>
        <spirit:baseAddress spirit:format="bitString" spirit:resolve="user" spirit:bitStringLength="32">0</spirit:baseAddress>
        <spirit:range spirit:format="long" spirit:resolve="immediate">4096</spirit:range>
        <spirit:width spirit:format="long">32</spirit:width>
        <spirit:usage>register</spirit:usage>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>OFFSET_BASE_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.FOO_BLOCK.OFFSET_BASE_PARAM">C_S_AXI_FOO_BASEADDR</spirit:value>
          </spirit:parameter>
          <spirit:parameter>
            <spirit:name>OFFSET_HIGH_PARAM</spirit:name>
            <spirit:value spirit:id="ADDRBLOCKPARAM_VALUE.FOO_BLOCK.OFFSET_HIGH_PARAM">C_S_AXI_FOO_HIGHADDR</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:addressBlock>
    </spirit:memoryMap>
  </spirit:memoryMaps>
 

 

Once you assign addresses in the Address Editor and run Validate Design, your IP block should have the parameters C_S_AXI_BASEADDR / HIGHADDR and C_S_AXI_FOO_BASEADDR / HIGHADDR assigned to proper values. (You can look at the block properties in the Block Diagram.) When you export to SDK, the XML HW spec should contain an entry for your IP instance like

 

    <MODULE FULLNAME="/myip_0" HWVERSION="1.0" INSTANCE="myip_0" IPTYPE="PERIPHERAL" MODCLASS="PERIPHERAL" MODTYPE="myip" VLNV="myip.com:ip:myip:1.0">
      <PARAMETERS>
        <PARAMETER NAME="C_S_AXI_BASEADDR" VALUE="0xB0000000"/>
        <PARAMETER NAME="C_S_AXI_HIGHADDR" VALUE="0xB000FFFF"/>
        <PARAMETER NAME="C_S_AXI_FOO_BASEADDR" VALUE="0x43C00000"/>
        <PARAMETER NAME="C_S_AXI_FOO_HIGHADDR" VALUE="0x43CFFFFF"/>
      </PARAMETERS>

 and now your driver's tcl generate procedure should be able to get the correct values for these parameters. 

View solution in original post

Highlighted
Adventurer
Adventurer
244 Views
Registered: ‎11-23-2018

Re: exporting AXI BASEADDR to xparameters.h from Vivado IP Integrator?

Jump to solution

Hi bach.log

I followed each step you discussed in this thread & it is working. 

My concern is can I propagate these address values assign to C_S_AXI_BASEADDR to my RTL parameter?

please guide.

0 Kudos