UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 24577

8.2isp2-EDK/XPS- DMA selftest example does not work for PLB/OPB IPIF-based custom IP generated with Create/Import Peripheral wizard

Description

I created a DMA-enabled Custom IP (my_custom_ip) with Create/Import Peripheral wizard in EDK 8.2i SP#2.

When I run the selftest example created by the XPS Wizard, the DMA selftest code fails.

This problem occurs for both PLB and OPB IPIF-based Custom IP.

Solution

The problem is in the "my_custom_ip_selftest.c" related to the buffers allocations for the Simple DMA Source and Destination Buffers.

Normally, these buffers should be aligned to the bus size (i.e., for the PLB IPIF, they should be aligned to 64 bit). However, in the code, they are not forced to be 64 bit aligned, and left to the Compiler to allocate them at compile time.

To solve the problem for the PLB IPIF-based IPs, these buffers should be 64-bit aligned using a Compiler attribute.

Following code is generated by the Wizard in the "my_custom_ip_selftest.c":

static Xuint8 SrcBuffer[DMA_TEST_HW_SELFTEST_BUFSIZE]; /* Source buffer */

static Xuint8 DstBuffer[DMA_TEST_HW_SELFTEST_BUFSIZE]; /* Destination buffer */

The Compiler attribute should be applied, as shown below, to force the buffers to be 64-bit aligned:

static Xuint8 __attribute__ ((aligned (64))) SrcBuffer[DMA_TEST_HW_SELFTEST_BUFSIZE]; /* Source buffer */

static Xuint8 __attribute__ ((aligned (64))) DstBuffer[DMA_TEST_HW_SELFTEST_BUFSIZE]; /* Destination buffer */

For the OPB IPIF-based Custom IP, the alignment has to be forced to 32 bit using the same method:

static Xuint8 __attribute__ ((aligned (32))) SrcBuffer[DMA_TEST_HW_SELFTEST_BUFSIZE]; /* Source buffer */

static Xuint8 __attribute__ ((aligned (32))) DstBuffer[DMA_TEST_HW_SELFTEST_BUFSIZE]; /* Destination buffer */

This problem will be fixed in a future release of the EDK Tools.

AR# 24577
Date Created 09/04/2007
Last Updated 12/15/2012
Status Active
Type General Article