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

1 次查看(过去 30 天)
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.

采纳的回答

Yongfeng
Yongfeng 2013-8-29
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.

更多回答(1 个)

Hac
Hac 2013-9-3
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?

产品

Community Treasure Hunt

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

Start Hunting!

Translated by