cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
fmostafa
Participant
Participant
4,466 Views
Registered: ‎05-15-2008

problem using HWicap

Hi ,
I'm trying to partially reconfigure my device (XC2VP30 on XUP board)
through ICAP. I have my ICAP attached to OPB which is attached to
PowerPC. In bitgen.ut file I have set the value of mode pins
(M2M1M0) to 1 (PULLUP). So it is not set on 101 which is JTAG mode. As
well the base address and high address of my HWICAP is 0x40200000 and
0x4200ffff as mentioned in the datasheet of HWICAP. Initially my OPB
clock frequency is 50 MHz . The
system contains a gpio,  a hwicap, a uartlite and an plb2opb
bridge all attached to the opb. . I'm also using EDK, ISE 9.1.

my problem that i tried to start with an exmaple to write to a
LUT and read form , this example is attached with the EDK
(xhwicap_lut.c)

i started with the example without major changes just i add
#define XHI_READ_DEVICEID_FROM_ICAP   XHI_XC2VP30
to define my part no
also in the UCF file i made a reservation for a LUT to be not in use
CONFIG PROHIBIT = SLICE_X0Y0 according to the guide lines in the
example

and it works until a XHwIcap_SetClbBits() and then nothing happen .

also i tried to use the XHwIcap_CommandDesync()  but nothing change.
the status returned after the XHwIcap_Initialize() is XST_SUCCESS.

the following part of the code , the important command that i use

#define TEST_COL        0       /* Test Column for LUT */
#define TEST_ROW        0       /* Test Row for LUT    */

#define LUT_SIZE        16      /* The number of bits in a LUT */
#define NUM_READS       10      /* How many times to read back */

#define MAX_COUNT       0xFFFF  /* LUT hold 16-bit values */

static XHwIcap HwIcap;

Xuint8 LutWriteBuffer[LUT_SIZE];        /* Value written to the
LUT     */
Xuint8 LutReadBuffer[LUT_SIZE];         /* Value read back from the
LUT */

    XStatus Status;

    Xuint32 Count;           /* Current value to test */
    XStatus Status;          /* Return value          */
    Xuint32 Index;           /* Counter               */
    Xuint32 RowNum;          /* CLB Row location      */
    Xuint32 ColNum;          /* CLB Column location   */
    Xuint32 Slice;           /* CLB Slice location    */
#ifdef PAUSE
    Xuint8 Ch;               /* For reading from UART */
#endif /* PAUSE */

    /*
     * Initialize Hwicap device
     */

    Status = XHwIcap_Initialize(&HwIcap, DeviceId,
XHI_TARGET_DEVICEID);
    Print("just print status: %d\r\n", Status);
         if (Status == XST_DEVICE_IS_STARTED)
    {
       Print("Device is already initialized.\r\n");
    }
    else if (Status != XST_SUCCESS)
    {
       Print("Failed to initialize: %d\r\n", Status);
       return XST_FAILURE;
    }

   /*Status= XHwIcap_CommandDesync(&HwIcap);
   Print("just print status for Desync: %d\r\n", Status);
    if(Status != XST_SUCCESS)
         {
        print("\n Desynchronization was not successful!\n");

         }*/

    /*
     * Identify the LUT to change: LUT in SLICE_X0Y0.
     */
    ColNum = XHwIcap_mSliceX2Col(TEST_COL);
    RowNum = XHwIcap_mSliceY2Row(&HwIcap, TEST_ROW);
    Slice  = XHwIcap_mSliceXY2Slice(TEST_COL, TEST_ROW);

    Count = 0;
    while (1)
    {
        Count = Count + 1;

        /*
         * Set the LUT array to be assigned
         */
        for (Index = 0; Index < LUT_SIZE; Index++)
        {
            LutWriteBuffer[Index] = (Count >> Index) & 0x01;

        }

        /*
         * Set LUT
         */
        Status = XHwIcap_SetClbBits(&HwIcap, RowNum, ColNum,
                 XHI_CLB_LUT.CONTENTS[Slice][XHI_CLB_LUT_F],
LutWriteBuffer,
                 LUT_SIZE);

        /*
         * Read back LUT value
         */
        Status = XHwIcap_GetClbBits(&HwIcap, RowNum, ColNum,
                                    XHI_CLB_LUT.CONTENTS[Slice]
[XHI_CLB_LUT_F],
                                    LutReadBuffer, LUT_SIZE);

        /*
         * Compare the written and read values
         */
        for (Index = 0; Index < LUT_SIZE; Index++)
        {
            if (LutWriteBuffer[Index] != LutReadBuffer[Index])
            {
                Print("Read %d failed at index %d\r\n", Count, Index);
                break;
            }
        }

        if ((Count % 100) == 0)
        {
            Print("Iteration Number:");
            Print(" %d of Writing/Reading the LUT is successful \r\n",
Count);
        }

    }
0 Kudos
Reply
0 Replies