Skip to content
Snippets Groups Projects
Commit 2278f839 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Reorganized definition of width, magnitude and fraction for fixed point...

Reorganized definition of width, magnitude and fraction for fixed point weights, no quantitive change.
parent c683e251
No related branches found
No related tags found
1 merge request!162L2SDP-214
...@@ -228,7 +228,7 @@ BEGIN ...@@ -228,7 +228,7 @@ BEGIN
GENERIC MAP ( GENERIC MAP (
g_complex => TRUE, g_complex => TRUE,
g_representation => "SIGNED", g_representation => "SIGNED",
g_lsb_w => c_sdp_W_bf_fraction, g_lsb_w => c_sdp_W_bf_weight_fraction,
g_lsb_round => TRUE, g_lsb_round => TRUE,
g_lsb_round_clip => FALSE, g_lsb_round_clip => FALSE,
g_msb_clip => FALSE, g_msb_clip => FALSE,
......
...@@ -87,27 +87,29 @@ PACKAGE sdp_pkg is ...@@ -87,27 +87,29 @@ PACKAGE sdp_pkg is
CONSTANT c_sdp_V_si_histogram : NATURAL := 512; CONSTANT c_sdp_V_si_histogram : NATURAL := 512;
CONSTANT c_sdp_W_adc : NATURAL := 14; CONSTANT c_sdp_W_adc : NATURAL := 14;
CONSTANT c_sdp_W_adc_jesd : NATURAL := 16; CONSTANT c_sdp_W_adc_jesd : NATURAL := 16;
CONSTANT c_sdp_W_beamlet : NATURAL := 8;
CONSTANT c_sdp_W_beamlet_scale : NATURAL := 16;
CONSTANT c_sdp_W_beamlet_sum : NATURAL := 18;
CONSTANT c_sdp_W_bf_magnitude : NATURAL := 1;
CONSTANT c_sdp_W_bf_weight : NATURAL := 16;
CONSTANT c_sdp_W_crosslet : NATURAL := 16;
CONSTANT c_sdp_W_fir_coef : NATURAL := 16; CONSTANT c_sdp_W_fir_coef : NATURAL := 16;
CONSTANT c_sdp_W_subband : NATURAL := 18;
CONSTANT c_sdp_W_crosslet : NATURAL := 16;
CONSTANT c_sdp_W_beamlet_sum : NATURAL := 18;
CONSTANT c_sdp_W_beamlet : NATURAL := 8;
CONSTANT c_sdp_W_gn_id : NATURAL := 5; CONSTANT c_sdp_W_gn_id : NATURAL := 5;
CONSTANT c_sdp_W_statistic : NATURAL := 64; CONSTANT c_sdp_W_statistic : NATURAL := 64;
CONSTANT c_sdp_W_sub_magnitude : NATURAL := 2; CONSTANT c_sdp_W_sub_weight : NATURAL := 16; -- = w in s(w, p), s = signed
CONSTANT c_sdp_W_sub_weight : NATURAL := 16; CONSTANT c_sdp_W_sub_weight_fraction : NATURAL := 13; -- = p in s(w, p)
CONSTANT c_sdp_W_subband : NATURAL := 18; CONSTANT c_sdp_W_sub_weight_magnitude : NATURAL := c_sdp_W_sub_weight - c_sdp_W_sub_weight_fraction - 1; -- = 2
CONSTANT c_sdp_W_beamlet_scale : NATURAL := 16; -- = w in u(w, p), u = unsigned
CONSTANT c_sdp_W_beamlet_scale_fraction : NATURAL := 15; -- = p in u(w, p)
CONSTANT c_sdp_W_beamlet_scale_magnitude : NATURAL := c_sdp_W_beamlet_scale - c_sdp_W_beamlet_scale_fraction; -- = 1
CONSTANT c_sdp_W_bf_weight : NATURAL := 16; -- = w in s(w, p), s = signed
CONSTANT c_sdp_W_bf_weight_fraction : NATURAL := 14; -- = p in s(w, p)
CONSTANT c_sdp_W_bf_weight_magnitude : NATURAL := c_sdp_W_bf_weight - c_sdp_W_bf_weight_fraction - 1; -- = 1
-- Derived constants -- Derived constants
CONSTANT c_sdp_FS_adc : NATURAL := 2**(c_sdp_W_adc - 1); -- full scale FS corresponds to amplitude 1.0 CONSTANT c_sdp_FS_adc : NATURAL := 2**(c_sdp_W_adc - 1); -- full scale FS corresponds to amplitude 1.0
CONSTANT c_sdp_P_pfb : NATURAL := c_sdp_S_pn / c_sdp_Q_fft; CONSTANT c_sdp_P_pfb : NATURAL := c_sdp_S_pn / c_sdp_Q_fft;
CONSTANT c_sdp_T_adc : TIME := (10**6 / c_sdp_f_adc_MHz) * 1 ps; CONSTANT c_sdp_T_adc : TIME := (10**6 / c_sdp_f_adc_MHz) * 1 ps;
CONSTANT c_sdp_T_sub : TIME := c_sdp_N_fft * c_sdp_T_adc; CONSTANT c_sdp_T_sub : TIME := c_sdp_N_fft * c_sdp_T_adc;
CONSTANT c_sdp_W_bf_fraction : NATURAL := c_sdp_W_bf_weight - c_sdp_W_bf_magnitude -1;
CONSTANT c_sdp_W_bf_product : NATURAL := c_sdp_W_subband + c_sdp_W_bf_weight -1; CONSTANT c_sdp_W_bf_product : NATURAL := c_sdp_W_subband + c_sdp_W_bf_weight -1;
CONSTANT c_sdp_W_sub_fraction : NATURAL := c_sdp_W_sub_weight - c_sdp_W_sub_magnitude -1;
CONSTANT c_sdp_X_sq : NATURAL := c_sdp_S_pn * c_sdp_S_pn; CONSTANT c_sdp_X_sq : NATURAL := c_sdp_S_pn * c_sdp_S_pn;
-- --
......
...@@ -146,7 +146,7 @@ BEGIN ...@@ -146,7 +146,7 @@ BEGIN
GENERIC MAP ( GENERIC MAP (
g_complex => TRUE, g_complex => TRUE,
g_representation => "SIGNED", g_representation => "SIGNED",
g_lsb_w => c_sdp_W_sub_fraction, g_lsb_w => c_sdp_W_sub_weight_fraction,
g_lsb_round => TRUE, g_lsb_round => TRUE,
g_lsb_round_clip => FALSE, g_lsb_round_clip => FALSE,
g_msb_clip => TRUE, g_msb_clip => TRUE,
......
...@@ -148,21 +148,21 @@ N_sub = 512 # = N_fft / N_complex ...@@ -148,21 +148,21 @@ N_sub = 512 # = N_fft / N_complex
W_fsub_proc = math.log(math.sqrt(N_sub), 2) # = 4.5, processing gain of F_sub in number of bits W_fsub_proc = math.log(math.sqrt(N_sub), 2) # = 4.5, processing gain of F_sub in number of bits
N_int_sub = 195312.5 N_int_sub = 195312.5
W_se_weight = 16
W_se_magnitude = 1
W_se_fraction = 14
c_se_unit_weight = 2**W_se_fraction
W_bf_weight = 16
W_bf_magnitude = 1
W_bf_fraction = 14
c_bf_unit_weight = 2**W_sub_fraction
W_beamlet_scale = 16
W_beamlet_scale_magnitude = 1
W_beamlet_scale_fraction = 14
c_beamlet_scale_unit = 2**W_beamlet_scale_fraction
W_sub_weight = 16 # signed
W_sub_weight_fraction = 13
W_sub_weight_magnitude = W_sub_weight - W_sub_weight_fraction - 1
c_sub_weight_unit = 2**W_sub_weight_fraction
W_bf_weight = 16 # signed
W_bf_weight_fraction = 14
W_bf_weight_magnitude = W_bf_weight - W_bf_weight_fraction - 1
c_bf_weight_unit = 2**W_bf_weight_fraction
W_beamlet_scale = 16 # unsigned
W_beamlet_scale_fraction = 15
W_beamlet_scale_magnitude = W_beamlet_scale - W_beamlet_scale_fraction
c_beamlet_scale_unit = 2**W_beamlet_scale_fraction
W_sst_fraction = 4 # Extra fraction bits for SST subband input compared to W_adc W_sst_fraction = 4 # Extra fraction bits for SST subband input compared to W_adc
W_sst_in = 18 # Word width in number of bits of SST subband data input, = W_adc + W_sst_fraction W_sst_in = 18 # Word width in number of bits of SST subband data input, = W_adc + W_sst_fraction
...@@ -312,8 +312,8 @@ if 'dynamic' in models: ...@@ -312,8 +312,8 @@ if 'dynamic' in models:
# Derived gains # Derived gains
# Aperif BF subband CB voltage weight # Aperif BF subband CB voltage weight
subWeight = c_sub_unit_weight * subWeightAdjust # = 16384 = 2**14 * 1.0 subWeight = c_sub_weight_unit * subWeightAdjust # = 16384 = 2**14 * 1.0
bfWeight = c_bf_unit_weight * bfWeightAdjust # = 16384 = 2**14 * 1.0 bfWeight = c_bf_weight_unit * bfWeightAdjust # = 16384 = 2**14 * 1.0
if quantize: if quantize:
subWeight = np.round(subWeight) subWeight = np.round(subWeight)
bfWeight = np.round(bfWeight) bfWeight = np.round(bfWeight)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment