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

Subversion Repositories plb2wbbridge

[/] [plb2wbbridge/] [trunk/] [systems/] [EDK_Libs/] [WishboneIPLib/] [pcores/] [plb2wb_bridge_v1_00_a/] [hdl/] [vhdl/] [fifo_stat2plb.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 feddischso
----------------------------------------------------------------------
2
----                                                              ----
3
----  PLB2WB-Bridge                                               ----
4
----                                                              ----
5
----  This file is part of the PLB-to-WB-Bridge project           ----
6
----  http://opencores.org/project,plb2wbbridge                   ----
7
----                                                              ----
8
----  Description                                                 ----
9
----  Implementation of a PLB-to-WB-Bridge according to           ----
10
----  PLB-to-WB Bridge specification document.                    ----
11
----                                                              ----
12
----  To Do:                                                      ----
13
----   Nothing                                                    ----
14
----                                                              ----
15
----  Author(s):                                                  ----
16
----      - Christian Haettich                                    ----
17
----        feddischson@opencores.org                             ----
18
----                                                              ----
19
----------------------------------------------------------------------
20
----                                                              ----
21
---- Copyright (C) 2010 Authors                                   ----
22
----                                                              ----
23
---- This source file may be used and distributed without         ----
24
---- restriction provided that this copyright statement is not    ----
25
---- removed from the file and that any derivative work contains  ----
26
---- the original copyright notice and the associated disclaimer. ----
27
----                                                              ----
28
---- This source file is free software; you can redistribute it   ----
29
---- and/or modify it under the terms of the GNU Lesser General   ----
30
---- Public License as published by the Free Software Foundation; ----
31
---- either version 2.1 of the License, or (at your option) any   ----
32
---- later version.                                               ----
33
----                                                              ----
34
---- This source is distributed in the hope that it will be       ----
35
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
36
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
37
---- PURPOSE.  See the GNU Lesser General Public License for more ----
38
---- details.                                                     ----
39
----                                                              ----
40
---- You should have received a copy of the GNU Lesser General    ----
41
---- Public License along with this source; if not, download it   ----
42
---- from http://www.opencores.org/lgpl.shtml                     ----
43
----                                                              ----
44
----------------------------------------------------------------------
45
 
46
 
47
library ieee;
48
use ieee.std_logic_1164.all;
49
use ieee.std_logic_arith.all;
50
use ieee.std_logic_unsigned.all;
51
 
52
library plb2wb_bridge_v1_00_a;
53
use plb2wb_bridge_v1_00_a.plb2wb_pkg.all;
54
 
55
 
56
entity fifo_stat2plb is
57
   generic
58
   (
59
      SYNCHRONY               : boolean := true; -- true = synchron
60
      WB_DWIDTH               : integer range WB_DWIDTH_MIN to WB_DWIDTH_MAX := 32;
61
      WB_AWIDTH               : integer range WB_AWIDTH_MIN to WB_AWIDTH_MAX := 32;
62
      C_SPLB_MID_WIDTH        : integer := 3
63
 
64
   );
65
   port(
66
      rd_en   : in  std_logic      := 'X';
67
      wr_en   : in  std_logic      := 'X';
68
      full    : out std_logic;
69
      empty   : out std_logic;
70
      wr_clk  : in  std_logic      := 'X';
71
      rst     : in  std_logic      := 'X';
72
      rd_clk  : in  std_logic      := 'X';
73
      dout    : out std_logic_vector ( IRQ_INFO_SIZE + WB_AWIDTH + WB_DWIDTH + C_SPLB_MID_WIDTH + STATUS2PLB_INFO_SIZE -1 downto 0 );
74
      din     : in  std_logic_vector ( IRQ_INFO_SIZE + WB_AWIDTH + WB_DWIDTH + C_SPLB_MID_WIDTH + STATUS2PLB_INFO_SIZE -1 downto 0 )
75
   );
76
end entity fifo_stat2plb;
77
 
78
 
79
 
80
architecture IMP of fifo_stat2plb is
81
 
82
constant VEC_MIN_SIZE : integer := IRQ_INFO_SIZE + WB_AWIDTH + WB_DWIDTH + 1 + STATUS2PLB_INFO_SIZE;
83
 
84
 
85
component fifo_stat2plb_cc_1 is
86
  port (
87
    rd_en : in STD_LOGIC := 'X';
88
    wr_en : in STD_LOGIC := 'X';
89
    full : out STD_LOGIC;
90
    empty : out STD_LOGIC;
91
    clk : in STD_LOGIC := 'X';
92
    rst : in STD_LOGIC := 'X';
93
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE-1 downto 0 );
94
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE-1 downto 0 )
95
  );
