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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [rtl/] [vlib/] [cdclib/] [cdc_signal_s1.vhd] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 36 wfjm
-- $Id: cdc_signal_s1.vhd 774 2016-06-12 17:08:47Z mueller $
2
--
3
-- Copyright 2016- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
-- 
14
------------------------------------------------------------------------------
15
-- Module Name:    cdc_signal_s1 - syn
16
-- Description:    clock domain crossing for a signal, 2 stage
17
--
18
-- Dependencies:   -
19
-- Test bench:     -
20
-- Target Devices: generic
21
-- Tool versions:  viv 2015.4-2016.2; ghdl 0.33
22
-- Revision History: 
23
-- Date         Rev Version    Comment
24
-- 2016-06-11   774   1.1      add INIT generic
25
-- 2016-04-08   459   1.0      Initial version
26
-- 
27
------------------------------------------------------------------------------
28
 
29
library ieee;
30
use ieee.std_logic_1164.all;
31
 
32
use work.slvtypes.all;
33
 
34
entity cdc_signal_s1 is                  -- cdc for signal (2 stage)
35
  generic (
36
    INIT : slbit := '0');               -- initial state
37
  port (
38
    CLKO : in slbit;                     -- O|output clock
39
    DI   : in slbit;                     -- I|input data
40
    DO   : out slbit                     -- O|output data
41
  );
42
end entity cdc_signal_s1;
43
 
44
 
45
architecture syn of cdc_signal_s1 is
46
 
47
  signal R_DO_S0 : slbit := INIT;
48
  signal R_DO_S1 : slbit := INIT;
49
 
50
  attribute ASYNC_REG: string;
51
 
52
  attribute ASYNC_REG of R_DO_S0   : signal is "true";
53
  attribute ASYNC_REG of R_DO_S1   : signal is "true";
54
 
55
begin
56
 
57
  proc_regs: process (CLKO)
58
  begin
59
    if rising_edge(CLKO) then
60
      R_DO_S0 <= DI;                -- synch 0: CLKI->CLKO
61
      R_DO_S1 <= R_DO_S0;           -- synch 1: CLKO
62
    end if;
63
  end process proc_regs;
64
 
65
  DO <= R_DO_S1;
66
 
67
end syn;

powered by: WebSVN 2.1.0

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