参数传递规则问题-类型匹配
一、顶层参数传递给sub_function参数note: candidate function not viable: no known conversion from ap_uint32 * to ap_uint16 * for 4th argument;void my_top(hls::streamap_axiuPIX_W*N_PIX,1,1,1 src,hls::streamap_axiuPIX_W*N_PIX,1,1,1 dst,ap_uint32 param_mem[1024]){#pragma HLS RESOURCE variableparam_mem coreRAM_2P_BRAM//这里指定为双口RAM会出问题#pragma HLS INTERFACE axis register both portsrc#pragma HLS INTERFACE axis register both portdst#pragma HLS INTERFACE s_axilite portreturn bundleCONTROL_BUS#pragma HLS INTERFACE s_axilite portparam_mem bundleCONTROL_BUSstatic struct cfg_info_s cfg_info;#pragma HLS RESOURCE variablecfg_info coreRAM_2P_LUTRAMap_uint32 t10;ap_uint32 t20;ap_uint32 t30;//注意param_cfg中接收param_mem[0]的数组或者指针将会自动的被综合综合工具综合为RAM_1P_BRAM也就是单口RAMparam_cfg(param_mem[0],t1,t2,t3,cfg_info[0]);}上述代码会存在问题数据类型不匹配note: candidate function not viable: no known conversion from ap_uint32 * to ap_uint16 * for 4th argument;需要将数据类型改为一样才可行二、强制转换void my_top(hls::streamap_axiuPIX_W*N_PIX,1,1,1 src,hls::streamap_axiuPIX_W*N_PIX,1,1,1 dst,ap_uint32 param_mem[1024]){#pragma HLS RESOURCE variableparam_mem coreRAM_2P_BRAM//这里指定为双口RAM会出问题#pragma HLS INTERFACE axis register both portsrc#pragma HLS INTERFACE axis register both portdst#pragma HLS INTERFACE s_axilite portreturn bundleCONTROL_BUS#pragma HLS INTERFACE s_axilite portparam_mem bundleCONTROL_BUSstatic struct cfg_info_s cfg_info;#pragma HLS RESOURCE variablecfg_info coreRAM_2P_LUTRAMap_uint32 t10;ap_uint32 t20;ap_uint32 t30;//注意param_cfg中接收param_mem[0]的数组或者指针将会自动的被综合综合工具综合为RAM_1P_BRAM也就是单口RAMparam_cfg((ap_uint16*)param_mem[0],t1,t2,t3,cfg_info[0]);}ERROR: [SYNCHK 200-61] XXX:60: unsupported memory access on variable param_mem.V which is (or contains) an array with unknown size at compile time.ERROR: [SYNCHK 200-41] XXX:101: unsupported pointer reinterpretation from type i32* to type i16* on variable op.V.上述代码综合也会失败因为这种强制类型转换会出问题所以老实的把类型搞对才好。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2561682.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!