Documentation

hdlfilterdainfo

Distributed arithmetic information for filter architectures

Syntax

hdlfilterdainfo(filtSO,'InputDataType',nt)
hdlfilterdainfo(filtObj)
hdlfilterdainfo(___,Name,Value)
[dp,dr,lutsize,ff] = hdlfilterdainfo(___)

Description

example

hdlfilterdainfo(filtSO,'InputDataType',nt) displays distributed arithmetic (DA) information for the specified filter System object™ and the input data type, specified by nt. The information consists of an exhaustive table of DARadix values with corresponding folding factors and multiplies for LUT sets, and a table with details of LUTs with corresponding DALUTPartition values. This information helps you to define optimal DA settings for the filter.

hdlfilterdainfo(filtObj) displays DA information for the specified dfilt filter object.

hdlfilterdainfo(___,Name,Value) uses optional name-value pair arguments, in addition to any of the input arguments in previous syntaxes. Use these options to query for DA LUT partition and DA radix information calculated for a given folding factor or LUT specification.

example

[dp,dr,lutsize,ff] = hdlfilterdainfo(___) stores filter architecture details in output variables.

Examples

collapse all

Construct a direct-form FIR filter, and pass it to hdlfilterdainfo. The command displays the results at the command line.

firfilt = design(fdesign.lowpass('N,Fc',8,.4),'SystemObject',true);
hdlfilterdainfo(firfilt,'InputDataType',numerictype(1,12,10))
   | Total Coefficients | Zeros | Effective |
   ------------------------------------------
   |          9         |   0   |     9     |

Effective filter length for SerialPartition value is 9.

  Table of 'DARadix' values with corresponding values of 
  folding factor and multiple for LUT sets for the given filter.

   | Folding Factor | LUT-Sets Multiple | DARadix |
   ------------------------------------------------
   |        1       |         12        |   2^12  |
   |        2       |         6         |   2^6   |
   |        3       |         4         |   2^4   |
   |        4       |         3         |   2^3   |
   |        6       |         2         |   2^2   |
   |       12       |         1         |   2^1   |

  Details of LUTs with corresponding 'DALUTPartition' values.

   | Max Address Width | Size(bits) |             LUT Details             | DALUTPartition |
   -----------------------------------------------------------------------------------------
   |         9         |    7168    |1x512x14                             |[9]             |
   |         8         |    3596    |1x256x14, 1x2x6                      |[8 1]           |
   |         7         |    1824    |1x128x14, 1x4x8                      |[7 2]           |
   |         6         |     904    |1x64x13, 1x8x9                       |[6 3]           |
   |         5         |     608    |1x16x12, 1x32x13                     |[5 4]           |
   |         4         |     412    |1x16x12, 1x16x13, 1x2x6              |[4 4 1]         |
   |         3         |     248    |1x8x13, 2x8x9                        |[3 3 3]         |
   |         2         |     180    |1x2x6, 1x4x12, 1x4x13, 1x4x8, 1x4x9  |[2 2 2 2 1]     |

Notes:
1. LUT Details indicates number of LUTs with their sizes. e.g. 1x1024x18
   implies 1 LUT of 1024 18-bit wide locations.

Create a direct-form FIR filter.

firfilt = design(fdesign.lowpass('N,Fc',8,.4),'filterstructure','dfsymfir','SystemObject',true);

Call hdlfilterdainfo.

lutip = 4;
ff = 3;
[dp,dr,lutsize,ff] = hdlfilterdainfo(firfilt, ...
    'InputDataType',numerictype(1,12,10), ...
    'FoldingFactor',ff,'LUTInputs', lutip);

Pass the returned DA LUT partition ( dp ) and DA radix ( dr ) values into generatehdl. The generated HDL code has DA architecture and implements LUTs with the specified max address width ( lutip ) and folding factor ( ff ).

generatehdl(firfilt,'InputDataType',numerictype(1,12,10), ...
    'DALUTPartition',dp,'DARadix',dr);
### Starting VHDL code generation process for filter: firfilt
### Generating: <a href="matlab:edit('/tmp/Bdoc17b_716109_27120/publish_examples0/tp07ee160c/ex76912192/hdlsrc/firfilt.vhd')">/tmp/Bdoc17b_716109_27120/publish_examples0/tp07ee160c/ex76912192/hdlsrc/firfilt.vhd</a>
### Starting generation of firfilt VHDL entity
### Starting generation of firfilt VHDL architecture
### Clock rate is 3 times the input sample rate for this architecture.
### Successful completion of VHDL code generation process for filter: firfilt
### HDL latency is 3 samples

Input Arguments

collapse all

Filter for which to display distributed arithmetic information, specified as a filter System object. See Distributed Arithmetic for FIR Filters for filter System object types that support distributed arithmetic. To create a filter System object, use its constructor or the design function.

Input data type, specified as a numerictype object. This argument applies only when the input filter is a System object. Call numerictype(s,w,f), where s is 1 for signed and 0 for unsigned, w is the word length in bits, and f is the number of fractional bits.

Filter for which to display distributed arithmetic information, specified as a dfilt object. See Distributed Arithmetic for FIR Filters for filter types that support distributed arithmetic. You can create this object using the design function.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'FoldingFactor',2,'DALUTPartition',9.

You can only specify one folding factor argument and one LUT argument at a time.

Folding Factor Arguments

collapse all

Hardware folding factor, specified as the comma-separated pair consisting of 'FoldingFactor' and Inf or an integer greater than 1. Given the folding factor, the coder displays an exhaustive table of corresponding LUT input values, sizes, and details. If the folding factor is inf, the coder uses the maximum folding factor.

Example: 'FoldingFactor',2

DA radix value, specified as the comma-separated pair consisting of 'DARadix' and an integer power of 2. Given the DA radix, the coder displays for the corresponding folding factor value an exhaustive table of LUT input values, sizes, and details.

Example: 'DARadix',4

LUT Arguments

collapse all

LUT input value, specified as the comma-separated pair consisting of 'LUTInputs' and an integer greater than 1. Given the LUT input value, the coder displays an exhaustive table of the corresponding folding factor values, LUT sizes, and details.

Example: 'LUTInputs',3

DA LUT partition value, specified as the comma-separated pair consisting of 'DALUTPartition' and an integer greater than 1. Given the DA LUT partition value, the coder displays an exhaustive table of the corresponding folding factor values, LUT sizes, and details.

Example: 'DALUTPartition',9

Output Arguments

collapse all

DA LUT partition values, returned as a cell array.

DA radix values, returned as a cell array.

LUT size values, returned as a cell array.

Folding factor values, returned as a cell array.

Introduced in R2011a

Was this topic helpful?