diff --git a/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml b/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml index 3264e62e78680a807edda2eae41707b24bf67456..4fcf0d88f59f6666a82b44d7025d740799057311 100644 --- a/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml +++ b/applications/lofar2/designs/lofar2_unb2b_beamformer/lofar2_unb2b_beamformer.fpga.yaml @@ -6,31 +6,32 @@ hdl_library_name: lofar2_unb2b_beamformer fpga_name: lofar2_unb2b_beamformer fpga_description: "FPGA design lofar2_unb2b_beamformer" parameters: - - { name: c_N_pol_bf, value: 2 } # NOTE: define c_N_pol_bf before c_N_pol, to avoid that c_N_pol_bf gets substituted by 2_bf - - { name: c_N_pol, value: 2 } - - { name: c_N_beamsets, value: 2 } - - { name: c_N_sub, value: 512 } - - { name: c_N_fft, value: 1024 } - - { name: c_S_pn, value: 12 } - - { name: c_Q_fft, value: 2 } - - { name: c_N_taps, value: 16 } - - { name: c_W_adc_jesd, value: 16 } # NOTE: define c_W_adc_jesd before c_W_adc, to avoid that c_W_adc_jesd gets substituted by 14_jesd - - { name: c_W_adc, value: 14 } - - { name: c_V_sample_delay, value: 4096 } - - { name: c_V_si_db_large, value: 131072 } # NOTE: define c_V_si_db_large before c_V_si_db, to avoid that c_V_si_db_large gets substituted by 1024_large - - { name: c_V_si_db, value: 1024 } - - { name: c_W_fir_coef, value: 16 } - - { name: c_W_subband, value: 18 } - - { name: c_P_pfb, value: c_S_pn / c_Q_fft } # = 6 - - { name: c_A_pn, value: c_S_pn / c_N_pol } # = 6 - - { name: c_S_sub_bf, value: 488 } - - { name: c_f_adc_MHz, value: 200 } - - { name: c_W_sub_weight, value: 16 } - - { name: c_W_bf_weight, value: 16 } - - { name: c_W_beamlet, value: 8 } - - { name: c_W_beamlet_scale, value: 16 } - - { name: c_nof_clk_per_pps, value: c_f_adc_MHz * 10**6 } # = 200000000 - - { name: c_nof_block_per_sync, value: 195313 } # TBD temporarily use 390625 = 2 * 195312, to have integer number of blocks in 2 s sync interval, TODO: remove when REG_BSN_SOURCE_V2 is used + - { name: c_N_pol_bf, value: 2 } # NOTE: define c_N_pol_bf before c_N_pol, to avoid that c_N_pol_bf gets substituted by 2_bf + - { name: c_N_pol, value: 2 } + - { name: c_N_beamsets, value: 2 } + - { name: c_N_sub, value: 512 } + - { name: c_N_fft, value: 1024 } + - { name: c_S_pn, value: 12 } + - { name: c_Q_fft, value: 2 } + - { name: c_N_taps, value: 16 } + - { name: c_W_adc_jesd, value: 16 } + - { name: c_W_adc, value: 14 } + - { name: c_V_sample_delay, value: 4096 } + - { name: c_V_si_db_large, value: 131072 } + - { name: c_V_si_db, value: 1024 } + - { name: c_W_fir_coef, value: 16 } + - { name: c_W_subband, value: 18 } + - { name: c_P_pfb, value: c_S_pn / c_Q_fft } # = 6 + - { name: c_A_pn, value: c_S_pn / c_N_pol } # = 6 + - { name: c_S_sub_bf, value: 488 } + - { name: c_f_adc_MHz, value: 200 } + - { name: c_W_sub_weight, value: 16 } + - { name: c_W_bf_weight, value: 16 } + - { name: c_W_beamlet_scale, value: 16 } + - { name: c_W_beamlet_resolution, value: 0 - 15 } # EK: FIXME support passing on negative values, workaround use 0 - positive + - { name: c_W_beamlet, value: 8 } + - { name: c_nof_clk_per_pps, value: c_f_adc_MHz * 10**6 } # = 200000000 + - { name: c_nof_block_per_sync, value: 195313 } # TBD temporarily use 390625 = 2 * 195312, to have integer number of blocks in 2 s sync interval, TODO: remove when REG_BSN_SOURCE_V2 is used peripherals: ############################################################################# @@ -214,3 +215,11 @@ peripherals: - { name: g_nof_gains, value: c_N_pol * c_S_sub_bf } # N_pol = Q_fft = 2 slave_port_names: - RAM_BF_WEIGHTS + + - peripheral_name: sdp/sdp_bf_scale + number_of_peripherals: c_N_beamsets # lofar2_unb2b_beamformer.vhd + parameter_overrides: + - { name: g_gain_w, value: c_W_beamlet_scale } + - { name: g_lsb_w, value: 0 - c_W_beamlet_resolution} + slave_port_names: + - REG_BF_SCALE diff --git a/applications/lofar2/libraries/sdp/sdp.peripheral.yaml b/applications/lofar2/libraries/sdp/sdp.peripheral.yaml index 8e609ca56ac9e9acc8bb74934afde78604c361cc..cfdfac31f327eb8ca82b1e5d90f7c0de0fe3dd76 100644 --- a/applications/lofar2/libraries/sdp/sdp.peripheral.yaml +++ b/applications/lofar2/libraries/sdp/sdp.peripheral.yaml @@ -33,7 +33,7 @@ peripherals: - - { field_name: beamlet_scale, width: 16, access_mode: RW, address_offset: 0x34 } - peripheral_name: sdp_subband_equalizer # pi_sdp_subband_equalizer.py - peripheral_description: "Subband equalizer coefficients." + peripheral_description: "SDP Subband equalizer coefficients." parameters: # Parameters of pi_sdp_subband_equalizer.py, fixed in sdp_subband_equalizer.vhd / sdp_pkg.vhd - { name: g_nof_instances, value: 6 } # P_pfb = S_pn / Q_fft = 12 / 2 = 6 @@ -60,7 +60,7 @@ peripherals: radix: complx - peripheral_name: sdp_bf_weights # pi_sdp_bf_weights.py - peripheral_description: "Beamformer weights (= beamlet weights)." + peripheral_description: "SDP Beamformer weights (= beamlet weights)." parameters: # Parameters of pi_sdp_bf_weights.py, fixed in sdp_bf_weights.vhd / sdp_pkg.vhd - { name: g_nof_instances, value: 12 } # = N_pol_bf * P_pfb @@ -99,3 +99,34 @@ peripherals: number_of_fields: g_nof_gains radix: complx + - peripheral_name: sdp_bf_scale # pi_sdp_bf_scale.py + peripheral_description: "SDP BF beamlet data output scaling and requantization." + parameters: + # Parameters fixed in node_sdp_beamformer.vhd / mms_dp_scale.vhd / sdp_pkg.vhd + - { name: g_gain_w, value: 16 } + - { name: g_lsb_w, value: 15 } + slave_ports: + # MM port for node_sdp_beamformer.vhd / mms_dp_scale.vhd / mms_dp_gain.vhd / mms_dp_gain_arr.vhd + - slave_name: REG_BF_SCALE + slave_description: | + "The beamlet scale function scales the beamlet sum with a real scale factor and then + requantizes the result to beamlet data output with less bits. + The beamlet scale factor has g_gain_w bits and the value 2**g_lsb_w represents a gain of 1. + For example for g_gain_w = 16, g_lsb_w = 15, a beamlet sum of 18 bits and beamlet data + output of 8 bits a scale value of: + . 2**g_lsb_w = 2**15 selects the lowest 8 bits of the beamlet sum and clips the highest + 10 bits + . 2**11 rounds the lowest 4 bits, selects the next 8 bits of the beamlet sum and clips + the highest 6 bits. + . 2**5 rounds the lowest 10 bits and selects the highest 8 bits of the beamlet sum." + slave_type: REG + fields: + - - field_name: scale + field_description: "" + width: g_gain_w + address_offset: 0x0 + bit_offset: g_lsb_w + number_of_fields: 1 + radix: unsigned + #radix_width: g_gain_w + radix_resolution: -g_lsb_w