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/] [FIFO_Wrapper.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:37:22 12 Feb 2009
6
-- Design Name: 
7
-- Module Name:    eb_wrapper - 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 eb_wrapper is
34
    Generic (
35
             C_ASYNFIFO_WIDTH  :  integer  :=  72
36
            );
37
    Port (
38
 
39
                         --FIFO PCIe-->USER
40
                         H2B_wr_clk        : IN  std_logic;
41
          H2B_wr_en         : IN  std_logic;
42
          H2B_wr_din        : IN  std_logic_VECTOR(C_ASYNFIFO_WIDTH-1 downto 0);
43
          H2B_wr_pfull      : OUT std_logic;
44
          H2B_wr_full       : OUT std_logic;
45
          H2B_wr_data_count : OUT std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
46
          H2B_rd_clk        : IN  std_logic;
47
          H2B_rd_en         : IN  std_logic;
48
          H2B_rd_dout       : OUT std_logic_VECTOR(C_ASYNFIFO_WIDTH-1 downto 0);
49
          H2B_rd_pempty     : OUT std_logic;
50
          H2B_rd_empty      : OUT std_logic;
51
          H2B_rd_data_count : OUT std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
52
                         H2B_rd_valid      : OUT std_logic;
53
                         --FIFO USER-->PCIe
54
          B2H_wr_clk        : IN  std_logic;
55
          B2H_wr_en         : IN  std_logic;
56
          B2H_wr_din        : IN  std_logic_VECTOR(C_ASYNFIFO_WIDTH-1 downto 0);
57
          B2H_wr_pfull      : OUT std_logic;
58
          B2H_wr_full       : OUT std_logic;
59
          B2H_wr_data_count : OUT std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
60
          B2H_rd_clk        : IN  std_logic;
61
          B2H_rd_en         : IN  std_logic;
62
          B2H_rd_dout       : OUT std_logic_VECTOR(C_ASYNFIFO_WIDTH-1 downto 0);
63
          B2H_rd_pempty     : OUT std_logic;
64
          B2H_rd_empty      : OUT std_logic;
65
          B2H_rd_data_count : OUT std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
66
                         B2H_rd_valid            : OUT std_logic;
67
          --RESET from PCIe
68
                         rst               : IN  std_logic
69
          );
70
end entity eb_wrapper;
71
 
72
 
73
architecture Behavioral of eb_wrapper is
74
 
75
  ---  32768 x 64, with data count synchronized to rd_clk
76
  component v6_eb_fifo_counted_resized
77
    port (
78
      wr_clk        : IN  std_logic;
79
      wr_en         : IN  std_logic;
80
      din           : IN  std_logic_VECTOR(C_ASYNFIFO_WIDTH-1-8 downto 0);
81
      prog_full     : OUT std_logic;
82
      full          : OUT std_logic;
83
 
84
      rd_clk        : IN  std_logic;
85
      rd_en         : IN  std_logic;
86
      dout          : OUT std_logic_VECTOR(C_ASYNFIFO_WIDTH-1-8 downto 0);
87
      prog_empty    : OUT std_logic;
88
      empty         : OUT std_logic;
89
      rd_data_count : OUT std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
90
      wr_data_count : OUT std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
91
                valid         : OUT std_logic;
92
      rst           : IN  std_logic
93
      );
94
  end component;
95
 
96
  signal B2H_rd_data_count_wire    : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
97
  signal B2H_rd_data_count_i       : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
98
  signal H2B_rd_data_count_wire    : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
99
  signal H2B_rd_data_count_i       : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
100
  signal B2H_wr_data_count_wire    : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
101
  signal B2H_wr_data_count_i       : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
102
  signal H2B_wr_data_count_wire    : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
103
  signal H2B_wr_data_count_i       : std_logic_VECTOR(C_EMU_FIFO_DC_WIDTH-1 downto 0);
104
 
105
 
106
  signal resized_H2B_wr_din  : std_logic_VECTOR(64-1 downto 0);
107
  signal resized_H2B_rd_dout : std_logic_VECTOR(64-1 downto 0);
108
  signal resized_B2H_wr_din  : std_logic_VECTOR(64-1 downto 0);
109
  signal resized_B2H_rd_dout : std_logic_VECTOR(64-1 downto 0);
110
 
111
 
112
begin
113
 
114
  B2H_rd_data_count      <= B2H_rd_data_count_i;
115
  H2B_rd_data_count      <= H2B_rd_data_count_i;
116
  B2H_wr_data_count      <= B2H_wr_data_count_i;
117
  H2B_wr_data_count      <= H2B_wr_data_count_i;
118
 
119
  resized_H2B_wr_din  <= H2B_wr_din(64-1 downto 0);
120
  resized_B2H_wr_din  <= B2H_wr_din(64-1 downto 0);
121
 
122
 
123
  H2B_rd_dout(71 downto 64) <= C_ALL_ZEROS(71 downto 64);
124
  H2B_rd_dout(63 downto  0) <= resized_H2B_rd_dout;
125
 
126
  B2H_rd_dout(71 downto 64) <= C_ALL_ZEROS(71 downto 64);
127
  B2H_rd_dout(63 downto  0) <= resized_B2H_rd_dout;
128
 
129
 
130
 
131
 
132
  --  ------------------------------------------
133
  Syn_B2H_rd_data_count:
134
  process (B2H_rd_clk)
135
  begin
136
    if B2H_rd_clk'event and B2H_rd_clk = '1' then
137
       B2H_rd_data_count_i    <= B2H_rd_data_count_wire;
138
    end if;
139
  end process;
140
 
141
  Syn_H2B_rd_data_count:
142
  process (H2B_rd_clk)
143
  begin
144
    if H2B_rd_clk'event and H2B_rd_clk = '1' then
145
       H2B_rd_data_count_i    <= H2B_rd_data_count_wire;
146
    end if;
147
  end process;
148
 
149
  Syn_H2B_wr_data_count:
150
  process (H2B_wr_clk)
151
  begin
152
    if H2B_wr_clk'event and H2B_wr_clk = '1' then
153
       H2B_wr_data_count_i    <= H2B_wr_data_count_wire;
154
    end if;
155
  end process;
156
 
157
  Syn_B2H_wr_data_count:
158
  process (B2H_wr_clk)
159
  begin
160
    if B2H_wr_clk'event and B2H_wr_clk = '1' then
161
       B2H_wr_data_count_i    <= B2H_wr_data_count_wire;
162
    end if;
163
  end process;
164
  --  ------------------------------------------
165
 
166
 
167
----- Host2Board FIFO ----------
168
  U0_H2B:
169
  v6_eb_fifo_counted_resized
170
    port map (
171
         wr_clk         => H2B_wr_clk                           ,
172
         wr_en          => H2B_wr_en                            ,
173
         din            => resized_H2B_wr_din           ,
174
         prog_full      => H2B_wr_pfull                         ,
175
         full           => H2B_wr_full                          ,
176
         rd_clk         => H2B_rd_clk              ,
177
         rd_en          => H2B_rd_en               ,
178
         dout           => resized_H2B_rd_dout     ,
179
         prog_empty     => H2B_rd_pempty           ,
180
         empty          => H2B_rd_empty            ,
181
         rd_data_count  => H2B_rd_data_count_wire  ,
182
         wr_data_count  => H2B_wr_data_count_wire  ,
183
                        valid          => H2B_rd_valid                     ,
184
         rst                    => rst
185
         );
186
 
187
 
188
----- Board2Host FIFO ----------
189
  U0_B2H:
190
  v6_eb_fifo_counted_resized
191
    port map (
192
         wr_clk                 => B2H_wr_clk                                   ,
193
         wr_en                  => B2H_wr_en                                    ,
194
         din                    => resized_B2H_wr_din           ,
195
         prog_full              => B2H_wr_pfull                                 ,
196
         full                   => B2H_wr_full                                  ,
197
         rd_clk                 => B2H_rd_clk                                   ,
198
         rd_en                  => B2H_rd_en                                    ,
199
         dout                   => resized_B2H_rd_dout     ,
200
         prog_empty             => B2H_rd_pempty                        ,
201
         empty                  => B2H_rd_empty                         ,
202
         rd_data_count  => B2H_rd_data_count_wire  ,
203
         wr_data_count  => B2H_wr_data_count_wire  ,
204
                        valid          => B2H_rd_valid                          ,
205
         rst                    => rst
206
         );
207
 
208
end architecture Behavioral;

powered by: WebSVN 2.1.0

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