GitLab will be in maintenance on October the 8th from 18:00 CET until 23:59 CET.

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

Preserve XST Re,Im order, so use g_user_size = 2 for complex data.

parent 2b6493b3
Branches
No related tags found
No related merge requests found
Pipeline #22559 passed
......@@ -582,8 +582,8 @@ PACKAGE BODY sdp_pkg IS
FUNCTION func_sdp_get_stat_from_mm_user_size(g_statistics_type : STRING) RETURN NATURAL IS
-- see sdp_statistics_offload.vhd for description
BEGIN
RETURN sel_a_b(g_statistics_type="BST", c_sdp_W_statistic_sz, -- = 2
sel_a_b(g_statistics_type="XST", c_nof_complex * c_sdp_W_statistic_sz, -- = 4
RETURN sel_a_b(g_statistics_type="BST", c_sdp_W_statistic_sz, -- = 2, so preserve X, Y order
sel_a_b(g_statistics_type="XST", c_sdp_W_statistic_sz, -- = 2, so preserve Re, Im order
c_sdp_W_statistic_sz)); -- = 2, SST
END func_sdp_get_stat_from_mm_user_size;
......
......@@ -67,23 +67,20 @@
-- and 64bit big endian.
-- The g_user_size defines the number of words that get reversed:
-- . For the SST there is only one uint64 part, so g_user_size = 2.
-- . For the BST the X and Y polarization parts are treated as and array of
-- . For the BST the X and Y polarization parts are treated as an array of
-- [N_pol_bf], so index 0 = X is send first and therefore g_user_size = 2
-- to preserve the polarization order.
-- . For the XST the Re and Im complex parts are treated as a cint64, so
-- the imaginary part is send first and therefore g_user_size = 4 to also
-- reverse the Re an Im parts. This is similar as with cint16 values that
-- are packed as Im << 16 + Re in a 32bit word. However it differs from
-- two diminensional arrays of [N_complex], because for arrays index 0
-- is send first and index 0 corresponds to Re.
-- to preserve the polarization X, Y order.
-- . For the XST the Re and Im complex parts of cint64 are treated as an
-- array of [N_complex], so index 0 = Re is send first and therefore
-- g_user_size = 2 to preserve the complex Re, Im order.
--
-- The () show the parts that are contained in g_user_size and that got
-- reversed by g_reverse_word_order = TRUE compared to the stored order:
--
-- Transport order: (g_user_size)
-- SST (Uh, Ul), 2
-- BST (Xh, Xl), (Yh, Yl), 2 keep parts order
-- XST (Ih, Il, Rh, Rl), 4 also reverse parts order
-- BST (Xh, Xl), (Yh, Yl), 2 keep X, Y parts order
-- XST (Rh, Rl), (Ih, Il), 2 keep Re, Im parts order
--
-------------------------------------------------------------------------------
......
......@@ -533,7 +533,7 @@ BEGIN
-- W: 0 1 2 3 4 5 ... 1948 1949 1950 1951
-- S: 0 1 2 ... 974 975
-- B = D: 0 1 ... 487
-- I: 0 1 2 3 0 ... 0 1 2 3
-- I: 0 1 0 1 0 ... 0 1 0 1
-- P: Words values:
-- 0 0 1 2 3 4 5 ... 1948 1949 1950 1951
--
......@@ -564,7 +564,7 @@ BEGIN
-- W: 0 1 2 3 4 5 ... 572 573 574 575
-- S: 0 1 2 ... 286 287
-- X = D: 0 1 ... 143
-- I: 0 1 2 3 0 ... 0 1 2 3
-- I: 0 1 0 1 0 ... 0 1 0 1
-- P: J: K: Word values:
-- 0 0 0 0 1 2 3 4 5 ... 572 573 574 575
-- 1 1 576 ...
......@@ -586,16 +586,16 @@ BEGIN
D := S / c_nof_complex; -- range c_mm_nof_data = 144 Data values, because
-- c_mm_data_size / c_sdp_W_statistic_sz = 2 = c_nof_complex
X := D; -- range c_sdp_X_sq = 144 complex XST values
I := W MOD c_mm_user_size; -- range c_mm_user_size = c_nof_complex * c_sdp_W_statistic_sz = 4 words
I := W MOD c_mm_user_size; -- range c_mm_user_size = c_sdp_W_statistic_sz = 2 words
P := rx_packet_cnt; -- range c_mm_nof_packets
J := P MOD g_nof_crosslets; -- range g_nof_crosslets
K := P / g_nof_crosslets; -- range g_P_sq
v_exp_data := D * c_mm_user_size;
v_exp_data := S * c_mm_user_size; -- c_mm_user_size = 2
IF g_reverse_word_order = FALSE THEN
v_exp_data := v_exp_data + I;
ELSE
v_exp_data := v_exp_data - I + c_mm_user_size-1; -- c_mm_user_size = 4
v_exp_data := v_exp_data - I + c_mm_user_size-1;
END IF;
v_exp_data := v_exp_data + J * c_packet_size; -- c_packet_size = 576
v_exp_data := v_exp_data + K * c_mm_Xsq_span; -- c_mm_Xsq_span = 4096
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment