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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
498 Views
Registered: ‎03-29-2017

Performance issues between Kintex-7 FPGA KC705 and Xc7ck160tffg676-2

Hi,

 

I am trying error correction Function with Kintex-7 FPGA KC705 and with custom board Xc7ck160tffg676-2.

 

Its working fine with Kintex-7 FPGA KC705, but its not printing any result with custom board. Please help me.

 

Process 1: Includes for Kintex-7 FPGA KC705, 

1. Created HLS IP for error correction Function

2. Integrated HLS IP with microblaze through VIVADO INtegrator

3. Generated output

Finally, got output.

 

Process 2: Includes for Xc7ck160tffg676-2,  Code is stucking in While LOOP

1. Created HLS IP for error correction Function

2. Integrated HLS IP with microblaze and aurora through VIVADO INtegrator

3. Generated output

Unable to print output

 

 

SOURCE CODE

 

/*
 * Decoder.c

 *
 *  Created on: 06-Nov-2017
 *      Author: Optics2015A
 */
/*
 * RX2.c

 *
 *  Created on: 31-Oct-2017
 *      Author: Optics2015A
 */
/*
 * RX.c
 *
 *  Created on: 31-Oct-2017
 *      Author: Optics2015A
 */


#include <stdio.h>
#include "math.h"
#include "xparameters.h"
#include "xil_exception.h"
#include "xstreamer.h"
#include "xil_cache.h"
#include "xllfifo.h"
#include "xstatus.h"
#include "xil_printf.h"
#include "xuartlite.h"
#include "xparameters.h"
#include "XAurora_decoder.h"  /// HLS IP



/**************************** Type Definitions *******************************/

/***************** Macros (Inline Functions) Definitions *********************/

#define FIFO_DEV_ID           XPAR_AXI_FIFO_0_DEVICE_ID

#define WORD_SIZE 4            /* Size of words in bytes */

#define MAX_PACKET_LEN 4

#define NO_OF_PACKETS 8

#define MAX_DATA_BUFFER_SIZE NO_OF_PACKETS*MAX_PACKET_LEN

#undef DEBUG

/************************** Function Prototypes ******************************/


int XLlFiforx(XLlFifo *InstancePtr, u16 DeviceId);
int RxReceive(XLlFifo *InstancePtr, u32 *DestinationAddr);

XLlFifo FifoInstance;
//u32 DestinationBuffer[MAX_DATA_BUFFER_SIZE * WORD_SIZE];
u32 DestinationBuffer[204];

int main()
{
    //u32 RxWord;
    int Status;
    xil_printf("Entering RX loop\r\n");
    //while(1)
    {
    Status = XLlFiforx(&FifoInstance, FIFO_DEV_ID);
    if (Status != XST_SUCCESS)
        {
        xil_printf("Axi Streaming FIFO Test Failed\n\r");
        return XST_FAILURE;
        }

    xil_printf("Successfully ran Axi Streaming FIFO \n\r");
    }
    return XST_SUCCESS;

}

int XLlFiforx(XLlFifo *InstancePtr, u16 DeviceId)
{
    XLlFifo_Config *Config;
    int Status;
    Status = XST_SUCCESS;


    /* Initialize the Device Configuration Interface driver */
    Config = XLlFfio_LookupConfig(DeviceId);
    if (!Config)
    {
        xil_printf("No config found for %d\r\n", DeviceId);
        return XST_FAILURE;
    }

    /*
     * This is where the virtual address would be used, this example
     * uses physical address.
     */
    Status = XLlFifo_CfgInitialize(InstancePtr, Config, Config->BaseAddress);
    if (Status != XST_SUCCESS)
        {
        decoder(DestinationBuffer);
        xil_printf("Initialization failed\n\r");
        return Status;
        }

    /* Receive the Data Stream */
    while(1) {
    Status = RxReceive(InstancePtr, DestinationBuffer);
    if (Status != XST_SUCCESS)
                {
        xil_printf("Receiving data failed");
        return XST_FAILURE;
                }
    }
    return Status;
}

