1.定义hls::ip_fft::params_t 结构体
2.结构体继承
struct father_param1 : hls::ip_fft::params_t {
static const unsigned ordering_opt = hls::ip_fft::natural_order;
static const unsigned config_width = FFT_CONFIG_WIDTH;
static const unsigned status_width = FFT_STATUS_WIDTH;
};
3.改写
typedef hls::ip_fft::params_t base_param_t;
struct father_param1 : base_param_t {
static const unsigned ordering_opt = hls::ip_fft::natural_order;
static const unsigned config_width = FFT_CONFIG_WIDTH;
static const unsigned status_width = FFT_STATUS_WIDTH;
};
表示father_param1结构体继承base_param_t结构体
4.结构体继承和类继承的差异是
结构体继承是public的,和类的继承是不一样的。
5.结构体继承案例
struct ssr_fft_fix_params:ssr_fft_default_params
{
static const int N=1024;
static const int R=4;
static const scaling_mode_enum scaling_mode=SSR_FFT_GROW_TO_MAX_WIDTH;
static const fft_output_order_enum output_data_order=SSR_FFT_NATURAL;
static const int twiddle_table_word_length=18;
static const int twiddle_table_intger_part_length=2;
};
结构体ssr_fft_fix_params继承ssr_fft_default_params结构体