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

Subversion Repositories pulse_processing_algorithm

[/] [pulse_processing_algorithm/] [ddr2_data_path.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 panda_emc
--******************************************************************************
2
--
3
--  Xilinx, Inc. 2002                 www.xilinx.com
4
--
5
--
6
--*******************************************************************************
7
--
8
--  File name :       ddr2_data_path.vhd
9
--
10
--  Description :     This module comprises the write and read data paths for the
11
--                    DDR1 memory interface. The write data along with write enable 
12
--                    signals are forwarded to the DDR IOB FFs. The read data is 
13
--                    captured in CLB FFs and finally input to FIFOs.
14
-- 
15
--                    
16
--  Date - revision : 10/16/2003
17
--
18
--
19
--
20
--*****************************************************************************
21
 
22
library ieee;
23
use ieee.std_logic_1164.all;
24
use ieee.std_logic_unsigned.all;
25
--library synplify; 
26
--use synplify.attributes.all;
27
--
28
-- pragma translate_off
29
library UNISIM;
30
use UNISIM.VCOMPONENTS.ALL;
31
-- pragma translate_on
32
--
33
entity ddr2_data_path is
34
port(
35
     user_input_data    : in std_logic_vector(31 downto 0);
36
     clk                : in std_logic;
37
     clk180             : IN std_logic;
38
     clk90              : in std_logic;
39
     reset              : in std_logic;
40
     reset90            : in std_logic;
41
     reset180           : in std_logic;
42
     reset270           : in std_logic;
43
     write_enable       : in std_logic;
44
     rst_dqs_div_in     : in std_logic;
45
     delay_sel          : in std_logic_vector(4 downto 0);
46
     dqs_int_delay_in0  : in std_logic;
47
     dqs_int_delay_in1  : in std_logic;
48
--     dq_in              : in std_logic_vector(15 downto 0);       
49
     dq_in_rising              : in std_logic_vector(15 downto 0);
50
     dq_in_falling              : in std_logic_vector(15 downto 0);
51
     u_data_val         : out std_logic;
52
     user_output_data   : out std_logic_vector(31 downto 0);
53
     write_en_val       : out std_logic;
54
     write_en_val1      : out std_logic;
55
     reset90_r_val      : out std_logic;
56
     data_mask_f        : out std_logic_vector(1 downto 0);
57
     data_mask_r        : out std_logic_vector(1 downto 0);
58
     write_data_falling : out std_logic_vector(15 downto 0);
59
     write_data_rising  : out std_logic_vector(15 downto 0);
60
     test_fifo_wr_addr: out std_logic_vector(15 downto 0)
61
     );
62
end ddr2_data_path;
63
 
64
 
65
 
66
 
67
architecture arc_ddr2_data_path of ddr2_data_path is
68
 
69
component data_read
70
port(
71
     clk90              : in std_logic;
72
     reset90_r          : in std_logic;
73
 
74
--old     ddr_dq_in          : in std_logic_vector(15 downto 0);   
75
     ddr_dq_in_rising   : in std_logic_vector(15 downto 0);
76
     ddr_dq_in_falling  : in std_logic_vector(15 downto 0);
77
     read_valid_data_1  : in std_logic;
78
 
79
     fifo_00_wr_en       : in std_logic;
80
     fifo_10_wr_en       : in std_logic;
81
 
82
     fifo_01_wr_en       : in std_logic;
83
     fifo_11_wr_en       : in std_logic;
84
 
85
     fifo_00_wr_addr    : in std_logic_vector(3 downto 0);
86
     fifo_01_wr_addr    : in std_logic_vector(3 downto 0);
87
     fifo_10_wr_addr    : in std_logic_vector(3 downto 0);
88
     fifo_11_wr_addr    : in std_logic_vector(3 downto 0);
89
 
90
--      dqs0_delayed_col1  : in std_logic;
91
--      dqs1_delayed_col1  : in std_logic;
92
        dqs0_delayed_col0  : in std_logic;
93
        dqs1_delayed_col0  : in std_logic;
94
 
95
        user_output_data   : out std_logic_vector(31 downto 0);
96
        fifo0_rd_addr_val: out std_logic_vector(3 downto 0);
97
     fifo1_rd_addr_val: out std_logic_vector(3 downto 0)
98
     );
99
end component;
100
 
101
 
102
 
103
 
104
component data_read_controller
105
port(
106
 
107
     clk90              : in std_logic;
108
     clk180              : in std_logic;
109
     reset_r            : in std_logic;
110
     reset90_r          : in std_logic;
111
     rst_dqs_div_in     : in std_logic;
112
     delay_sel          : in std_logic_vector(4 downto 0);
113
     dqs_int_delay_in0  : in std_logic;
114
     dqs_int_delay_in1  : in std_logic;
115
 
116
     fifo0_rd_addr      : in std_logic_vector(3 downto 0);
117
     fifo1_rd_addr      : in std_logic_vector(3 downto 0);
118
     u_data_val         : out std_logic;
119
     read_valid_data_1_val  : out std_logic;
120
 
121
     fifo_00_wr_en_val  : out std_logic;
122
     fifo_10_wr_en_val                  : out std_logic;
123
     fifo_01_wr_en_val                  : out std_logic;
124
     fifo_11_wr_en_val                  : out std_logic;
125
 
126
     fifo_00_wr_addr_val    : out std_logic_vector(3 downto 0);
127
     fifo_01_wr_addr_val    : out std_logic_vector(3 downto 0);
128
     fifo_10_wr_addr_val    : out std_logic_vector(3 downto 0);
129
     fifo_11_wr_addr_val    : out std_logic_vector(3 downto 0);
130
 
131
        dqs0_delayed_col0_val  : out std_logic;
132
        dqs1_delayed_col0_val  : out std_logic
133
 
134
--      dqs0_delayed_col1_val  : out std_logic;
135
--      dqs1_delayed_col1_val  : out std_logic
136
 
137
      );
138
 
139
end component;
140
 
141
 
142
 
143
component data_write
144
port(
145
     user_input_data    : in std_logic_vector(31 downto 0);
146
     clk90              : in std_logic;
147
     reset90_r          : in std_logic;
148
     reset270_r         : in std_logic;
149
     write_enable       : in std_logic;
150
     write_en_val       : out std_logic;
151
     write_en_val1      : out std_logic;
152
     write_data_falling : out std_logic_vector(15 downto 0);
153
     write_data_rising  : out std_logic_vector(15 downto 0);
154
     data_mask_f        : out std_logic_vector(1 downto 0);
155
     data_mask_r        : out std_logic_vector(1 downto 0)
156
     );
157
end component;
158
 
159
component data_path_rst
160
port(
161
     clk                : in std_logic;
162
     clk180             : in std_logic;
163
     clk90              : in std_logic;
164
     reset              : in std_logic;
165
     reset90            : in std_logic;
166
     reset180           : in std_logic;
167
     reset270           : in std_logic;
168
     reset_r            : out std_logic;
169
     reset90_r          : out std_logic;
170
     reset90_r1         : out std_logic;
171
     reset180_r         : out std_logic;
172
     reset270_r         : out std_logic
173
    );
174
end component;
175
 
176
signal reset_r          : std_logic;
177
signal reset90_r        : std_logic;
178
signal reset90_r1       : std_logic;
179
signal reset180_r       : std_logic;
180
signal reset270_r       : std_logic;
181
 
182
 
183
 signal fifo0_rd_addr    : std_logic_vector(3 downto 0);
184
 signal fifo1_rd_addr    : std_logic_vector(3 downto 0);
185
 signal read_valid_data_1  : std_logic;
186
 
187
 signal fifo_00_wr_addr    : std_logic_vector(3 downto 0);
188
 signal fifo_01_wr_addr    : std_logic_vector(3 downto 0);
189
 signal fifo_10_wr_addr    : std_logic_vector(3 downto 0);
190
 signal fifo_11_wr_addr    : std_logic_vector(3 downto 0);
191
 
192
 
193
 
194
 signal fifo_00_wr_en                   :  std_logic;
195
 signal fifo_10_wr_en                   :  std_logic;
196
 
197
 
198
 
199
 signal fifo_01_wr_en                   :  std_logic;
200
 signal fifo_11_wr_en                   :  std_logic;
201
 
202
-- signal dqs0_delayed_col1  :  std_logic;
203
-- signal dqs1_delayed_col1  :  std_logic;
204
 
205
 signal dqs0_delayed_col0  :  std_logic;
206
 signal dqs1_delayed_col0  :  std_logic;
207
 
208
 
209
 
210
 
211
 
212
 
213
   Function to_std_logic(X: in Boolean) return Std_Logic is
214
   variable ret : std_logic;
215
   begin
216
   if x then ret := '1';  else ret := '0'; end if;
217
   return ret;
218
   end to_std_logic;
219
 
220
attribute syn_keep : boolean;  -- Using Syn_Keep Derictive
221
 
222
--signal tclk180_fifo_01_wr_en: std_logic;
223
--signal tclk180_fifo_01_wr_en_delay1: std_logic;
224
--signal tclk180_fifo_01_wr_en_delay2: std_logic;
225
--signal tclk180_fifo_01_wr_en_delay3: std_logic;
226
--signal tclk180_fifo_01_wr_en_delay4: std_logic;
227
--signal tclk180_fifo_01_wr_en_delay5: std_logic;
228
--signal tclk180_fifo_01_wr_en_delay6: std_logic;
229
--signal tclk180_fifo_01_wr_en_delay7: std_logic;
230
--signal tclk180_fifo_01_wr_en_delay8: std_logic;
231
--signal tclk180_fifo_01_wr_en_delay9: std_logic;
232
--signal tclk180_fifo_01_wr_en_end_pulse: std_logic;
233
--signal tclk180_fifo_01_00_neq_flag: std_logic;
234
 
235
--signal tclk180_fifo_11_wr_en: std_logic;
236
--signal tclk180_fifo_11_wr_en_delay1: std_logic;
237
--signal tclk180_fifo_11_wr_en_delay2: std_logic;
238
--signal tclk180_fifo_11_wr_en_delay3: std_logic;
239
--signal tclk180_fifo_11_wr_en_delay4: std_logic;
240
--signal tclk180_fifo_11_wr_en_delay5: std_logic;
241
--signal tclk180_fifo_11_wr_en_delay6: std_logic;
242
--signal tclk180_fifo_11_wr_en_delay7: std_logic;
243
--signal tclk180_fifo_11_wr_en_delay8: std_logic;
244
--signal tclk180_fifo_11_wr_en_delay9: std_logic;
245
--signal tclk180_fifo_11_wr_en_end_pulse: std_logic;
246
--PL: om een warning te lozen
247
--signal tclk180_fifo_11_10_neq_flag: std_logic;
248
 
249
--attribute syn_keep of tclk180_fifo_01_wr_en_end_pulse : signal is true;
250
--attribute syn_keep of tclk180_fifo_01_00_neq_flag : signal is true;
251
 
252
 
253
--PL: om een warning te lozen
254
--attribute syn_keep of tclk180_fifo_11_wr_en_end_pulse : signal is true;
255
--PL: om een warning te lozen
256
--attribute syn_keep of tclk180_fifo_11_10_neq_flag : signal is true;
257
 
258
 begin
259
 
260
 
261
-- test
262
--PL alles commentaar want dit zijn 2 schuifregisters naar nergens
263
 
264
test_fifo_logic: process(clk180)
265
        begin
266
--                      if rising_edge (clk180) then 
267
--                      tclk180_fifo_01_wr_en            <= fifo_01_wr_en ;
268
--                      tclk180_fifo_01_wr_en_delay1     <= tclk180_fifo_01_wr_en ;
269
--                      tclk180_fifo_01_wr_en_delay2     <= tclk180_fifo_01_wr_en_delay1 ;
270
--                      tclk180_fifo_01_wr_en_delay3     <= tclk180_fifo_01_wr_en_delay2 ;
271
--                      tclk180_fifo_01_wr_en_delay4     <= tclk180_fifo_01_wr_en_delay3 ;
272
--                      tclk180_fifo_01_wr_en_delay5     <= tclk180_fifo_01_wr_en_delay4 ;
273
--                      tclk180_fifo_01_wr_en_delay6     <= tclk180_fifo_01_wr_en_delay5 ;
274
--                      tclk180_fifo_01_wr_en_delay7     <= tclk180_fifo_01_wr_en_delay6 ;
275
--                      tclk180_fifo_01_wr_en_delay8     <= tclk180_fifo_01_wr_en_delay7 ;
276
--                      tclk180_fifo_01_wr_en_delay9     <= tclk180_fifo_01_wr_en_delay8 ;
277
--                      tclk180_fifo_01_wr_en_end_pulse  <= tclk180_fifo_01_wr_en_delay9 and not tclk180_fifo_01_wr_en_delay8;
278
--              end if;
279
 
280
--PL: om een warning te lozen
281
--      if rising_edge (clk180) then 
282
--              tclk180_fifo_01_00_neq_flag      <=  tclk180_fifo_01_wr_en_end_pulse and to_std_logic( fifo_01_wr_addr /= fifo_00_wr_addr)  ; 
283
--      end if;
284
 
285
 
286
--      if rising_edge (clk180) then 
287
--              tclk180_fifo_11_wr_en            <= fifo_11_wr_en ;
288
--              tclk180_fifo_11_wr_en_delay1     <= tclk180_fifo_11_wr_en ;
289
--              tclk180_fifo_11_wr_en_delay2     <= tclk180_fifo_11_wr_en_delay1 ;
290
--              tclk180_fifo_11_wr_en_delay3     <= tclk180_fifo_11_wr_en_delay2 ;
291
--              tclk180_fifo_11_wr_en_delay4     <= tclk180_fifo_11_wr_en_delay3 ;
292
--              tclk180_fifo_11_wr_en_delay5     <= tclk180_fifo_11_wr_en_delay4 ;
293
--              tclk180_fifo_11_wr_en_delay6     <= tclk180_fifo_11_wr_en_delay5 ;
294
--              tclk180_fifo_11_wr_en_delay7     <= tclk180_fifo_11_wr_en_delay6 ;
295
--              tclk180_fifo_11_wr_en_delay8     <= tclk180_fifo_11_wr_en_delay7 ;
296
--              tclk180_fifo_11_wr_en_delay9     <= tclk180_fifo_11_wr_en_delay8 ;
297
--              tclk180_fifo_11_wr_en_end_pulse  <= tclk180_fifo_11_wr_en_delay9 and not tclk180_fifo_11_wr_en_delay8;
298
--      end if;
299
 
300
--PL: om een warning te lozen
301
--      if rising_edge (clk180) then 
302
--              tclk180_fifo_11_10_neq_flag      <=  tclk180_fifo_11_wr_en_end_pulse and to_std_logic( fifo_11_wr_addr /= fifo_10_wr_addr)  ; 
303
--      end if;
304
 
305
        if rising_edge (clk180) then
306
                test_fifo_wr_addr(15 downto 12)   <=  fifo_11_wr_addr(3 downto 0)   ;
307
                test_fifo_wr_addr(11 downto 8)    <=  fifo_10_wr_addr(3 downto 0)   ;
308
                test_fifo_wr_addr(7 downto 4)     <=  fifo_01_wr_addr(3 downto 0)   ;
309
                test_fifo_wr_addr(3 downto 0)     <=  fifo_00_wr_addr(3 downto 0)   ;
310
        end if;
311
 
312
 
313
 
314
 
315
end process;
316
 
317
 
318
 
319
reset90_r_val   <= reset90_r;
320
 
321
 
322
data_read0 : data_read
323
port map (
324
         clk90               =>    clk90,
325
         reset90_r           =>    reset90_r1,
326
         ddr_dq_in_rising    =>    dq_in_rising,
327
         ddr_dq_in_falling   =>    dq_in_falling,
328
         read_valid_data_1   =>    read_valid_data_1,
329
 
330
            fifo_00_wr_en                    => fifo_00_wr_en,
331
            fifo_10_wr_en                    => fifo_10_wr_en,
332
 
333
            fifo_01_wr_en                    => fifo_01_wr_en,
334
            fifo_11_wr_en                    => fifo_11_wr_en,
335
 
336
         fifo_00_wr_addr     =>    fifo_00_wr_addr,
337
         fifo_01_wr_addr     =>    fifo_01_wr_addr,
338
         fifo_10_wr_addr     =>    fifo_10_wr_addr,
339
         fifo_11_wr_addr     =>    fifo_11_wr_addr,
340
 
341
         dqs0_delayed_col0   =>    dqs0_delayed_col0,
342
         dqs1_delayed_col0   =>    dqs1_delayed_col0,
343
 
344
         user_output_data    =>    user_output_data,
345
         fifo0_rd_addr_val   =>    fifo0_rd_addr,
346
         fifo1_rd_addr_val   =>    fifo1_rd_addr
347
         );
348
 
349
 
350
data_read_controller0 : data_read_controller
351
port map (
352
            clk90              =>   clk90,
353
            clk180             =>   clk180,
354
            reset_r            =>   reset_r,
355
            reset90_r          =>   reset90_r1,
356
            rst_dqs_div_in     =>   rst_dqs_div_in,
357
            delay_sel          =>   delay_sel,
358
            dqs_int_delay_in0  =>   dqs_int_delay_in0,
359
            dqs_int_delay_in1  =>   dqs_int_delay_in1,
360
 
361
            fifo0_rd_addr    =>   fifo0_rd_addr,
362
            fifo1_rd_addr    =>   fifo1_rd_addr,
363
            u_data_val                                                      => u_data_val,
364
            read_valid_data_1_val  =>   read_valid_data_1,
365
 
366
            fifo_00_wr_en_val                               => fifo_00_wr_en,
367
            fifo_10_wr_en_val                               => fifo_10_wr_en,
368
 
369
            fifo_01_wr_en_val                               => fifo_01_wr_en,
370
            fifo_11_wr_en_val                               => fifo_11_wr_en,
371
 
372
 
373
            fifo_00_wr_addr_val     =>    fifo_00_wr_addr,
374
            fifo_01_wr_addr_val     =>    fifo_01_wr_addr,
375
            fifo_10_wr_addr_val     =>    fifo_10_wr_addr,
376
            fifo_11_wr_addr_val     =>    fifo_11_wr_addr,
377
 
378
                dqs0_delayed_col0_val     => dqs0_delayed_col0,
379
                dqs1_delayed_col0_val     => dqs1_delayed_col0
380
 
381
         );
382
 
383
 
384
data_write0 : data_write
385
port map (
386
          user_input_data    =>   user_input_data,
387
          clk90              =>   clk90,
388
          reset90_r          =>   reset90_r1,
389
          reset270_r         =>   reset270_r,
390
          write_enable       =>   write_enable,
391
          write_en_val       =>   write_en_val,
392
          write_en_val1      =>   write_en_val1,
393
          write_data_falling =>   write_data_falling,
394
          write_data_rising  =>   write_data_rising,
395
          data_mask_f        =>   data_mask_f,
396
          data_mask_r        =>   data_mask_r
397
         );
398
 
399
 
400
data_path_rst0 : data_path_rst
401
port map (
402
          clk                =>   clk,
403
          clk180             =>   clk180,
404
          clk90              =>   clk90,
405
          reset              =>   reset,
406
          reset90            =>   reset90,
407
          reset180           =>   reset180,
408
          reset270           =>   reset270,
409
          reset_r            =>   reset_r,
410
          reset90_r          =>   reset90_r,
411
          reset90_r1         =>   reset90_r1,
412
          reset180_r         =>   reset180_r,
413
          reset270_r         =>   reset270_r
414
         );
415
 
416
 
417
end arc_ddr2_data_path;

powered by: WebSVN 2.1.0

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