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

feat: Add a rate counter on matrix multiplication

* for debug purpose
parent b003e8c1
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,10 @@ entity matrix_mul is
pos_seq : in std_logic_vector(C_W_BPMSEQ-1 downto 0);
pos_tvalid : in std_logic;
-- status
mult_rate : out std_logic_vector(15 downto 0);
pps : in std_logic;
-- Data out
matmult : out signed_array(0 to C_N_MM_PSC-1)(C_W_MM-1 downto 0);
matmult_tvalid : out std_logic;
......@@ -60,9 +64,33 @@ architecture rtl of matrix_mul is
signal mul_done : std_logic;
signal r_mul_done : std_logic;
begin
signal mul_cnt : unsigned(15 downto 0);
signal r_mul_cnt : std_logic_vector(15 downto 0);
signal pps_r : std_logic;
begin
-----------------------
-- MULT RATE COUNTER --
-----------------------
p_mult_rate:process(clk, rst_n)
begin
if rst_n = '0' then
r_mul_cnt <= (others => '0');
mul_cnt <= (others => '0');
pps_r <= '0';
elsif rising_edge(clk) then
pps_r <= pps;
if pps = '1' and pps_r = '0' then
r_mul_cnt <= std_logic_vector(mul_cnt);
mul_cnt <= (others => '0');
else
if mul_done = '1' then
mul_cnt <= mul_cnt +1;
end if;
end if;
end if;
end process;
---------------------
-- DELAY REGISTERS --
......
......@@ -13,6 +13,8 @@ entity top_corr_matrix is
clk : in std_logic;
rst_n : in std_logic;
pps : in std_logic;
-- AXI-MM interface
s_axi_m2s : in t_corr_matrix_m2s;
s_axi_s2m : out t_corr_matrix_s2m;
......@@ -211,6 +213,9 @@ begin
pos_seq => errbpm_seq,
pos_tvalid => errbpm_tvalid,
pps => pps,
mult_rate => mm_l2a.MULT_RATE.data.data,
-- Data out
matmult => matmult,
matmult_tvalid => matmult_tvalid,
......
......@@ -157,6 +157,11 @@ addrmap corr_matrix {
field {sw = rw; hw = r;} data[`C_W_MM_IDCNT] = `C_N_MM_BPM;
} MM_ID_CNT;
reg {
desc="Number of matric multiplication per seconds.";
field { sw=r; hw=w; } data[16];
} MULT_RATE;
mem {
desc = "X Reference orbit.";
desyrdl_data_type="int32";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment