##// END OF EJS Templates
(MINI-LFR) WFP_MS-0.1-52
pellion -
r518:fe7254c1482e JC
parent child
Show More
@@ -518,7 +518,7 BEGIN -- beh
518 518 pirq_ms => 6,
519 519 pirq_wfp => 14,
520 520 hindex => 2,
521 top_lfr_version => X"000133") -- aa.bb.cc version
521 top_lfr_version => X"000134") -- aa.bb.cc version
522 522 PORT MAP (
523 523 clk => clk_25,
524 524 rstn => LFR_rstn,
@@ -57,7 +57,9 PACKAGE BODY lpp_lfr_filter_coeff IS
57 57 VARIABLE config_vector : STD_LOGIC_VECTOR((CEL_NUMBER * 5 * COEFFICIENT_SIZE)-1 DOWNTO 0);
58 58 VARIABLE SOS_with_gain_array : COEFF_CEL_ARRAY_REAL(1 TO CEL_NUMBER);
59 59
60 VARIABLE SOS_with_gain_array_integer : COEFF_CEL_ARRAY_INTEGER(1 TO CEL_NUMBER);
60 VARIABLE SOS_with_gain_array_integer : COEFF_CEL_ARRAY_INTEGER(1 TO CEL_NUMBER);
61
62 CONSTANT REAL_NEG : REAL := -1.0;
61 63 BEGIN
62 64
63 65 all_cel: FOR I IN 1 TO CEL_NUMBER LOOP
@@ -70,20 +72,26 PACKAGE BODY lpp_lfr_filter_coeff IS
70 72 END LOOP all_cel;
71 73
72 74 all_cel_int: FOR I IN 1 TO CEL_NUMBER LOOP
73 all_param_int: FOR J IN 1 TO 6 LOOP
75 all_param_int: FOR J IN 1 TO 3 LOOP
74 76 SOS_with_gain_array_integer(I)(J) := INTEGER( SOS_with_gain_array(I)(J) * REAL(2**(POINT_POSITION)) );
75 77 END LOOP all_param_int;
76 END LOOP all_cel_int;
78
79 ---------------------------------------------------------------------------
80 -- INVERSION of A param due to fact that IIR_CEL module make only MULT and MAC operation
81 all_param_int_a: FOR J IN 4 TO 6 LOOP
82 SOS_with_gain_array_integer(I)(J) := INTEGER( SOS_with_gain_array(I)(J) * REAL(2**(POINT_POSITION)) * REAL_NEG );
83 END LOOP all_param_int_a;
84 ---------------------------------------------------------------------------
85 END LOOP all_cel_int;
77 86
87
78 88 all_cel_output: FOR I IN 1 TO CEL_NUMBER LOOP
79 89 all_param_b_out: FOR J IN 1 TO 3 LOOP
80 config_vector( (((I-1)*5)+3-J)*COEFFICIENT_SIZE + COEFFICIENT_SIZE -1 DOWNTO (((I-1)*5)+3-J)*COEFFICIENT_SIZE )
81 := std_logic_vector(TO_SIGNED(SOS_with_gain_array_integer(I)(J),COEFFICIENT_SIZE ));
90 config_vector( (((I-1)*5)+3-J)*COEFFICIENT_SIZE + COEFFICIENT_SIZE -1 DOWNTO (((I-1)*5)+3-J)*COEFFICIENT_SIZE ) := std_logic_vector(TO_SIGNED(SOS_with_gain_array_integer(I)(J),COEFFICIENT_SIZE ));
82 91 END LOOP all_param_b_out;
83 config_vector( (((I-1)*5)+3)*COEFFICIENT_SIZE + COEFFICIENT_SIZE -1 DOWNTO (((I-1)*5)+3)*COEFFICIENT_SIZE )
84 := std_logic_vector(TO_SIGNED(SOS_with_gain_array_integer(I)(6),COEFFICIENT_SIZE));
85 config_vector( (((I-1)*5)+4)*COEFFICIENT_SIZE + COEFFICIENT_SIZE -1 DOWNTO (((I-1)*5)+4)*COEFFICIENT_SIZE )
86 := std_logic_vector(TO_SIGNED(SOS_with_gain_array_integer(I)(5),COEFFICIENT_SIZE));
92
93 config_vector( (((I-1)*5)+3)*COEFFICIENT_SIZE + COEFFICIENT_SIZE -1 DOWNTO (((I-1)*5)+3)*COEFFICIENT_SIZE ) := std_logic_vector(TO_SIGNED(SOS_with_gain_array_integer(I)(6),COEFFICIENT_SIZE)); --a2
94 config_vector( (((I-1)*5)+4)*COEFFICIENT_SIZE + COEFFICIENT_SIZE -1 DOWNTO (((I-1)*5)+4)*COEFFICIENT_SIZE ) := std_logic_vector(TO_SIGNED(SOS_with_gain_array_integer(I)(5),COEFFICIENT_SIZE)); --a1
87 95 END LOOP all_cel_output;
88 96
89 97 RETURN config_vector;
General Comments 0
You need to be logged in to leave comments. Login now