w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
cdc_vector_s0.vhd
Go to the documentation of this file.
1-- $Id: cdc_vector_s0.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2016-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: cdc_vector_s0 - syn
7-- Description: clock domain crossing for a vector, 1 stage
8--
9-- Dependencies: -
10-- Test bench: -
11-- Target Devices: generic
12-- Tool versions: viv 2015.4-2017.2; ghdl 0.33-0.34
13-- Revision History:
14-- Date Rev Version Comment
15-- 2019-01-02 1101 1.1 add ENA port
16-- 2016-04-08 459 1.0 Initial version
17--
18------------------------------------------------------------------------------
19
20library ieee;
21use ieee.std_logic_1164.all;
22
23use work.slvtypes.all;
24
25entity cdc_vector_s0 is -- cdc for vector (1 stage)
26 generic (
27 DWIDTH : positive := 16); -- data port width
28 port (
29 CLKO : in slbit; -- O|output clock
30 ENA : in slbit := '1'; -- O|capture enable
31 DI : in slv(DWIDTH-1 downto 0); -- I|input data
32 DO : out slv(DWIDTH-1 downto 0) -- O|output data
33 );
34end entity cdc_vector_s0;
35
36
37architecture syn of cdc_vector_s0 is
38
39 subtype d_range is integer range DWIDTH-1 downto 0;
40
41 signal R_DO_S0 : slv(d_range) := (others=>'0');
42
43 attribute ASYNC_REG: string;
44
45 attribute ASYNC_REG of R_DO_S0 : signal is "true";
46
47begin
48
49 proc_regs: process (CLKO)
50 begin
51 if rising_edge(CLKO) then
52 if ENA = '1' then
53 R_DO_S0 <= DI; -- synch 0: CLKI->CLKO
54 end if;
55 end if;
56 end process proc_regs;
57
58 DO <= R_DO_S0;
59
60end syn;
61
slv( d_range ) :=( others => '0') R_DO_S0
integer range DWIDTH- 1 downto 0 d_range
out DO slv( DWIDTH- 1 downto 0)
in CLKO slbit
in DI slv( DWIDTH- 1 downto 0)
in ENA slbit := '1'
DWIDTH positive := 16
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector slv
Definition: slvtypes.vhd:31