OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [processor/] [VHDL/] [common/] [synchronizer/] [sync_beh.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 jlechner
-----------------------------------------------------------------------
2
-- This file is part of SCARTS.
3
-- 
4
-- SCARTS is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
-- 
9
-- SCARTS is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
-- 
14
-- You should have received a copy of the GNU General Public License
15
-- along with SCARTS.  If not, see <http://www.gnu.org/licenses/>.
16
-----------------------------------------------------------------------
17
 
18
 
19
library ieee;
20
use ieee.std_logic_1164.all;
21
 
22
architecture beh of sync is
23
  signal sync : std_logic_vector(1 to SYNC_STAGES);
24
begin
25
  process(sys_clk, sys_res_n)
26
  begin
27
    if sys_res_n = '0' then
28
      sync <= (others => RESET_VALUE);
29
    elsif rising_edge(sys_clk) then
30
      sync(1) <= data_in;
31
      for i in 2 to SYNC_STAGES loop
32
        sync(i) <= sync(i - 1);
33
      end loop;
34
    end if;
35
  end process;
36
  data_out <= sync(SYNC_STAGES);
37
end architecture beh;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.