int decoder(u32 *DestinationBuffer)
{

 int i, m;
 
 u32 result[102];
 XAurora_decoder LDPC;
 XAurora_decoder  *LDPCPTR=&LDPC;
 XAurora_decoder_Initialize(LDPCPTR,XPAR_AURORA_DECODER_0_DEVICE_ID);
 XAurora_decoder_EnableAutoRestart(LDPCPTR);
 XAurora_decoder_Start(LDPCPTR);
 printf("\r\n Error Codeword: \r\n");

 XAurora_decoder_Write_x_Words(LDPCPTR, 0, DestinationBuffer, 204);
 while (!XAurora_decoder_IsDone(LDPCPTR));   // STUCKING AT WHILE LOOP
 for(i=0;i<204;i++)
        {
         xil_printf("%d", DestinationBuffer[i]);
        }
 printf("\r\n DECODED Codeword: \r\n");
while (!XAurora_decoder_IsDone(LDPCPTR));  // STUCKING AT WHILE LOOP
XAurora_decoder_Read_dout_Words(LDPCPTR, 0, result, 102);
    for(m=0;m<102;m++)
       {
        xil_printf("%d", result[m]);
      }
           return 0;
    //binary_to_decimal(result);
    }
int power_func(int c, int d)
{
      int value = 1;
      int count = 1;
      while(count <= d)
      {
            value = value * c;
            count++;
      }
      return value;
}

int binary_to_decimal(u32 *result)
{

     int dec_num1 = 0;
     int dec_num2 = 0;
     int dec_num3 = 0;
     int a = 0, b=0,c=0,i,j,k;
     for(i = 7; i >= 3; i--)

      {
            dec_num1 = (result[i] * power_func(2, a)) + dec_num1;
            a++;
      }
     printf("\n\t %d", dec_num1);
     b=0;
     for(j = 28; j >= 11; j--)
      {
            dec_num2 = (result[j] * power_func(2, b)) + dec_num2;
            b++;
      }
     printf("\n\t %d", dec_num2);
     for(k = 36; k >= 32; k--)
      {
            dec_num3 = (result[k] * power_func(2, c)) + dec_num3;
            c++;
      }
    printf("\n\t %d", dec_num3);
      printf("\n");
      return 0;
}


int RxReceive (XLlFifo *InstancePtr, u32* DestinationAddr)
{

    int i;
    //int Status;
    u32 RxWord;
    static u32 ReceiveLength;

    //xil_printf(" Receiving data ....\n\r");
    /* Read Receive Length */
    ReceiveLength = (XLlFifo_iRxGetLen(InstancePtr))/WORD_SIZE;
    xil_printf("ReceiveLength: %d",ReceiveLength);
    if (ReceiveLength > 0) {
    //xil_printf("rxlen = %d\r\n", ReceiveLength);
    /* Start Receiving */
    for ( i=0; i < ReceiveLength; i++)
    {
        RxWord = 0;
        RxWord = XLlFifo_RxGetWord(InstancePtr);

        //xil_printf("Occ[%d]: %d\r\n", i, XLlFifo_iRxOccupancy(InstancePtr));
        /*if(XLlFifo_iRxOccupancy(InstancePtr))
        {
            RxWord = XLlFifo_RxGetWord(InstancePtr);
        }
        */
        *(DestinationAddr+i) = RxWord;
        xil_printf("received data : %d\r\n",*(DestinationAddr+i));
    }
    //xil_printf("%s", (char *)(DestinationAddr));
    }


/*    Status = XLlFifo_IsRxDone(InstancePtr);
    if(Status != TRUE)
            {
        xil_printf("Failing in receive complete ... \r\n");
        return XST_FAILURE;
            }

    */return XST_SUCCESS;
}








XSDk.PNG
Auror_des.PNG
0 Kudos