HDL code generation of simple Discrete Transfer Function Block
6 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Bharath Venkataraman
on 23 Jun 2015
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
on 25 Jun 2015
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 Comments
See Also
Categories
Find more on Model Compatibility Checks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!