channel: hold values

parent efae20d4
...@@ -75,6 +75,7 @@ signal taps : std_logic_vector(4*g_CARRY4_COUNT-1 downto 0); ...@@ -75,6 +75,7 @@ signal taps : std_logic_vector(4*g_CARRY4_COUNT-1 downto 0);
signal polarity : std_logic; signal polarity : std_logic;
signal polarity_d1 : std_logic; signal polarity_d1 : std_logic;
signal polarity_d2 : std_logic; signal polarity_d2 : std_logic;
signal detect_d1 : std_logic;
signal raw : std_logic_vector(g_RAW_COUNT-1 downto 0); signal raw : std_logic_vector(g_RAW_COUNT-1 downto 0);
signal raw_d1 : std_logic_vector(g_RAW_COUNT-1 downto 0); signal raw_d1 : std_logic_vector(g_RAW_COUNT-1 downto 0);
signal raw_d2 : std_logic_vector(g_RAW_COUNT-1 downto 0); signal raw_d2 : std_logic_vector(g_RAW_COUNT-1 downto 0);
...@@ -144,6 +145,8 @@ begin ...@@ -144,6 +145,8 @@ begin
clk_o => ro_clk_o clk_o => ro_clk_o
); );
detect_d1 <= polarity_d1 xor polarity_d2;
process(clk_i) process(clk_i)
begin begin
if rising_edge(clk_i) then if rising_edge(clk_i) then
...@@ -154,11 +157,13 @@ begin ...@@ -154,11 +157,13 @@ begin
raw_d1 <= (others => '0'); raw_d1 <= (others => '0');
raw_d2 <= (others => '0'); raw_d2 <= (others => '0');
else else
detect_o <= polarity_d1 xor polarity_d2; detect_o <= detect_d1;
polarity_d1 <= polarity; polarity_d1 <= polarity;
polarity_d2 <= polarity_d1;
raw_d1 <= raw; raw_d1 <= raw;
raw_d2 <= raw_d1; if detect_d1 = '1' then
polarity_d2 <= polarity_d1;
raw_d2 <= raw_d1;
end if;
end if; end if;
end if; end if;
end process; end process;
...@@ -172,10 +177,12 @@ begin ...@@ -172,10 +177,12 @@ begin
if reset_i = '1' then if reset_i = '1' then
fp_o <= (others => '0'); fp_o <= (others => '0');
else else
fp_o <= std_logic_vector( if detect_d1 = '1' then
unsigned(coarse_i & (lut'range => '0')) fp_o <= std_logic_vector(
- unsigned(lut) unsigned(coarse_i & (lut'range => '0'))
+ unsigned(deskew_i)); - unsigned(lut)
+ unsigned(deskew_i));
end if;
end if; end if;
end if; end if;
end process; end process;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment