Skip to content
Snippets Groups Projects
Commit b759cff9 authored by BRONES Romain's avatar BRONES Romain
Browse files

feat: Add a second LL corrector

*  Allows second order correction
parent afad2a14
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,10 @@ architecture struct of top_corr_matrix is ...@@ -58,6 +58,10 @@ architecture struct of top_corr_matrix is
signal matmult_seq : std_logic_vector(C_W_BPMSEQ-1 downto 0); signal matmult_seq : std_logic_vector(C_W_BPMSEQ-1 downto 0);
-- Corrector result, parallel -- Corrector result, parallel
signal corrfirst_valid : std_logic;
signal corrfirst_seq : std_logic_vector(C_W_BPMSEQ-1 downto 0);
signal corrfirst : signed_array(0 to C_N_MM_PSC-1)(C_W_COR-1 downto 0);
signal corrfirst_resize: signed_array(0 to C_N_MM_PSC-1)(C_W_MM-1 downto 0);
signal corrout_valid : std_logic; signal corrout_valid : std_logic;
signal corrout_seq : std_logic_vector(C_W_BPMSEQ-1 downto 0); signal corrout_seq : std_logic_vector(C_W_BPMSEQ-1 downto 0);
signal corrout : signed_array(0 to C_N_MM_PSC-1)(C_W_COR-1 downto 0); signal corrout : signed_array(0 to C_N_MM_PSC-1)(C_W_COR-1 downto 0);
...@@ -165,10 +169,39 @@ begin ...@@ -165,10 +169,39 @@ begin
matmult_seq => matmult_seq, matmult_seq => matmult_seq,
-- Corr coefs -- Corr coefs
coef_a => signed(mm_a2l.CORR_KA.data.data), coef_a => signed(mm_a2l.CORR_K1A.data.data),
coef_b => signed(mm_a2l.CORR_KB.data.data), coef_b => signed(mm_a2l.CORR_K1B.data.data),
coef_ic => signed(mm_a2l.CORR_KIC.data.data), coef_ic => signed(mm_a2l.CORR_K1IC.data.data),
coef_d => signed(mm_a2l.CORR_KD.data.data), coef_d => signed(mm_a2l.CORR_K1D.data.data),
reset_corr => mm_a2l.CONTROL.RST_CORR.data(0),
enable_corr => mm_a2l.CONTROL.ENABLE_CORR.data(0),
-- Corr output
corrout_valid => corrfirst_valid,
corrout_seq => corrfirst_seq,
corrout => corrfirst
);
gen_resize:for I in 0 to C_N_MM_PSC-1 generate
corrfirst_resize(I) <= resize(corrfirst(I), C_W_MM);
end generate;
inst_corr2: entity work.corr_ll
port map(
clk => clk,
rst_n => rst_n,
-- matmult input
matmult => corrfirst_resize,
matmult_valid => corrfirst_valid,
matmult_seq => corrfirst_seq,
-- Corr coefs
coef_a => signed(mm_a2l.CORR_K2A.data.data),
coef_b => signed(mm_a2l.CORR_K2B.data.data),
coef_ic => signed(mm_a2l.CORR_K2IC.data.data),
coef_d => signed(mm_a2l.CORR_K2D.data.data),
reset_corr => mm_a2l.CONTROL.RST_CORR.data(0), reset_corr => mm_a2l.CONTROL.RST_CORR.data(0),
enable_corr => mm_a2l.CONTROL.ENABLE_CORR.data(0), enable_corr => mm_a2l.CONTROL.ENABLE_CORR.data(0),
...@@ -179,6 +212,7 @@ begin ...@@ -179,6 +212,7 @@ begin
corrout => corrout corrout => corrout
); );
--------------------- ---------------------
-- DATA SERIALIZER -- -- DATA SERIALIZER --
--------------------- ---------------------
......
...@@ -36,22 +36,43 @@ addrmap corr_matrix { ...@@ -36,22 +36,43 @@ addrmap corr_matrix {
reg { reg {
desc="Correction coefficient A."; desc="Correction coefficient A.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF]; field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_KA; } CORR_K1A;
reg { reg {
desc="Correction coefficient B."; desc="Correction coefficient B.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF]; field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_KB; } CORR_K1B;
reg { reg {
desc="Correction coefficient (inverse) C."; desc="Correction coefficient (inverse) C.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF]; field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_KIC; } CORR_K1IC;
reg { reg {
desc="Correction coefficient D."; desc="Correction coefficient D.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF]; field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_KD; } CORR_K1D;
reg {
desc="Correction coefficient A.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_K2A;
reg {
desc="Correction coefficient B.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_K2B;
reg {
desc="Correction coefficient (inverse) C.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_K2IC;
reg {
desc="Correction coefficient D.";
field {sw = rw; hw = r;} data[`C_W_COR_COEF];
} CORR_K2D;
reg { reg {
desc="Number of ID to count for matrix multiplication."; desc="Number of ID to count for matrix multiplication.";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment