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

Subversion Repositories pcie_sg_dma

[/] [pcie_sg_dma/] [branches/] [Virtex6/] [ML605_ISE13.3/] [MySource/] [DDR_Blinker.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 barabba
----------------------------------------------------------------------------------
2
-- Company:  ZITI
3
-- Engineer:  wgao
4
-- 
5
-- Create Date:    16:38:03 06 Oct 2008 
6
-- Design Name: 
7
-- Module Name:    DDR_Blink - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use IEEE.STD_LOGIC_ARITH.ALL;
23
use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
 
25
library work;
26
use work.abb64Package.all;
27
 
28
---- Uncomment the following library declaration if instantiating
29
---- any Xilinx primitives in this code.
30
--library UNISIM;
31
--use UNISIM.VComponents.all;
32
 
33
entity DDR_Blink is
34
    Port (
35
           DDR_blinker              : OUT   std_logic;
36
 
37
           DDR_Write                : IN    std_logic;
38
           DDR_Read                 : IN    std_logic;
39
           DDR_Both                 : IN    std_logic;
40
 
41
           ddr_Clock                : IN    std_logic;
42
           DDr_Rst_n                : IN    std_logic
43
          );
44
end entity DDR_Blink;
45
 
46
 
47
architecture Behavioral of DDR_Blink is
48
 
49
 
50
  -- Blinking -_-_-_-_
51
  Constant  C_BLINKER_MSB       : integer      :=   15;  -- 4;  -- 15;
52
  Constant  CBIT_SLOW_BLINKER   : integer      :=   11;  -- 2;  -- 11;
53
 
54
  signal  DDR_blinker_i         :  std_logic;
55
  signal  Fast_blinker          :  std_logic_vector(C_BLINKER_MSB downto 0);
56
  signal  Fast_blinker_MSB_r1   :  std_logic;
57
  signal  Blink_Pulse           :  std_logic;
58
  signal  Slow_blinker          :  std_logic_vector(CBIT_SLOW_BLINKER downto 0);
59
 
60
  signal  DDR_write_extension    :  std_logic;
61
  signal  DDR_write_extension_Cnt:  std_logic_vector(1 downto 0);
62
  signal  DDR_read_extension     :  std_logic;
63
  signal  DDR_read_extension_Cnt :  std_logic_vector(1 downto 0);
64
 
65
 
66
begin
67
 
68
 
69
   -- 
70
   Syn_DDR_Fast_blinker:
71
   process ( ddr_Clock, DDr_Rst_n)
72
   begin
73
      if DDr_Rst_n = '0' then
74
         Fast_blinker        <= (OTHERS=>'0');
75
         Fast_blinker_MSB_r1 <= '0';
76
         Blink_Pulse         <= '0';
77
 
78
         Slow_blinker        <= (OTHERS=>'0');
79
 
80
      elsif ddr_Clock'event and ddr_Clock = '1' then
81
         Fast_blinker        <= Fast_blinker + '1';
82
         Fast_blinker_MSB_r1 <= Fast_blinker(C_BLINKER_MSB);
83
         Blink_Pulse         <= Fast_blinker(C_BLINKER_MSB) and not Fast_blinker_MSB_r1;
84
 
85
         Slow_blinker        <= Slow_blinker + Blink_Pulse;
86
 
87
      end if;
88
   end process;
89
 
90
 
91
   -- 
92
   Syn_DDR_Write_Extenstion:
93
   process ( ddr_Clock, DDr_Rst_n)
94
   begin
95
      if DDr_Rst_n = '0' then
96
         DDR_write_extension_Cnt <= (OTHERS=>'0');
97
         DDR_write_extension     <= '0';
98
 
99
      elsif ddr_Clock'event and ddr_Clock = '1' then
100
 
101
         case DDR_write_extension_Cnt is
102
 
103
           when "00"   =>
104
             if DDR_Write='1' then
105
                DDR_write_extension_Cnt <= "01";
106
                DDR_write_extension     <= '1';
107
             else
108
                DDR_write_extension_Cnt <= DDR_write_extension_Cnt;
109
                DDR_write_extension     <= DDR_write_extension;
110
             end if;
111
 
112
           when "01"   =>
113
             if Slow_blinker(CBIT_SLOW_BLINKER)='1' then
114
                DDR_write_extension_Cnt <= "11";
115
                DDR_write_extension     <= '1';
116
             else
117
                DDR_write_extension_Cnt <= DDR_write_extension_Cnt;
118
                DDR_write_extension     <= DDR_write_extension;
119
             end if;
120
 
121
           when "11"   =>
122
             if Slow_blinker(CBIT_SLOW_BLINKER)='0' then
123
                DDR_write_extension_Cnt <= "10";
124
                DDR_write_extension     <= '1';
125
             else
126
                DDR_write_extension_Cnt <= DDR_write_extension_Cnt;
127
                DDR_write_extension     <= DDR_write_extension;
128
             end if;
129
 
130
           when Others          =>
131
             if Slow_blinker(CBIT_SLOW_BLINKER)='1' then
132
                DDR_write_extension_Cnt <= "00";
133
                DDR_write_extension     <= '0';
134
             else
135
                DDR_write_extension_Cnt <= DDR_write_extension_Cnt;
136
                DDR_write_extension     <= DDR_write_extension;
137
             end if;
138
 
139
         end case;
140
 
141
      end if;
142
   end process;
143
 
144
 
145
   -- 
146
   Syn_DDR_Read_Extenstion:
147
   process ( ddr_Clock, DDr_Rst_n)
148
   begin
149
      if DDr_Rst_n = '0' then
150
         DDR_read_extension_Cnt <= (OTHERS=>'0');
151
         DDR_read_extension     <= '1';
152
 
153
      elsif ddr_Clock'event and ddr_Clock = '1' then
154
 
155
         case DDR_read_extension_Cnt is
156
 
157
           when "00"   =>
158
             if DDR_Read='1' then
159
                DDR_read_extension_Cnt <= "01";
160
                DDR_read_extension     <= '0';
161
             else
162
                DDR_read_extension_Cnt <= DDR_read_extension_Cnt;
163
                DDR_read_extension     <= DDR_read_extension;
164
             end if;
165
 
166
           when "01"   =>
167
             if Slow_blinker(CBIT_SLOW_BLINKER)='1' then
168
                DDR_read_extension_Cnt <= "11";
169
                DDR_read_extension     <= '0';
170
             else
171
                DDR_read_extension_Cnt <= DDR_read_extension_Cnt;
172
                DDR_read_extension     <= DDR_read_extension;
173
             end if;
174
 
175
           when "11"   =>
176
             if Slow_blinker(CBIT_SLOW_BLINKER)='0' then
177
                DDR_read_extension_Cnt <= "10";
178
                DDR_read_extension     <= '0';
179
             else
180
                DDR_read_extension_Cnt <= DDR_read_extension_Cnt;
181
                DDR_read_extension     <= DDR_read_extension;
182
             end if;
183
 
184
           when Others          =>
185
             if Slow_blinker(CBIT_SLOW_BLINKER)='1' then
186
                DDR_read_extension_Cnt <= "00";
187
                DDR_read_extension     <= '1';
188
             else
189
                DDR_read_extension_Cnt <= DDR_read_extension_Cnt;
190
                DDR_read_extension     <= DDR_read_extension;
191
             end if;
192
 
193
         end case;
194
 
195
      end if;
196
   end process;
197
 
198
 
199
   -- 
200
   Syn_DDR_Working_blinker:
201
   process ( ddr_Clock, DDr_Rst_n)
202
   begin
203
      if DDr_Rst_n = '0' then
204
         DDR_Blinker_i      <= '0';
205
 
206
      elsif ddr_Clock'event and ddr_Clock = '1' then
207
 
208
         DDR_Blinker_i      <= (Slow_blinker(CBIT_SLOW_BLINKER-2) or DDR_write_extension) and DDR_read_extension;
209
--         DDR_Blinker_i      <= Slow_blinker(CBIT_SLOW_BLINKER-2);
210
 
211
      end if;
212
   end process;
213
 
214
   DDR_blinker    <=  DDR_blinker_i;
215
 
216
end architecture Behavioral;

powered by: WebSVN 2.1.0

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