cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
8,192 Views

Using ICAP for readback on Microblaze, Virtex II-Pro..

Hi everybody,
I'm trying to partially reconfigure my device (XC2VP30 on ML310 board) through ICAP. I have my ICAP attached to OPB which is attached to Microblaze. 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. I also made sure that persist bit is not set. As well the base address and high address of my HWICAP is 0x42000000 and 0x42000fff as mentioned in the datasheet of HWICAP. My system's (processor and OPB bus) clock frequency is 25 MHz to make sure that ICAP is OK with it. The system contains a timer, a SysAce, a hwicap, a uartlite and an opb-mdm (for debugging) all attached to the opb. The microblaze has some local memory too. I'm also using EDK, ISE 8.2. That's the whole setting about my system. Now here is the problem:

I just need to measure the delay of reconfiguration through ICAP. The following is a very simple C code I have implemented to read a frame and print the content on the screen. Later I want to write something to a frame and again read it back just to make sure that in fact it changed the reconfiguration. Firstly I initialize the ICAP module and then invoke XHwIcap_DeviceReadFrame() and then I read the configuration through XHwIcap_StorageBufferRead().

    XHwIcap my_icap;

    XStatus icap_stat;

    icap_stat = XHwIcap_Initialize(&my_icap, XPAR_OPB_HWICAP_0_DEVICE_ID, XHI_READ_DEVICEID_FROM_ICAP);

    if(icap_stat != XST_SUCCESS)
        print("\n Initialization not successful!!\n");

    Xuint32 frame_content;

    icap_stat = XHwIcap_DeviceReadFrame(&my_icap, XHI_FAR_CLB_BLOCK, 32, 32);

    if(icap_stat != XST_SUCCESS)
        print("\n There is something working in reading a frame!\n");

        for(i = 0; i < my_icap.WordsPerFrame; i++)
    {
        print("word number");
        putnum(i+1);
        print(" is equal to: ");
        frame_content = XHwIcap_StorageBufferRead(&my_icap, i);
        putnum(frame_content);
        putchar('\n');
        }

The problem is when I read back the frame except for the first 7 words everything is 0, no matter what frame it is. I have carefully studied ICAP's driver's functions and their
implementation. I know that the driver writes the first 7 words in the storage buffer which are basically dummy word, sync word, setting CMD register, setting FAR register and etc. While I have not verified that to read back these are the words that should be sent to ICAP but they sound reasonable. The seven words that I read are as follows:

30008001
0000000d
ffffffff
ffffffff
30002001
00404000
2800619c

(I guess this should not be an issue but the first 4 words are different than what was written in DeviceReadFrame function, I realized that the content changes after invoking Desync command in DeviceReadFrame function!)

So as I mentioned, my problem is I can't basically read a frame of configuration correctly. Do you have any idea where I'm doing wrong or what the problem is? I have been advised to use DeviceRead and DeviceWrite instead of DeviceReadFrame and DeviceWriteFrame. Does any one have a successful on unsuccessful experience with these functions in the driver?

As well I have some doubts and questions. Firstly why should we first read a frame, modify it and then write it back to the configuration? Can't we just write something to the device? I haven't still worked with difference-based reconfiguration and it might have something to do with that. But if I just want to write configuration to one frame that doesn't implement any other part of any other circuit, can't I just write something to that frame without first reading it and modifying it?

The second question that I have is about the storage buffer of the HWICAP module. Firstly I thought that I have to set an opb_bram so that HWICAP can use it. However later through studying the driver I realized that the base address for HWICAP is the same as storage buffer (which is the BRAM) so I concluded that when I use a HWICAP I implicitly assign a BRAM to it. Is this so? If not please let me know.

The third question is the clock frequency that ICAP operates! I have read somewhere that the highest is 66MHz. Is it correct or we can set the clock higher than that?

This message became very long, but I really appreciate it if you could kindly help me out with it. I have read many of the previous posts about ICAP but couldn't find enough information to solve my problems. So perhaps this post can be a complement to them.

Thanks a lot beforehand,

0 Kudos
3 Replies
iamadog3333
Visitor
Visitor
4,562 Views
Registered: ‎08-19-2009

I meet the same problem with you! I am using HWICAP to readback a frame data, but when I print them out I found that all the readback data is 0!!

 

I have changed the configuration frame address, but all 0.

I have written a frame data(not 0) into the device, then use the function-- XHwIcap_DeviceReadFrame() to readback. The readback data are all 0.

 

How do you handle the problem? Thank you!

 

my mail: iamadog3333#163.com   #==at

0 Kudos
iamadog3333
Visitor
Visitor
4,561 Views
Registered: ‎08-19-2009

I meet the same problem with you! I am using HWICAP to readback a frame data, but when I print them out I found that all the readback data is 0!!

 

I have changed the configuration frame address, but all 0.

I have written a frame data(not 0) into the device, then use the function-- XHwIcap_DeviceReadFrame() to readback. The readback data are all 0.

 

How do you handle the problem? Thank you!

 

my mail: iamadog3333#163.com   #==at

0 Kudos
iamadog3333
Visitor
Visitor
4,479 Views
Registered: ‎08-19-2009

The problem was solved!
The main reason is some setting in bitgen.ut was wrong.I use the bitgen.ut file as follows, then it works!
-g DebugBitstream:No
-g Binary:no
-g CRC:Enable
-g ConfigRate:4
-g CclkPin:PullUp
-g M0Pin:PullUp
-g M1Pin:PullUp
-g M2Pin:PullUp
-g ProgPin:PullUp
-g DonePin:PullUp
-g PowerdownPin:PullUp
-g TckPin:PullUp
-g TdiPin:PullUp
-g TdoPin:PullNone
-g TmsPin:PullUp
-g UnusedPin:PullDown
-g UserID:0xFFFFFFFF
-g DCMShutdown:Disable
-g DisableBandgap:No
-g DCIUpdateMode:AsRequired
-g StartUpClk:CClk
-g DONE_cycle:4
-g GTS_cycle:5
-g GWE_cycle:6
-g LCK_cycle:NoWait
-g Match_cycle:Auto
-g Security:None
-g Persist:No
-l
-m
-g ReadBack
-g DonePipe:No
-g DriveDone:No
-g Encrypt:No
HWICAP's IP version is 1.00b, the driver's version is 1.00a.
For more information: iamadog3333@163.com
0 Kudos