Commit 2f78019e authored by Tristan Gingold's avatar Tristan Gingold

sys: change patterns, also resync serdes

parent 46a5100e
...@@ -27,6 +27,7 @@ architecture arch of diot_sys_patterns is ...@@ -27,6 +27,7 @@ architecture arch of diot_sys_patterns is
begin begin
process (clk_100m_i) process (clk_100m_i)
variable patcnt : unsigned (11 downto 0); variable patcnt : unsigned (11 downto 0);
variable sl : unsigned(3 downto 0);
begin begin
if rising_edge(clk_100m_i) then if rising_edge(clk_100m_i) then
if rst_100m_n_i = '0' then if rst_100m_n_i = '0' then
...@@ -37,12 +38,13 @@ begin ...@@ -37,12 +38,13 @@ begin
end if; end if;
for i in samples_o'range loop for i in samples_o'range loop
for j in 0 to 7 loop for j in 0 to 7 loop
samples_o (i)(j) <= std_logic_vector sl := to_unsigned(j + 1, 4);
(patcnt (7 downto 0) & to_unsigned (j + i*8, 4)); samples_o (i)(j) <= std_logic_vector (sl & sl & sl);
-- (patcnt (7 downto 0) & to_unsigned (j + i*8, 4));
end loop; end loop;
samples_o (i)(7) <= std_logic_vector (patcnt); -- samples_o (i)(7) <= std_logic_vector (patcnt);
samples_o (i)(6) <= -- samples_o (i)(6) <=
std_logic_vector (to_unsigned (6 + i*8, 8) & "0000"); -- std_logic_vector (to_unsigned (6 + i*8, 8) & "0000");
end loop; end loop;
end if; end if;
end if; end if;
......
...@@ -130,6 +130,7 @@ begin ...@@ -130,6 +130,7 @@ begin
dat_o => samples (i), dat_o => samples (i),
locking_i => lock, locking_i => lock,
locked_o => locked (i), locked_o => locked (i),
resync_i => resync_i,
freeze_delays_i => freeze_delays_i, freeze_delays_i => freeze_delays_i,
stat_sel_ch_i => stat_sel_ch_i, stat_sel_ch_i => stat_sel_ch_i,
stat_sel_dl_i => stat_sel_dl_i, stat_sel_dl_i => stat_sel_dl_i,
......
...@@ -27,6 +27,9 @@ entity sys_fsi_rx is ...@@ -27,6 +27,9 @@ entity sys_fsi_rx is
-- Locking status -- Locking status
locked_o : out std_logic; locked_o : out std_logic;
-- Resync serdes
resync_i : std_logic;
-- Do not change delays when set. -- Do not change delays when set.
freeze_delays_i : std_logic; freeze_delays_i : std_logic;
...@@ -315,7 +318,7 @@ begin ...@@ -315,7 +318,7 @@ begin
process (clk_100m_i) is process (clk_100m_i) is
begin begin
if rising_edge(clk_100m_i) then if rising_edge(clk_100m_i) then
if rst_n_i = '0' then if rst_n_i = '0' or resync_i = '1' then
cntvalue <= to_unsigned(250, 9); cntvalue <= to_unsigned(250, 9);
dly <= (others => '1'); dly <= (others => '1');
load <= '0'; load <= '0';
...@@ -412,7 +415,7 @@ begin ...@@ -412,7 +415,7 @@ begin
process (clk_100m_i) is process (clk_100m_i) is
begin begin
if rising_edge(clk_100m_i) then if rising_edge(clk_100m_i) then
if rst_n_i = '0' then if rst_n_i = '0' or resync_i = '1' then
locked (i) <= '0'; locked (i) <= '0';
lock_cnt <= 0; lock_cnt <= 0;
bitslip_cnt <= (others => '0'); bitslip_cnt <= (others => '0');
......
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