HDL code generation of simple Discrete Transfer Function Block

3 views (last 30 days)
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,

Answers (2)

Bharath Venkataraman
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.
  1 Comment
Safiya
Safiya on 24 Jun 2015
I have attached model here.
yes, settings are inherited. but as long as input is double it is ok, when the input const block output is changed to fixpoint it gives errors.

Sign in to comment.


Bharath Venkataraman
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.

Community Treasure Hunt

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

Start Hunting!