我正在使用XSDK进行硬件实现,但所有处理都是C / C ++。
预期结果:[0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 1]但是如果您注意到Tera控制台,则显示错误的答案。
我不知道如何从HLS IP呼叫/访问二维矩阵到XSDK?
请帮我了解如何将HLS IP访问到XSDK。
SDK源代码
int main(){init_platform(); // u32 * Results; int i,j,k,m; int Generator_matrix [3] [6]; // int(* GM)[6] = Generator_matrix; XLdpc_encoding LDPC; XLdpc_encoding
* LDPCPTR =& LDPC; XLdpc_encoding_Ini
tialize(LDPCPTR,XPAR_LDPC_ENCODING_0_DEVICE_ID); print(“ r n --- FOR HW --- r n”); XLdpc_encoding_EnableAutoRestart(LDPCPTR); XLdpc_encoding_Start(LDPCPTR); while(!XLdpc_encoding_IsDone)
(LDPCPTR)); for(i = 0; i {for(j = 0; j {XLdpc_encoding_Read_Generator_Words(LDPCPTR,0,Generator_matrix,18); // xil_printf(“%d t”,*(*(Generator_matrix + i))
+ j)); xil_printf(“%d t”,Generator_matrix
[j]);} printf(“ n”);} / * for(k = 0; k {for(m = 0; m)
{while(!XLdpc_encoding_IsDone(LDPCPTR)); XLdpc_encoding_Read_dout_Words(LDPCPTR,0,outdata [k] [m],10); xil_printf(“%d,”,outdata [k] [m]);}} * / cleanup_platform(
);返回0;}
/ **************************功能原型*********************
******** /的#ifndef __linux__int XLdpc_encoding_Initialize(XLdpc_encoding * InstancePtr,U16的DeviceID); XLdpc_encoding_Config * XLdpc_encoding_LookupConfig(U16的DeviceID);诠释XLdpc_encoding_CfgInitialize(XLdpc_encoding * InstancePtr,XLdpc_encoding_Config * ConfigPtr);#elseint XLdpc_encoding_Initialize(XLdpc_encoding * InstancePtr,
常量字符*实例名);诠释XLdpc_encoding_Release(XLdpc_encoding * InstancePtr);#endifvoid XLdpc_encoding_Start(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_IsDone(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_IsIdle(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_IsReady(XLdpc_encoding * InstancePtr);空隙XLdpc_encoding_EnableAutoRestart(
XLdpc_encoding * InstancePtr); void XLdpc_encoding_DisableAutoRestart(XLdpc_encoding * InstancePtr); u32 XLdpc_encoding_Get_Generator_BaseAddress(XLdpc_encoding * InstancePtr); u32 XLdpc_encoding_Get_Generator_HighAddress(XLdpc_encoding * InstancePtr); u32 XLdpc_encod
ing_Get_Generator_TotalBytes(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Get_Generator_BitWidth(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Get_Generator_Depth(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Write_Generator_Words(XLdpc_encoding * InstancePtr,诠释抵消,诠释*数据,INT长度); U32 XLdpc_encoding_Read_Generator_Words(XLdpc_encoding * InstancePtr,诠释偏移
,int * data,int length); u32 XLdpc_encoding_Write_Generator_Bytes(XLdpc_encoding * InstancePtr,int offset,char * data,int length); u32 XLdpc_encoding_Read_Generator_Bytes(XLdpc_encoding * InstancePtr,int offset,char * data,int length); u32 XLdpc_encoding_Get_dout_BaseAddress(XLdpc_encoding *
InstancePtr); U32 XLdpc_encoding_Get_dout_HighAddress(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Get_dout_TotalBytes(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Get_dout_BitWidth(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Get_dout_Depth(XLdpc_encoding * InstancePtr); U32 XLdpc_encoding_Write_dout_Words(XLdpc_encodi
ng * InstancePtr,int offset,int * data,int length); u32 XLdpc_encoding_Read_dout_Words(XLdpc_encoding * InstancePtr,int offset,int * data,int length); u32 XLdpc_encoding_Write_dout_Bytes(XLdpc_encoding * InstancePtr,int offset,char * data,int length)
; u32 XLdpc_encoding_Read_dout_Bytes(XLdpc_encoding * InstancePtr,int offset,char * data,int length);