cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dxt8
Newbie
Newbie
463 Views
Registered: ‎12-24-2020

changing fixed point bits in fft

I am trying to use the fft IP core in vivado hls with fixed-point numbers. If I use byte numbers(8,16,24,32,40) for fft input width and output width, then fixed-point works fine with test bench. But how do I use different number of bits (e.g. ap_fixed<18,1>)? I tried changing default values (in fft_top.h and hls_fft.h) to below values with no success. Are there other parameter values need changing? I am new to this and any help would be appreciated.

const char FFT_INPUT_WIDTH = 18;
const char FFT_OUTPUT_WIDTH = FFT_INPUT_WIDTH;

typedef ap_fixed<FFT_INPUT_WIDTH,1> data_in_t;
typedef ap_fixed<FFT_OUTPUT_WIDTH,FFT_OUTPUT_WIDTH-FFT_INPUT_WIDTH+1> data_out_t;

static const unsigned input_width = 18;
static const unsigned output_width = 18;

 

////fft_top.h default values

#include "ap_fixed.h"
#include "hls_fft.h"

// configurable params
const char FFT_INPUT_WIDTH = 16;
const char FFT_OUTPUT_WIDTH = FFT_INPUT_WIDTH;
const char FFT_CONFIG_WIDTH = 16;
const char FFT_NFFT_MAX = 10;
const int FFT_LENGTH = 1 << FFT_NFFT_MAX;

struct config1 : hls::ip_fft::params_t {
static const unsigned ordering_opt = hls::ip_fft::natural_order;
static const unsigned config_width = FFT_CONFIG_WIDTH;
};

typedef ap_fixed<FFT_INPUT_WIDTH,1> data_in_t;
typedef ap_fixed<FFT_OUTPUT_WIDTH,FFT_OUTPUT_WIDTH-FFT_INPUT_WIDTH+1> data_out_t;

typedef std::complex<data_in_t> cmpxDataIn;
typedef std::complex<data_out_t> cmpxDataOut;

 

////hls_fft.h default values

struct params_t
{
static const unsigned input_width = 16;
static const unsigned output_width = 16;
static const unsigned status_width = 8;
static const unsigned config_width = 16;
static const unsigned max_nfft = 10;

static const bool has_nfft = false;
static const unsigned channels = 1;
static const unsigned arch_opt = pipelined_streaming_io;
static const unsigned phase_factor_width = 16;
static const unsigned ordering_opt = bit_reversed_order;
static const bool ovflo = true;
static const unsigned scaling_opt = scaled;
static const unsigned rounding_opt = truncation;
static const unsigned mem_data = block_ram;
static const unsigned mem_phase_factors = block_ram;
static const unsigned mem_reorder = block_ram;
static const unsigned stages_block_ram = (max_nfft < 10) ? 0 : (max_nfft - 9);
static const bool mem_hybrid = false;
static const unsigned complex_mult_type = use_mults_resources;
static const unsigned butterfly_type = use_luts;

//not supported params:
static const bool xk_index = false;
static const bool cyclic_prefix_insertion = false;
};

Tags (2)
0 Kudos
1 Reply
dfein
Visitor
Visitor
261 Views
Registered: ‎02-21-2021

Was this issue solved?

 

0 Kudos