96
end component fifo_stat2plb_cc_1;
97
 
98
 
99
component fifo_stat2plb_ic_1 is
100
  port (
101
    rd_en : in STD_LOGIC := 'X';
102
    wr_en : in STD_LOGIC := 'X';
103
    full : out STD_LOGIC;
104
    empty : out STD_LOGIC;
105
    wr_clk : in STD_LOGIC := 'X';
106
    rst : in STD_LOGIC := 'X';
107
    rd_clk : in STD_LOGIC := 'X';
108
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE-1 downto 0 );
109
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE-1 downto 0 )
110
  );
111
end component fifo_stat2plb_ic_1;
112
 
113
component fifo_stat2plb_cc_2 is
114
  port (
115
    rd_en : in STD_LOGIC := 'X';
116
    wr_en : in STD_LOGIC := 'X';
117
    full : out STD_LOGIC;
118
    empty : out STD_LOGIC;
119
    clk : in STD_LOGIC := 'X';
120
    rst : in STD_LOGIC := 'X';
121
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE+1-1 downto 0 );
122
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE+1-1 downto 0 )
123
  );
124
end component fifo_stat2plb_cc_2;
125
 
126
 
127
component fifo_stat2plb_ic_2 is
128
  port (
129
    rd_en : in STD_LOGIC := 'X';
130
    wr_en : in STD_LOGIC := 'X';
131
    full : out STD_LOGIC;
132
    empty : out STD_LOGIC;
133
    wr_clk : in STD_LOGIC := 'X';
134
    rst : in STD_LOGIC := 'X';
135
    rd_clk : in STD_LOGIC := 'X';
136
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE+1-1 downto 0 );
137
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE+1-1 downto 0 )
138
  );
139
end component fifo_stat2plb_ic_2;
140
 
141
component fifo_stat2plb_cc_3 is
142
  port (
143
    rd_en : in STD_LOGIC := 'X';
144
    wr_en : in STD_LOGIC := 'X';
145
    full : out STD_LOGIC;
146
    empty : out STD_LOGIC;
147
    clk : in STD_LOGIC := 'X';
148
    rst : in STD_LOGIC := 'X';
149
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE+2-1 downto 0 );
150
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE+2-1 downto 0 )
151
  );
152
end component fifo_stat2plb_cc_3;
153
 
154
 
155
component fifo_stat2plb_ic_3 is
156
  port (
157
    rd_en : in STD_LOGIC := 'X';
158
    wr_en : in STD_LOGIC := 'X';
159
    full : out STD_LOGIC;
160
    empty : out STD_LOGIC;
161
    wr_clk : in STD_LOGIC := 'X';
162
    rst : in STD_LOGIC := 'X';
163
    rd_clk : in STD_LOGIC := 'X';
164
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE+2-1 downto 0 );
165
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE+2-1 downto 0 )
166
  );
167
end component fifo_stat2plb_ic_3;
168
 
169
component fifo_stat2plb_cc_4 is
170
  port (
171
    rd_en : in STD_LOGIC := 'X';
172
    wr_en : in STD_LOGIC := 'X';
173
    full : out STD_LOGIC;
174
    empty : out STD_LOGIC;
175
    clk : in STD_LOGIC := 'X';
176
    rst : in STD_LOGIC := 'X';
177
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE+3-1 downto 0 );
178
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE+3-1 downto 0 )
179
  );
180
end component fifo_stat2plb_cc_4;
181
 
182
 
183
component fifo_stat2plb_ic_4 is
184
  port (
185
    rd_en : in STD_LOGIC := 'X';
186
    wr_en : in STD_LOGIC := 'X';
187
    full : out STD_LOGIC;
188
    empty : out STD_LOGIC;
189
    wr_clk : in STD_LOGIC := 'X';
190
    rst : in STD_LOGIC := 'X';
191
    rd_clk : in STD_LOGIC := 'X';
192
    dout : out STD_LOGIC_VECTOR ( VEC_MIN_SIZE+3-1 downto 0 );
193
    din : in STD_LOGIC_VECTOR ( VEC_MIN_SIZE+3-1 downto 0 )
194
  );
195
end component fifo_stat2plb_ic_4;
196
 
