HDL Coder error when converting m-code to System Generator Black Box

1 view (last 30 days)
Everything went fine from fixed-point conversion until post code generation tasks where the console shows following errors:
### Begin Verilog Code Generation ### Working on PLL_HDL_CODER_FixPt as PLL_HDL_CODER_FixPt.v ### Generating Resource Utilization Report resource_report.html Error occurred when running post codegeneration tasks Error: failed to run post code generation tasks: MATLAB:builtins:BadDataType In 'hdlcoder:matlabhdlcoder:porttypeforXSG', data type supplied is incorrect for parameter {2}.
I guess Xilinx System Generator doesn't accept data type provided by HDL Coder. And by the way, where is parameter {2}? To be honest, Matlab console and error tracing are rather ambiguous to me.
PS: Sorry for duplicating this question (the other one is in Newsgroup). However, I believe that this is where I will got the appropriate answer.

Accepted Answer

Yongfeng
Yongfeng on 29 Aug 2013
The message is indeed vague and will be improved.
HDL Coder can't turn a MATLAB design into a System Generator blackbox, because at least one port is of data type that doesn't meet the following requirements:
  1. The data type at port must be scalar.
  2. The data type at port must be either fixed point or Boolean.
  3. xlType doesn't allow negative value for binary point.
  4. xlType doesn't allow binary point position greater than word-size.

More Answers (1)

Hac
Hac on 3 Sep 2013
I have resolved the problem and successfully converted the m-code to System Generator black box. However, the results are different from fixed-point simulation. All of the output values are NaN, which is very strange to me. I guess the initialization is incorrect leading to some NaNs leak out and infect the result. Also, test bench for simutaling HDL code on ISIM cannot be created. Any idea on how to deal with this trouble, guys?

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!