w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
cdc_value.vhd
Go to the documentation of this file.
1-- $Id: cdc_value.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_value - syn
7-- Description: clock domain crossing for a slowly changing value
8--
9-- Dependencies: cdc_pulse
10-- cdc_vector_s0
11-- Test bench: -
12-- Target Devices: generic
13-- Tool versions: viv 2017.2; ghdl 0.34
14-- Revision History:
15-- Date Rev Version Comment
16-- 2019-01-02 1101 2.0 reinplement using cdc_pulse and cdc_vector_s0
17-- 2016-04-08 459 1.0 Initial version
18--
19------------------------------------------------------------------------------
20
21library ieee;
22use ieee.std_logic_1164.all;
23
24use work.slvtypes.all;
25use work.cdclib.all;
26
27entity cdc_value is -- cdc for value (slow change)
28 generic (
29 DWIDTH : positive := 16); -- data port width
30 port (
31 CLKI : in slbit; -- I|input clock
32 CLKO : in slbit; -- O|output clock
33 DI : in slv(DWIDTH-1 downto 0); -- I|input data
34 DO : out slv(DWIDTH-1 downto 0); -- O|output data
35 UPDT : out slbit -- O|output data updated
36 );
37end entity cdc_value;
38
39
40architecture syn of cdc_value is
41
42 subtype d_range is integer range DWIDTH-1 downto 0;
43
44 signal R_DI : slv(d_range) := (others=>'0');
45 signal R_UPDT : slbit := '0';
46
47 signal PULSE_PIN : slbit := '0';
48 signal PULSE_BUSY : slbit := '0';
49 signal PULSE_POUT : slbit := '0';
50
51begin
52
53 CDC_ENA: cdc_pulse
54 generic map (
55 POUT_SINGLE => true,
56 BUSY_WACK => true)
57 port map (
58 CLKM => CLKI,
59 RESET => '0',
60 CLKS => CLKO,
61 PIN => PULSE_PIN,
64 );
65
66 CDC_DOUT : cdc_vector_s0
67 generic map (
68 DWIDTH => DWIDTH)
69 port map (
70 CLKO => CLKO,
71 ENA => PULSE_POUT,
72 DI => R_DI,
73 DO => DO
74 );
75
76 PULSE_PIN <= not PULSE_BUSY;
77
78 proc_clki: process (CLKI)
79 begin
80 if rising_edge(CLKI) then
81 if PULSE_PIN = '1' then
82 R_DI <= DI;
83 end if;
84 end if;
85 end process proc_clki;
86
87 proc_clko: process (CLKO)
88 begin
89 if rising_edge(CLKO) then
91 end if;
92 end process proc_clko;
93
94 UPDT <= R_UPDT;
95
96end syn;
in CLKM slbit
Definition: cdc_pulse.vhd:32
out BUSY slbit
Definition: cdc_pulse.vhd:36
out POUT slbit
Definition: cdc_pulse.vhd:38
in CLKS slbit
Definition: cdc_pulse.vhd:34
in PIN slbit
Definition: cdc_pulse.vhd:35
BUSY_WACK boolean := false
Definition: cdc_pulse.vhd:29
in RESET slbit := '0'
Definition: cdc_pulse.vhd:33
POUT_SINGLE boolean := false
Definition: cdc_pulse.vhd:28
slv( d_range ) :=( others => '0') R_DI
Definition: cdc_value.vhd:44
slbit := '0' PULSE_PIN
Definition: cdc_value.vhd:47
slbit := '0' R_UPDT
Definition: cdc_value.vhd:45
slbit := '0' PULSE_BUSY
Definition: cdc_value.vhd:48
slbit := '0' PULSE_POUT
Definition: cdc_value.vhd:49
integer range DWIDTH- 1 downto 0 d_range
Definition: cdc_value.vhd:42
out DO slv( DWIDTH- 1 downto 0)
Definition: cdc_value.vhd:34
in CLKO slbit
Definition: cdc_value.vhd:32
in DI slv( DWIDTH- 1 downto 0)
Definition: cdc_value.vhd:33
in CLKI slbit
Definition: cdc_value.vhd:31
out UPDT slbit
Definition: cdc_value.vhd:36
DWIDTH positive := 16
Definition: cdc_value.vhd:29
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