在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 3393|回复: 1

[求助] hls编译C/RTL Co-simulation遇到问题,求指教

[复制链接]
发表于 2019-2-12 15:23:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
自己想编写一个卷积模块,用HLS的fft函数来实现,一共需要3个fft函数。C simulation和C synthesis都通过,但到C/RTL Co-simulation遇到问题,提示如下:
ERROR: [VRFC 10-1374] size mismatch in mixed language port association, vhdl port s_axis_data_tdata [F:/FPGA_Exam/hls/conv/conv_prj/solution1/sim/verilog/fft_config1_s.v:47]

ERROR: [XSIM 43-3322] Static elaboration of top level Verilog design unit(s) in library work failed.

ERROR: Please check the snapshot name which is created during 'xelab',the current snapshot name "xsim.dir/conv_top/xsimk.exe" does not exist

哪位有空帮我分析分析,哪里的原因,找了好几天了。非常感谢!
模块文件如下:





  1. #include "conv_top.h"

  2. void dummy_proc_fe(
  3.     cmpxDataIn in[IFFT_LENGTH],
  4.     cmpxDataIn out[IFFT_LENGTH])
  5. {
  6.     int i;
  7.     for (i=0; i< IFFT_LENGTH; i++)
  8.         out[i] = in[i];
  9. }

  10. void array_multipl(
  11.         complex<data_in_t> in_one[IFFT_LENGTH],
  12.         complex<data_in_t> in_two[IFFT_LENGTH],
  13.         complex<data_out_t> out_multipl[IFFT_LENGTH])
  14. {
  15.         int i;
  16.         array_multipl_label0:for(i=0; i<IFFT_LENGTH; i++)
  17.     {
  18.                 out_multipl[i] = in_one[i] * in_two[i];
  19.     }
  20. }

  21. void conv_top(
  22.         complex<data_in_t> in1[IFFT_LENGTH],
  23.         complex<data_in_t> in2[IFFT_LENGTH],
  24.         complex<data_out_t> out_conv[IFFT_LENGTH])
  25. {
  26.         complex<data_in_t>  xn[IFFT_LENGTH];        //ifft

  27.         status_t ifft_status;
  28.         config_t ifft_config;


  29.     complex<data_in_t>  xn1[IFFT_LENGTH];        //single_one fft
  30.     complex<data_out_t> xk1[IFFT_LENGTH];
  31.     status_t fft_status1;
  32.     config_t fft_config1;

  33.     complex<data_in_t>  xn2[IFFT_LENGTH];        //single_two fft
  34.     complex<data_out_t> xk2[IFFT_LENGTH];
  35.     status_t fft_status2;
  36.     config_t fft_config2;


  37.     dummy_proc_fe(in1, xn1);
  38.     dummy_proc_fe(in2, xn2);

  39.     fft_config1.setDir(1);
  40.     fft_config2.setDir(1);
  41.     ifft_config.setDir(0);

  42.     hls::fft<config1>(xn1, xk1, &fft_status1, &fft_config1);
  43.     hls::fft<config1>(xn2, xk2, &fft_status2, &fft_config2);
  44.     array_multipl(xk1,xk2,xn);
  45.     hls::fft<config1>(xn, out_conv, &ifft_status, &ifft_config);


复制代码




头文件如下:





  1. #include "ap_fixed.h"
  2. #include "hls_fft.h"

  3. // configurable params
  4. const char FFT_INPUT_WIDTH                     = 32;
  5. const char FFT_OUTPUT_WIDTH                    = FFT_INPUT_WIDTH;
  6. const char FFT_STATUS_WIDTH                    = 8;
  7. const char FFT_CONFIG_WIDTH                    = 16;
  8. const char FFT_NFFT_MAX                        = 10;
  9. const char IFFT_NFFT_MAX                       = 11;
  10. const int  FFT_LENGTH                                   = 1 << FFT_NFFT_MAX;
  11. const int  IFFT_LENGTH                                   = 1 << IFFT_NFFT_MAX;

  12. typedef float data_in_t;    //定义为浮点数
  13. typedef float data_out_t;   //定义为浮点数


  14. #include <complex>
  15. typedef std::complex<data_in_t> cmpxDataIn;
  16. typedef std::complex<data_out_t> cmpxDataOut;
  17. using namespace std;



  18. struct config1 : hls::ip_fft::params_t {                                                //静态参数,fft函数用到
  19.     static const unsigned ordering_opt = hls::ip_fft::natural_order;
  20.     static const unsigned config_width = FFT_CONFIG_WIDTH;
  21.     static const unsigned status_width = FFT_STATUS_WIDTH;
  22.     static const unsigned phase_factor_width = 24;
  23.     static const unsigned scaling_opt = hls::ip_fft::unscaled;  //不适用缩放因子
  24.     static const unsigned max_nfft = 11;  //
  25.     static const unsigned mem_phase_factors = hls::ip_fft::distributed_ram;
  26.     static const unsigned stages_block_ram = 3;
  27. };

  28. typedef hls::ip_fft::config_t<config1> config_t;                                //fft运行时间的配置
  29. typedef hls::ip_fft::status_t<config1> status_t;                                //fft运行时间的状态


  30. void dummy_proc_fe(
  31.     cmpxDataIn in[IFFT_LENGTH],
  32.         cmpxDataOut out[IFFT_LENGTH]);

  33. void array_multipl(
  34.         complex<data_in_t> in_one[IFFT_LENGTH],
  35.         complex<data_in_t> in_two[IFFT_LENGTH],
  36.         complex<data_out_t> out_multipl[IFFT_LENGTH]);

  37. void conv_top(
  38.         complex<data_in_t> in1[IFFT_LENGTH],
  39.         complex<data_in_t> in2[IFFT_LENGTH],
  40.         complex<data_out_t> out_conv[IFFT_LENGTH]);


复制代码

directives.tcl如下:





  1. ############################################################
  2. ## This file is generated automatically by Vivado HLS.
  3. ## Please DO NOT edit it.
  4. ## Copyright (C) 2015 Xilinx Inc. All rights reserved.
  5. ############################################################
  6. set_directive_dataflow "conv_top"


复制代码
发表于 2019-2-23 12:23:45 | 显示全部楼层
不错不错不错不错。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-5-3 11:03 , Processed in 0.016480 second(s), 9 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表