CONSTANTc_wg_nof_samples:NATURAL:=c_buf.nof_dat;-- must be <= c_buf.nof_dat
CONSTANTc_wg_gain_w:NATURAL:=1;-- Normalized range [0 1> maps to fixed point range [0:2**c_diag_wg_ampl_w>
-- . use gain 2**0 = 1 to have fulle scale without clipping
-- . use gain 2**g_calc_gain_w > 1 to cause clipping
CONSTANTc_buf_full_scale:NATURAL:=2**(g_buf_dat_w-1)-1;-- The stored waveform range should also be [-c_buf_full_scale +c_buf_full_scale], so not including -c_buf_full_scale-1
--CONSTANT c_ampl_norm : REAL := REAL(c_wg_full_scale)/REAL(c_wg_full_scale+1); -- Use this if g_wg_dat_w < g_buf_dat_w, to avoid clipping
--CONSTANT c_ampl_norm : REAL := 1.0; -- Use this if g_wg_dat_w = g_buf_dat_w, because the stored waveform range is already -+c_buf_full_scale
--CONSTANT c_ampl_norm : REAL := REAL(c_buf_full_scale)/REAL(c_buf_full_scale+1); -- No need to use this, because the stored waveform range is already -+c_buf_full_scale
CONSTANTc_freq_unit:REAL:=c_diag_wg_freq_unit;-- ^= c_clk_freq = Fs (sample frequency), assuming one sinus waveform in the buffer
CONSTANTc_ampl_unit:REAL:=c_diag_wg_ampl_unit*c_ampl_norm;-- ^= Full Scale range [-c_wg_full_scale +c_wg_full_scale] without clipping
CONSTANTc_wg_gain_w:NATURAL:=1;-- Normalized range [0 1> maps to fixed point range [0:2**c_diag_wg_ampl_w>
-- . use gain 2**0 = 1 to have fulle scale without clipping
-- . use gain 2**g_calc_gain_w > 1 to cause clipping
CONSTANTc_buf_full_scale:NATURAL:=2**(g_buf_dat_w-1)-1;-- The stored waveform range should also be [-c_buf_full_scale +c_buf_full_scale], so not including -c_buf_full_scale-1
--CONSTANT c_ampl_norm : REAL := REAL(c_wg_full_scale)/REAL(c_wg_full_scale+1); -- Use this if g_wg_dat_w < g_buf_dat_w, to avoid clipping
--CONSTANT c_ampl_norm : REAL := 1.0; -- Use this if g_wg_dat_w = g_buf_dat_w, because the stored waveform range is already -+c_buf_full_scale
--CONSTANT c_ampl_norm : REAL := REAL(c_buf_full_scale)/REAL(c_buf_full_scale+1); -- No need to use this, because the stored waveform range is already -+c_buf_full_scale
CONSTANTc_freq_unit:REAL:=c_diag_wg_freq_unit;-- ^= c_clk_freq = Fs (sample frequency), assuming one sinus waveform in the buffer
CONSTANTc_ampl_unit:REAL:=c_diag_wg_ampl_unit*c_ampl_norm;-- ^= Full Scale range [-c_wg_full_scale +c_wg_full_scale] without clipping