diff --git a/libraries/dsp/verify_pfb/tb_verify_pfb_wg.vhd b/libraries/dsp/verify_pfb/tb_verify_pfb_wg.vhd index fe84e21ca58d62cad52a94d62f450297d6ed2050..eac6be532f7a4dbf4ef9af6f0d775cf997238b36 100644 --- a/libraries/dsp/verify_pfb/tb_verify_pfb_wg.vhd +++ b/libraries/dsp/verify_pfb/tb_verify_pfb_wg.vhd @@ -80,9 +80,6 @@ -- > observe the *_scope signals as radix decimal, format analogue format signals in the Wave window. -- default use analogue(automatic), if necessary zoom in using right click analogue(custom). -- --- Note: --- . Must use ABS() with **2.0 of negative REAL, because (negative)**2.0 yields error and value 0.0, --- . Must use brackets (ABS()) to avoid compile error LIBRARY ieee, common_lib, dp_lib, diag_lib, filter_lib, rTwoSDF_lib, fft_lib, wpfb_lib; LIBRARY pfs_lib, pft2_lib, pfb2_lib; @@ -798,12 +795,11 @@ BEGIN sub_b_re_frac <= out_re WHEN rising_edge(dp_clk) AND out_bin = c_bin_b + 1 AND out_val_b = '1'; sub_b_im_frac <= out_im WHEN rising_edge(dp_clk) AND out_bin = c_bin_b + 1 AND out_val_b = '1'; - -- Must use ABS() with ** of real, because (negative)**2.0 yields error and value 0.0, also must use brackets (ABS()) to avoid compile error - sub_a_ampl <= SQRT((ABS(REAL(sub_a_re)))**2.0 + (ABS(REAL(sub_a_im)))**2.0); - sub_a_ampl_frac <= SQRT((ABS(REAL(sub_a_re_frac)))**2.0 + (ABS(REAL(sub_a_im_frac)))**2.0); + sub_a_ampl <= COMPLEX_RADIUS(sub_a_re, sub_a_im); + sub_a_ampl_frac <= COMPLEX_RADIUS(sub_a_re_frac, sub_a_im_frac); - sub_b_ampl <= SQRT((ABS(REAL(sub_b_re)))**2.0 + (ABS(REAL(sub_b_im)))**2.0); - sub_b_ampl_frac <= SQRT((ABS(REAL(sub_b_re_frac)))**2.0 + (ABS(REAL(sub_b_im_frac)))**2.0); + sub_b_ampl <= COMPLEX_RADIUS(sub_b_re, sub_b_im); + sub_b_ampl_frac <= COMPLEX_RADIUS(sub_b_re_frac, sub_b_im_frac); --------------------------------------------------------------------------- -- Measure ADC/WG input mean (DC) and power, and determine sine amplitude