XHwICAP functions on EDK

Dear all,

I am now trying to use XHwICAP_getClbBits() (and also setClbBits()) to change contents of LUTs on EDK. But they do not work well. My fpga board is XUP (Virtex2 Pro.)

I write a part of "user_logic.vhd" and C code below.

---(a part of) user_logic.vhd----------------------

attribute LOC : string; attribute LOC of LUT4_inst_1 : label is "SLICE_X6Y6";

...........

LUT4_inst_1 : LUT4 generic map ( INIT => X"00F5" ) port map ( O => tmpreg, I0 => slv_reg0(28), I1 => slv_reg0(29), I2 => slv_reg0(30), I3 => slv_reg0(31) );

------------------------------------------------------------

---(a part of) main.c---------------------------------------------- #include #include"xparameters.h" #include"xuartlite_l.h" #include "xutil.h" #include "xbasic_types.h" // for ICAP #include #include

//====================================================

int main (void) {

XStatus status; XHwIcap hwicap;

status = XHwIcap_Initialize (&hwicap, 0, XHI_READ_DEVICEID_FROM_ICAP);

if (status == XST_DEVICE_IS_STARTED) { print ("ICAP is OK\r\n"); } else if (status != XST_SUCCESS) { print ("ICAP ERROR\r\n"); exit(-1); }

print("-- Exiting main() --\r\n");

// for ICAP functions

Xuint32 col = 6; // SLICE number Xuint32 row = 6; // SLICE number int i = 0; Xuint32 clb_col; Xuint32 clb_row; Xuint32 slice; Xuint8 getValue[16]; Xuint8 getValue_2[16];

/////////////////////////////////////////// // translate to use getClbBits function /////////////////////////////////////////// clb_col = XHwIcap_mSliceX2Col(col); clb_row = XHwIcap_mSliceY2Row(&hwicap,row); slice = XHwIcap_mSliceXY2Slice(col, row);

status = XHwIcap_GetClbBits (&hwicap, clb_row, clb_col, XHI_CLB_LUT.CONTENTS[slice][XHI_CLB_LUT_F],getValue, 16); status = XHwIcap_GetClbBits (&hwicap, clb_row, clb_col, XHI_CLB_LUT.CONTENTS[slice][XHI_CLB_LUT_G],getValue_2, 16);

if (status != XST_SUCCESS) { print ("error"); }

// Display got values

..................

------------------------------------------------------------

In this case, I think either GetClbBits function in main.c returns "0000000011110101" because SLICE_X6Y6 has been initialized by user_logic.vhd as "00F5" (see above). But, 2 functions both return just "0000000000000000".

I have some mistakes?

By the way, if I use "setClbBits" function before "getClbBits", "getClbBits" returns correct values set by "setClbBits". But, in this case, an external LED is always same state (does not do any action like blanking). So, I think changed values are not reflected.

In addtion, I have checked floorplan of this design. SLICE_X6Y6 is certainly reserved.

Please tell me if you have a solution.

Thank you.

Hiroyuki

Reply to
hiroyuki.kawai0914
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.