197
 
198
 
199
begin
200
 
201
fifo_cc_1: if ( SYNCHRONY = true and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 1 ) generate
202
U_fifo_cc : fifo_stat2plb_cc_1
203
   port map(
204
      rd_en    => rd_en,
205
      wr_en    => wr_en,
206
      full     => full,
207
      empty    => empty,
208
      clk      => rd_clk,  -- rd_clk must be the same than wr_clk
209
      rst      => rst,
210
      dout     => dout,
211
      din      => din
212
   );
213
end generate fifo_cc_1;
214
 
215
 
216
fifo_cc_2: if ( SYNCHRONY = true and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 2 ) generate
217
U_fifo_cc : fifo_stat2plb_cc_2
218
   port map(
219
      rd_en    => rd_en,
220
      wr_en    => wr_en,
221
      full     => full,
222
      empty    => empty,
223
      clk      => rd_clk,  -- rd_clk must be the same than wr_clk
224
      rst      => rst,
225
      dout     => dout,
226
      din      => din
227
   );
228
end generate fifo_cc_2;
229
 
230
 
231
fifo_cc_3: if ( SYNCHRONY = true and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 3 ) generate
232
U_fifo_cc : fifo_stat2plb_cc_3
233
   port map(
234
      rd_en    => rd_en,
235
      wr_en    => wr_en,
236
      full     => full,
237
      empty    => empty,
238
      clk      => rd_clk,  -- rd_clk must be the same than wr_clk
239
      rst      => rst,
240
      dout     => dout,
241
      din      => din
242
   );
243
end generate fifo_cc_3;
244
 
245
 
246
fifo_cc_4: if ( SYNCHRONY = true and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 4) generate
247
U_fifo_cc : fifo_stat2plb_cc_4
248
   port map(
249
      rd_en    => rd_en,
250
      wr_en    => wr_en,
251
      full     => full,
252
      empty    => empty,
253
      clk      => rd_clk,  -- rd_clk must be the same than wr_clk
254
      rst      => rst,
255
      dout     => dout,
256
      din      => din
257
   );
258
end generate fifo_cc_4;
259
 
260
 
261
 
262
 
263
fifo_ic_1: if ( SYNCHRONY = false and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 1 ) generate
264
U_fifo_ic : fifo_stat2plb_ic_1
265
   port map(
266
      rd_en    => rd_en,
267
      wr_en    => wr_en,
268
      full     => full,
269
      empty    => empty,
270
      rd_clk   => rd_clk,
271
      wr_clk   => wr_clk,
272
      rst      => rst,
273
      dout     => dout,
274
      din      => din
275
   );
276
end generate fifo_ic_1;
277
 
278
 
279
fifo_ic_2: if ( SYNCHRONY = false and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 2 ) generate
280
U_fifo_ic : fifo_stat2plb_ic_2
281
   port map(
282
      rd_en    => rd_en,
283
      wr_en    => wr_en,
284
      full     => full,
285
      empty    => empty,
286
      rd_clk   => rd_clk,
287
      wr_clk   => wr_clk,
288
      rst      => rst,
289
      dout     => dout,
290
      din      => din
291
   );
292
end generate fifo_ic_2;
293
 
294
 
295
fifo_ic_3: if ( SYNCHRONY = false and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 3 ) generate
296
U_fifo_ic : fifo_stat2plb_ic_3
297
   port map(
298
      rd_en    => rd_en,
299
      wr_en    => wr_en,
300
      full     => full,
301
      empty    => empty,
302
      rd_clk   => rd_clk,
303
      wr_clk   => wr_clk,
304
      rst      => rst,
305
      dout     => dout,
306
      din      => din
307
   );
308
end generate fifo_ic_3;
309
 
310
 
311
fifo_ic_4: if ( SYNCHRONY = false and WB_DWIDTH = 32 and C_SPLB_MID_WIDTH = 4 ) generate
312
U_fifo_ic : fifo_stat2plb_ic_4
313
   port map(
314
      rd_en    => rd_en,
315
      wr_en    => wr_en,
316
      full     => full,
317
      empty    => empty,
318
      rd_clk   => rd_clk,
319
      wr_clk   => wr_clk,
320
      rst      => rst,
321
      dout     => dout,
322
      din      => din
323
   );
324
end generate fifo_ic_4;
325
 
326
 
327
 
328
 
329
 
330
end architecture IMP;

powered by: WebSVN 2.1.0

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