Main Content

hdlfilterdainfo

Distributed arithmetic information for filter architectures

Description

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.

example

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

hdlfilterdainfo(___,Name,Value) uses optional name-value 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.

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

example

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: C:\Users\nhunting\ExampleManager\nhunting.Bdoc24b.j2736925\hdlfilter-ex76912192\hdlsrc\firfilt.vhd
### 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. To create a filter System object, use the design function or see the reference page of the object. The following System objects from DSP System Toolbox™ support distributed arithmetic:

For more information, see Distributed Arithmetic for FIR Filters.

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 Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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

Version History

Introduced in R2011a