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

Register cnt_en to avoid combinational loop.

parent 58fd2ec1
No related branches found
No related tags found
1 merge request!292Use default 0 for nxt_info to avoid X to decimal conversion error in sim_io.py...
......@@ -113,15 +113,15 @@ ARCHITECTURE rtl OF dp_strobe_total_count IS
TYPE t_cnt_arr IS ARRAY (INTEGER RANGE <>) OF STD_LOGIC_VECTOR(g_count_w-1 DOWNTO 0);
-- Registers in dp_clk domain
SIGNAL ref_sync_reg : STD_LOGIC := '0';
SIGNAL in_strobe_reg_arr : STD_LOGIC_VECTOR(g_nof_counts-1 DOWNTO 0) := (OTHERS=>'0');
SIGNAL rd_reg : STD_LOGIC_VECTOR(c_mm_reg.nof_dat*c_mm_reg.dat_w-1 DOWNTO 0) := (OTHERS=>'0');
SIGNAL mm_cnt_clr : STD_LOGIC;
SIGNAL cnt_clr : STD_LOGIC;
SIGNAL cnt_en : STD_LOGIC := '0';
SIGNAL cnt_en_arr : STD_LOGIC_VECTOR(g_nof_counts-1 DOWNTO 0);
SIGNAL cnt_arr : t_cnt_arr(g_nof_counts-1 DOWNTO 0);
SIGNAL hold_cnt_arr : t_cnt_arr(g_nof_counts-1 DOWNTO 0) := (OTHERS=>(OTHERS=>'0'));
SIGNAL ref_sync_reg : STD_LOGIC := '0';
SIGNAL in_strobe_reg_arr : STD_LOGIC_VECTOR(g_nof_counts-1 DOWNTO 0) := (OTHERS=>'0');
SIGNAL rd_reg : STD_LOGIC_VECTOR(c_mm_reg.nof_dat*c_mm_reg.dat_w-1 DOWNTO 0) := (OTHERS=>'0');
SIGNAL mm_cnt_clr : STD_LOGIC;
SIGNAL cnt_clr : STD_LOGIC;
SIGNAL cnt_en : STD_LOGIC := '0';
SIGNAL cnt_en_arr : STD_LOGIC_VECTOR(g_nof_counts-1 DOWNTO 0);
SIGNAL cnt_arr : t_cnt_arr(g_nof_counts-1 DOWNTO 0);
SIGNAL hold_cnt_arr : t_cnt_arr(g_nof_counts-1 DOWNTO 0) := (OTHERS=>(OTHERS=>'0'));
BEGIN
......@@ -149,7 +149,18 @@ BEGIN
-- . clear strobe counters immediately at cnt_clr
-- . start strobe counters after ref_sync, e.g. to align strobe counters in different nodes in
-- case the input was (already) active during the cnt_clr
cnt_en <= '0' WHEN cnt_clr = '1' ELSE '1' WHEN ref_sync_reg = '1' ELSE cnt_en;
p_cnt_en : PROCESS(dp_rst, dp_clk)
BEGIN
IF dp_rst = '1' THEN
cnt_en <= '0';
ELSIF rising_edge(dp_clk) THEN
IF cnt_clr = '1' THEN
cnt_en <= '0';
ELSIF ref_sync = '1' THEN -- use ref_sync have cnt_en aligned with ref_sync_reg
cnt_en <= '1';
END IF;
END IF;
END PROCESS;
-- strobe counters
gen_counters : FOR I IN 0 TO g_nof_counts-1 GENERATE
......
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