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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [gaisler/] [pci/] [pci.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
------------------------------------------------------------------------------
2
--  This file is a part of the GRLIB VHDL IP LIBRARY
3
--  Copyright (C) 2003, Gaisler Research
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
--
15
--  You should have received a copy of the GNU General Public License
16
--  along with this program; if not, write to the Free Software
17
--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
18
-----------------------------------------------------------------------------
19
-- Entity:      pci
20
-- File:        pci.vhd
21
-- Author:      Jiri Gaisler - Gaisler Research
22
-- Description: Package with component and type declarations for PCI cores
23
------------------------------------------------------------------------------
24
 
25
library ieee;
26
use ieee.std_logic_1164.all;
27
library grlib;
28
use grlib.amba.all;
29
use grlib.stdlib.all;
30
use grlib.devices.all;
31
library techmap;
32
use techmap.gencomp.all;
33
library gaisler;
34
use gaisler.misc.all;
35
 
36
package pci is
37
 
38
type pci_in_type is record
39
  rst           : std_ulogic;
40
  gnt           : std_ulogic;
41
  idsel         : std_ulogic;
42
  ad            : std_logic_vector(31 downto 0);
43
  cbe           : std_logic_vector(3 downto 0);
44
  frame         : std_ulogic;
45
  irdy          : std_ulogic;
46
  trdy          : std_ulogic;
47
  devsel        : std_ulogic;
48
  stop          : std_ulogic;
49
  lock          : std_ulogic;
50
  perr          : std_ulogic;
51
  serr          : std_ulogic;
52
  par           : std_ulogic;
53
  host          : std_ulogic;
54
  pci66         : std_ulogic;
55
  pme_status    : std_ulogic;
56
  int           : std_logic_vector(3 downto 0);         -- D downto A
57
end record;
58
 
59
 
60
type pci_out_type is record
61
  aden          : std_ulogic;
62
  vaden         : std_logic_vector(31 downto 0);
63
  cbeen         : std_logic_vector(3 downto 0);
64
  frameen       : std_ulogic;
65
  irdyen        : std_ulogic;
66
  trdyen        : std_ulogic;
67
  devselen      : std_ulogic;
68
  stopen        : std_ulogic;
69
  ctrlen        : std_ulogic;
70
  perren        : std_ulogic;
71
  paren         : std_ulogic;
72
  reqen         : std_ulogic;
73
  locken        : std_ulogic;
74
  serren        : std_ulogic;
75
  inten         : std_ulogic;
76
  req           : std_ulogic;
77
  ad            : std_logic_vector(31 downto 0);
78
  cbe           : std_logic_vector(3 downto 0);
79
  frame         : std_ulogic;
80
  irdy          : std_ulogic;
81
  trdy          : std_ulogic;
82
  devsel        : std_ulogic;
83
  stop          : std_ulogic;
84
  perr          : std_ulogic;
85
  serr          : std_ulogic;
86
  par           : std_ulogic;
87
  lock          : std_ulogic;
88
  power_state   : std_logic_vector(1 downto 0);
89
  pme_enable    : std_ulogic;
90
  pme_clear     : std_ulogic;
91
  int           : std_ulogic;
92
  rst           : std_ulogic;
93
end record;
94
 
95
 
96
  component pci_target
97
  generic (
98
    hindex    : integer := 0;
99
    abits     : integer := 21;
100
    device_id : integer := 0;            -- PCI device ID
101
    vendor_id : integer := 0;            -- PCI vendor ID
102
    nsync : integer range 1 to 2 := 1;  -- 1 or 2 sync regs between clocks
103
    oepol     : integer := 0
104
  );
105
   port(
106
      rst       : in std_ulogic;
107
      clk       : in std_ulogic;
108
      pciclk    : in std_ulogic;
109
      pcii      : in  pci_in_type;
110
      pcio      : out pci_out_type;
111
      ahbmi     : in  ahb_mst_in_type;
112
      ahbmo     : out ahb_mst_out_type
113
  );
114
  end component;
115
 
116
  component pci_mt
117
  generic (
118
    hmstndx   : integer := 0;
119
    abits     : integer := 21;
120
    device_id : integer := 0;            -- PCI device ID
121
    vendor_id : integer := 0;            -- PCI vendor ID
122
    master    : integer := 1;           -- Enable PCI Master
123
    hslvndx   : integer := 0;
124
    haddr     : integer := 16#F00#;
125
    hmask     : integer := 16#F00#;
126
    ioaddr    : integer := 16#000#;
127
    nsync : integer range 1 to 2 := 1;  -- 1 or 2 sync regs between clocks
128
    oepol     : integer := 0
129
  );
130
   port(
131
      rst       : in std_logic;
132
      clk       : in std_logic;
133
      pciclk    : in std_logic;
134
      pcii      : in  pci_in_type;
135
      pcio      : out pci_out_type;
136
      ahbmi     : in  ahb_mst_in_type;
137
      ahbmo     : out ahb_mst_out_type;
138
      ahbsi     : in  ahb_slv_in_type;
139
      ahbso     : out ahb_slv_out_type
140
  );
141
  end component;
142
 
143
  component dmactrl
144
  generic (
145
    hindex    : integer := 0;
146
    slvindex  : integer := 0;
147
    pindex    : integer := 0;
148
    paddr     : integer := 0;
149
    pmask     : integer := 16#fff#;
150
    blength   : integer := 4);
151
  port (
152
    rst       : in std_logic;
153
    clk       : in std_logic;
154
    apbi      : in apb_slv_in_type;
155
    apbo      : out apb_slv_out_type;
156
    ahbmi     : in ahb_mst_in_type;
157
    ahbmo     : out ahb_mst_out_type;
158
    ahbsi0    : in ahb_slv_in_type;
159
    ahbso0    : out ahb_slv_out_type;
160
    ahbsi1    : out ahb_slv_in_type;
161
    ahbso1    : in ahb_slv_out_type);
162
  end component;
163
 
164
  component pci_mtf
165
  generic (
166
    memtech   : integer := DEFMEMTECH;
167
    hmstndx   : integer := 0;
168
    dmamst    : integer := NAHBMST;
169
    readpref  : integer := 0;
170
    abits     : integer := 21;
171
    dmaabits  : integer := 26;
172
    fifodepth : integer := 3; -- FIFO depth
173
    device_id : integer := 0; -- PCI device ID
174
    vendor_id : integer := 0; -- PCI vendor ID
175
    master    : integer := 1; -- Enable PCI Master
176
    hslvndx   : integer := 0;
177
    pindex    : integer := 0;
178
    paddr     : integer := 0;
179
    pmask     : integer := 16#fff#;
180
    haddr     : integer := 16#F00#;
181
    hmask     : integer := 16#F00#;
182
    ioaddr    : integer := 16#000#;
183
    irq       : integer := 0;
184
    irqmask   : integer := 0;
185
    nsync     : integer range 1 to 2 := 2;      -- 1 or 2 sync regs between clocks
186
    oepol     : integer := 0;
187
    endian    : integer := 0;
188
    class_code: integer := 16#0B4000#;
189
    rev       : integer := 0;
190
    scanen    : integer := 0;
191
    syncrst   : integer := 0;
192
    hostrst   : integer := 0);
193
   port(
194
      rst       : in std_logic;
195
      clk       : in std_logic;
196
      pciclk    : in std_logic;
197
      pcii      : in  pci_in_type;
198
      pcio      : out pci_out_type;
199
      apbi      : in apb_slv_in_type;
200
      apbo      : out apb_slv_out_type;
201
      ahbmi     : in  ahb_mst_in_type;
202
      ahbmo     : out ahb_mst_out_type;
203
      ahbsi     : in  ahb_slv_in_type;
204
      ahbso     : out ahb_slv_out_type
205
);
206
end component;
207
 
208
component pcitrace
209
  generic (
210
    depth     : integer range 6 to 12 := 8;
211
    iregs     : integer := 1;
212
    memtech   : integer := DEFMEMTECH;
213
    pindex    : integer := 0;
214
    paddr     : integer := 0;
215
    pmask     : integer := 16#f00#
216
  );
217
  port (
218
    rst    : in  std_ulogic;
219
    clk    : in  std_ulogic;
220
    pciclk : in  std_ulogic;
221
    pcii   : in  pci_in_type;
222
    apbi   : in  apb_slv_in_type;
223
    apbo   : out apb_slv_out_type
224
  );
225
end component;
226
 
227
component pcipads
228
  generic (
229
    padtech      : integer := 0;
230
    noreset      : integer := 0;
231
    oepol        : integer := 0;
232
    host         : integer := 1;
233
    int          : integer := 0;
234
    no66         : integer := 0
235
  );
236
  port (
237
    pci_rst     : inout std_logic;
238
    pci_gnt     : in std_ulogic;
239
    pci_idsel   : in std_ulogic;
240
    pci_lock    : inout std_ulogic;
241
    pci_ad      : inout std_logic_vector(31 downto 0);
242
    pci_cbe     : inout std_logic_vector(3 downto 0);
243
    pci_frame   : inout std_logic;
244
    pci_irdy    : inout std_logic;
245
    pci_trdy    : inout std_logic;
246
    pci_devsel  : inout std_logic;
247
    pci_stop    : inout std_logic;
248
    pci_perr    : inout std_logic;
249
    pci_par     : inout std_logic;
250
    pci_req     : inout std_logic;  -- tristate pad but never read
251
    pci_serr    : inout std_logic;  -- open drain output
252
    pci_host    : in std_ulogic;
253
    pci_66      : in std_ulogic;
254
    pcii        : out pci_in_type;
255
    pcio        : in  pci_out_type;
256
    pci_int     : inout std_logic_vector(3 downto 0)
257
  );
258
end component;
259
 
260
component pcidma
261
  generic (
262
    memtech   : integer := DEFMEMTECH;
263
    dmstndx   : integer := 0;
264
    dapbndx   : integer := 0;
265
    dapbaddr  : integer := 0;
266
    dapbmask  : integer := 16#fff#;
267
    blength   : integer := 16;
268
    mstndx    : integer := 0;
269
    abits     : integer := 21;
270
    dmaabits  : integer := 26;
271
    fifodepth : integer := 3; -- FIFO depth
272
    device_id : integer := 0; -- PCI device ID
273
    vendor_id : integer := 0; -- PCI vendor ID
274
    slvndx    : integer := 0;
275
    apbndx    : integer := 0;
276
    apbaddr   : integer := 0;
277
    apbmask   : integer := 16#fff#;
278
    haddr     : integer := 16#F00#;
279
    hmask     : integer := 16#F00#;
280
    ioaddr    : integer := 16#000#;
281
    nsync     : integer range 1 to 2 := 2;      -- 1 or 2 sync regs between clocks
282
    oepol     : integer := 0;
283
    endian    : integer := 0;   -- 0 little, 1 big
284
    class_code: integer := 16#0B4000#;
285
    rev       : integer := 0;
286
    irq       : integer := 0;
287
    irqmask   : integer := 0;
288
    scanen    : integer := 0;
289
    hostrst   : integer := 0);
290
   port(
291
      rst       : in std_logic;
292
      clk       : in std_logic;
293
      pciclk    : in std_logic;
294
      pcii      : in  pci_in_type;
295
      pcio      : out pci_out_type;
296
      dapbo     : out apb_slv_out_type;
297
      dahbmo    : out ahb_mst_out_type;
298
      apbi      : in apb_slv_in_type;
299
      apbo      : out apb_slv_out_type;
300
      ahbmi     : in  ahb_mst_in_type;
301
      ahbmo     : out ahb_mst_out_type;
302
      ahbsi     : in  ahb_slv_in_type;
303
      ahbso     : out ahb_slv_out_type
304
);
305
end component;
306
 
307
  component pciahbmst
308
  generic (
309
    hindex  : integer := 0;
310
    hirq    : integer := 0;
311
    venid   : integer := VENDOR_GAISLER;
312
    devid   : integer := 0;
313
    version : integer := 0;
314
    chprot  : integer := 3;
315
    incaddr : integer := 0);
316
   port (
317
      rst  : in  std_ulogic;
318
      clk  : in  std_ulogic;
319
      dmai : in ahb_dma_in_type;
320
      dmao : out ahb_dma_out_type;
321
      ahbi : in  ahb_mst_in_type;
322
      ahbo : out ahb_mst_out_type
323
      );
324
  end component;
325
 
326
  component pcif
327
  generic (
328
    device_id   : integer := 0; -- PCI device ID
329
    vendor_id   : integer := 0; -- PCI vendor ID
330
    class       : integer := 0;
331
    revision_id : integer := 0;
332
    aaddr_width : integer := 28;
333
    maddr_width : integer := 28;
334
    pcibars     : integer := 1;
335
    ahbmasters  : integer := 8;
336
    fifo_depth  : integer := 3;
337
    ft          : integer := 0;
338
 
339
    memtech   : integer := 0;
340
    hmstndx   : integer := 0;
341
    hslvndx   : integer := 0;
342
    pindex    : integer := 0;
343
    paddr     : integer := 0;
344
    pmask     : integer := 16#fff#;
345
    haddr     : integer := 16#F00#;
346
    hmask     : integer := 16#F00#);
347
  port(
348
      rst       : in std_logic;
349
      pciclk    : in std_logic;
350
      pcii      : in  pci_in_type;
351
      pcio      : out pci_out_type;
352
      apbi      : in  apb_slv_in_type;
353
      apbo      : out apb_slv_out_type;
354
      ahbmi     : in  ahb_mst_in_type;
355
      ahbmo     : out ahb_mst_out_type;
356
      ahbsi     : in  ahb_slv_in_type;
357
      ahbso     : out ahb_slv_out_type);
358
      --debug     : out std_logic_vector(233 downto 0));
359
  end component;
360
 
361
  component pcif_async
362
  generic (
363
    device_id   : integer := 0;  -- PCI device ID
364
    vendor_id   : integer := 0;  -- PCI vendor ID
365
    class       : integer := 0;
366
    revision_id : integer := 0;
367
    bar1        : integer := 20;
368
    bar2        : integer := 24;
369
    bar3        : integer := 0;
370
    bar4        : integer := 0;
371
    ahbmasters  : integer := 28;
372
    fifo_depth  : integer := 1;
373
    ft          : integer := 0;
374
    nsync       : integer := 2;
375
    irqctrl     : integer := 0;
376
    host        : integer := 0;
377
 
378
    memtech   : integer := 0;
379
    hmstndx   : integer := 0;
380
    hslvndx   : integer := 0;
381
    pindex    : integer := 0;
382
    paddr     : integer := 0;
383
    pmask     : integer := 16#fff#;
384
    haddr     : integer := 16#F00#;
385
    hmask     : integer := 16#F00#;
386
    ioaddr    : integer := 16#000#;
387
    pirq      : integer := 0;
388
    netlist   : integer := 0;
389
    debugen   : integer := 0;
390
    hostrst   : integer := 0
391
  );
392
   port(
393
      rst       : in std_logic;
394
      clk       : in std_logic;
395
      pcirst    : in std_logic;
396
      pciclk    : in std_logic;
397
      pcii      : in  pci_in_type;
398
      pcio      : out pci_out_type;
399
      apbi      : in  apb_slv_in_type;
400
      apbo      : out apb_slv_out_type;
401
      ahbmi     : in  ahb_mst_in_type;
402
      ahbmo     : out ahb_mst_out_type;
403
      ahbsi     : in  ahb_slv_in_type;
404
      ahbso     : out ahb_slv_out_type--;
405
      --debug     : out std_logic_vector(255 downto 0)
406
   );
407
end component;
408
 
409
  constant PCI_VENDOR_ESA      : integer := 16#16E3#;
410
  constant PCI_VENDOR_GAISLER  : integer := 16#1AC8#;
411
  constant PCI_VENDOR_AEROFLEX : integer := 16#1AD0#;
412
 
413
end;

powered by: WebSVN 2.1.0

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