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 ...@@ -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 FUNCTION func_sdp_get_stat_from_mm_user_size(g_statistics_type : STRING) RETURN NATURAL IS
-- see sdp_statistics_offload.vhd for description -- see sdp_statistics_offload.vhd for description
BEGIN BEGIN
RETURN sel_a_b(g_statistics_type="BST", c_sdp_W_statistic_sz, -- = 2 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_nof_complex * c_sdp_W_statistic_sz, -- = 4 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 c_sdp_W_statistic_sz)); -- = 2, SST
END func_sdp_get_stat_from_mm_user_size; END func_sdp_get_stat_from_mm_user_size;
......
...@@ -67,23 +67,20 @@ ...@@ -67,23 +67,20 @@
-- and 64bit big endian. -- and 64bit big endian.
-- The g_user_size defines the number of words that get reversed: -- 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 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 -- [N_pol_bf], so index 0 = X is send first and therefore g_user_size = 2
-- to preserve the polarization order. -- to preserve the polarization X, Y order.
-- . For the XST the Re and Im complex parts are treated as a cint64, so -- . For the XST the Re and Im complex parts of cint64 are treated as an
-- the imaginary part is send first and therefore g_user_size = 4 to also -- array of [N_complex], so index 0 = Re is send first and therefore
-- reverse the Re an Im parts. This is similar as with cint16 values that -- g_user_size = 2 to preserve the complex Re, Im order.
-- 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.
-- --
-- The () show the parts that are contained in g_user_size and that got -- 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: -- reversed by g_reverse_word_order = TRUE compared to the stored order:
-- --
-- Transport order: (g_user_size) -- Transport order: (g_user_size)
-- SST (Uh, Ul), 2 -- SST (Uh, Ul), 2
-- BST (Xh, Xl), (Yh, Yl), 2 keep parts order -- BST (Xh, Xl), (Yh, Yl), 2 keep X, Y parts order
-- XST (Ih, Il, Rh, Rl), 4 also reverse parts order -- XST (Rh, Rl), (Ih, Il), 2 keep Re, Im parts order
-- --
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
......
...@@ -533,7 +533,7 @@ BEGIN ...@@ -533,7 +533,7 @@ BEGIN
-- W: 0 1 2 3 4 5 ... 1948 1949 1950 1951 -- W: 0 1 2 3 4 5 ... 1948 1949 1950 1951
-- S: 0 1 2 ... 974 975 -- S: 0 1 2 ... 974 975
-- B = D: 0 1 ... 487 -- 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: -- P: Words values:
-- 0 0 1 2 3 4 5 ... 1948 1949 1950 1951 -- 0 0 1 2 3 4 5 ... 1948 1949 1950 1951
-- --
...@@ -564,7 +564,7 @@ BEGIN ...@@ -564,7 +564,7 @@ BEGIN
-- W: 0 1 2 3 4 5 ... 572 573 574 575 -- W: 0 1 2 3 4 5 ... 572 573 574 575
-- S: 0 1 2 ... 286 287 -- S: 0 1 2 ... 286 287
-- X = D: 0 1 ... 143 -- 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: -- P: J: K: Word values:
-- 0 0 0 0 1 2 3 4 5 ... 572 573 574 575 -- 0 0 0 0 1 2 3 4 5 ... 572 573 574 575
-- 1 1 576 ... -- 1 1 576 ...
...@@ -586,16 +586,16 @@ BEGIN ...@@ -586,16 +586,16 @@ BEGIN
D := S / c_nof_complex; -- range c_mm_nof_data = 144 Data values, because 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 -- c_mm_data_size / c_sdp_W_statistic_sz = 2 = c_nof_complex
X := D; -- range c_sdp_X_sq = 144 complex XST values 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 P := rx_packet_cnt; -- range c_mm_nof_packets
J := P MOD g_nof_crosslets; -- range g_nof_crosslets J := P MOD g_nof_crosslets; -- range g_nof_crosslets
K := P / g_nof_crosslets; -- range g_P_sq 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 IF g_reverse_word_order = FALSE THEN
v_exp_data := v_exp_data + I; v_exp_data := v_exp_data + I;
ELSE 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; END IF;
v_exp_data := v_exp_data + J * c_packet_size; -- c_packet_size = 576 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 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 register or to comment