FIR Static Parameters - 2023.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2023-12-18
Version
2023.2 English

The static parameters of the FIR define how the FIR IP is parameterized and specifies non-dynamic items such as the input and output widths, the number of fractional bits, the coefficient values, the interpolation and decimation rates. Most of these configurations have default values: there are no default values for the coefficients.

The hls_fir.h header file defines a struct hls::ip_fir::params_t that can be used to set the default values for most of the static parameters.

Important: There are no defaults defined for the coefficients. Therefore, AMD does not recommend using the pre-defined struct to directly initialize the FIR. A new user defined struct which specifies the coefficients should always be used to perform the static parameterization.

In this example, a new user struct my_config is defined and with a new value for the coefficients. The coefficients are specified as residing in array coeff_vec. All other parameters to the FIR use the default values.

struct myconfig : hls::ip_fir::params_t {
    static const double coeff_vec[sg_fir_srrc_coeffs_len];
};
static hls::FIR<myconfig> fir1;
fir1.run(fir_in, fir_out);

Fir Struct Parameters

The following table describes the parameters used for the parametrization struct hls::ip_fir::params_tand lists the default values for the parameters as well as the possible values.

Table 1. FIR Struct Parameter Values
Parameter Description C Type Default Value Valid Values
input_width Data input port width unsigned 16 No limitation
input_fractional_bits Number of fractional bits on the input port unsigned 0 Limited by size of input_width
output_width Data output port width unsigned 24 No limitation
output_fractional_bits Number of fractional bits on the output port unsigned 0 Limited by size of output_width
coeff_width Bit-width of the coefficients unsigned 16 No limitation
coeff_fractional_bits Number of fractional bits in the coefficients unsigned 0 Limited by size of coeff_width
num_coeffs Number of coefficients bool 21 Full
coeff_sets Number of coefficient sets unsigned 1 1-1024
input_length Number of samples in the input data unsigned 21 No limitation
output_length Number of samples in the output data unsigned 21 No limitation
num_channels Specify the number of channels of data to process unsigned 1 1-1024
total_num_coeff Total number of coefficients unsigned 21 num_coeffs * coeff_sets
coeff_vec[total_num_coeff] The coefficient array double array None Not applicable
filter_type The type implementation used for the filter unsigned single_rate single_rate, interpolation, decimation, hilbert_filter, interpolated
rate_change Specifies integer or fractional rate changes unsigned integer integer, fixed_fractional
interp_rate The interpolation rate unsigned 1 1-1024
decim_rate The decimation rate unsigned 1 1-1024
zero_pack_factor Number of zero coefficients used in interpolation unsigned 1 1-8
rate_specification Specify the rate as frequency or period unsigned period frequency, period
hardware_oversampling_rate Specify the rate of over-sampling unsigned 1 No Limitation
sample_period The hardware oversample period bool 1 No Limitation
sample_frequency The hardware oversample frequency unsigned 0.001 No Limitation
quantization The quantization method to be used unsigned integer_coefficients integer_coefficients, quantize_only, maximize_dynamic_range
best_precision Enable or disable the best precision unsigned false

false

true

coeff_structure The type of coefficient structure to be used unsigned non_symmetric inferred, non_symmetric, symmetric, negative_symmetric, half_band, hilbert
output_rounding_mode Type of rounding used on the output unsigned full_precision full_precision, truncate_lsbs, non_symmetric_rounding_down, non_symmetric_rounding_up, symmetric_rounding_to_zero, symmetric_rounding_to_infinity, convergent_rounding_to_even, convergent_rounding_to_odd
filter_arch Selects a systolic or transposed architecture unsigned systolic_multiply_accumulate systolic_multiply_accumulate, transpose_multiply_accumulate
optimization_goal Specify a speed or area goal for optimization unsigned area area, speed
inter_column_pipe_length The pipeline length required between DSP columns unsigned 4 1-16
column_config Specifies the number of DSP module columns unsigned 1 Limited by number of DSP macrocells used
config_method Specifies how the DSP module columns are configured unsigned single single, by_channel
coeff_padding Specifies if zero padding is added to the front of the filter bool false false

true

Important: When specifying parameter values which are not integer or boolean, the HLS FIR namespace should be used. For example the possible values for rate_change are shown in the table to be integer and fixed_fractional. The values used in the C program should be rate_change = hls::ip_fir::integer and rate_change = hls::ip_fir::fixed_fractional.