HDL code generation of simple Discrete Transfer Function Block
3 次查看(过去 30 天)
显示 更早的评论
Hi, when I use the TF block and generate the HDL code with double type input data and making all parameters of TF to default / inherited, it works fine.
On the other hand it gives the following error if we choose input data type to fixdt(1,16,0) etc. Error:
Error: "When input of Discrete Transfer Fcn block is floating point, all the internal data-type should be inherited to support HDL code generation. Change data-type setting of 'Discrete Transfer Fcn '"
input block Const : fixdt(1,16,0)
next block : Discrete Block with default settings
Thank You,
0 个评论
回答(2 个)
Bharath Venkataraman
2015-6-23
Is it possible to attach your model? With floating point inputs, the Inherit via Internal Rule setting is required, but it appears that you meet this requirement.
Bharath Venkataraman
2015-6-25
When you change the data to fixed-point, each of the settings on the Discrete Transfer Function block needs to be specified. I suggest figuring out what your coefficient and product settings are, and then the output data type. All the settings should be specified as fixdt(1,WL<FL), where WL is the number of total bits and FL is the number of fraction bits.
One other suggestion I have is not to specify data types a number of times in the ports and in the blocks. You can remove the data type conversions in the ports of the subsystem as well as immediately after inside the Subsystem Data type conversion blocks. Just keep one outside the Subsystem input ports.
With these changes, I was able to generate HDL code for both the floating and fixed point versions.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Compatibility Checks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!