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/] [greth/] [ethernet_mac.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
 
20
library ieee;
21
use ieee.std_logic_1164.all;
22
library gaisler;
23
use gaisler.net.all;
24
library grlib;
25
use grlib.amba.all;
26
library techmap;
27
use techmap.gencomp.all;
28
 
29
package ethernet_mac is
30
  type eth_tx_in_type is record
31
    start          : std_ulogic;
32
    valid          : std_ulogic;
33
    data           : std_logic_vector(31 downto 0);
34
    full_duplex    : std_ulogic;
35
    length         : std_logic_vector(10 downto 0);
36
    col            : std_ulogic;
37
    crs            : std_ulogic;
38
    read_ack       : std_ulogic;
39
  end record;
40
 
41
  type eth_tx_out_type is record
42
    status         : std_logic_vector(1 downto 0);
43
    done           : std_ulogic;
44
    restart        : std_ulogic;
45
    read           : std_ulogic;
46
    tx_er          : std_ulogic;
47
    tx_en          : std_ulogic;
48
    txd            : std_logic_vector(3 downto 0);
49
  end record;
50
 
51
  type eth_rx_in_type is record
52
    writeok        : std_ulogic;
53
    rxen           : std_ulogic;
54
    rx_dv          : std_ulogic;
55
    rx_er          : std_ulogic;
56
    rxd            : std_logic_vector(3 downto 0);
57
    done_ack       : std_ulogic;
58
    write_ack      : std_ulogic;
59
  end record;
60
 
61
  type eth_rx_out_type is record
62
    write          : std_ulogic;
63
    data           : std_logic_vector(31 downto 0);
64
    done           : std_ulogic;
65
    length         : std_logic_vector(10 downto 0);
66
    status         : std_logic_vector(2 downto 0);
67
    start          : std_ulogic;
68
  end record;
69
 
70
  type eth_mdio_in_type is record
71
    mdioi          : std_ulogic;
72
    write          : std_ulogic;
73
    read           : std_ulogic;
74
    mdiostart      : std_ulogic;
75
    regadr         : std_logic_vector(4 downto 0);
76
    phyadr         : std_logic_vector(4 downto 0);
77
    data           : std_logic_vector(15 downto 0);
78
  end record;
79
 
80
  type eth_mdio_out_type is record
81
    mdc            : std_ulogic;
82
    mdioo          : std_ulogic;
83
    mdioen         : std_ulogic;
84
    data           : std_logic_vector(15 downto 0);
85
    done           : std_ulogic;
86
    error          : std_ulogic;
87
  end record;
88
 
89
  type eth_tx_ahb_in_type is record
90
    req     : std_ulogic;
91
    write   : std_ulogic;
92
    addr    : std_logic_vector(31 downto 0);
93
    data    : std_logic_vector(31 downto 0);
94
  end record;
95
 
96
  type eth_tx_ahb_out_type is record
97
    grant    : std_ulogic;
98
    data     : std_logic_vector(31 downto 0);
99
    ready    : std_ulogic;
100
    error    : std_ulogic;
101
    retry    : std_ulogic;
102
  end record;
103
 
104
  type eth_rx_ahb_in_type is record
105
    req     : std_ulogic;
106
    write   : std_ulogic;
107
    addr    : std_logic_vector(31 downto 0);
108
    data    : std_logic_vector(31 downto 0);
109
  end record;
110
 
111
  type eth_rx_ahb_out_type is record
112
    grant   : std_ulogic;
113
    ready   : std_ulogic;
114
    error   : std_ulogic;
115
    retry   : std_ulogic;
116
    data    : std_logic_vector(31 downto 0);
117
  end record;
118
 
119
  type eth_rx_gbit_ahb_in_type is record
120
    req     : std_ulogic;
121
    write   : std_ulogic;
122
    addr    : std_logic_vector(31 downto 0);
123
    data    : std_logic_vector(31 downto 0);
124
    size    : std_logic_vector(1 downto 0);
125
  end record;
126
 
127
  component eth_ahb_mst is
128
    generic(
129
      hindex      : integer := 0;
130
      revision    : integer := 0;
131
      irq         : integer := 0);
132
    port(
133
      rst     : in  std_ulogic;
134
      clk     : in  std_ulogic;
135
      ahbmi   : in  ahb_mst_in_type;
136
      ahbmo   : out ahb_mst_out_type;
137
      tmsti   : in  eth_tx_ahb_in_type;
138
      tmsto   : out eth_tx_ahb_out_type;
139
      rmsti   : in  eth_rx_ahb_in_type;
140
      rmsto   : out eth_rx_ahb_out_type
141
    );
142
  end component;
143
 
144
  component eth_ahb_mst_gbit is
145
    generic(
146
      hindex      : integer := 0;
147
      revision    : integer := 0;
148
      irq         : integer := 0);
149
    port(
150
      rst     : in  std_ulogic;
151
      clk     : in  std_ulogic;
152
      ahbmi   : in  ahb_mst_in_type;
153
      ahbmo   : out ahb_mst_out_type;
154
      tmsti   : in  eth_tx_ahb_in_type;
155
      tmsto   : out eth_tx_ahb_out_type;
156
      rmsti   : in  eth_rx_gbit_ahb_in_type;
157
      rmsto   : out eth_rx_ahb_out_type
158
    );
159
  end component;
160
 
161
  component greth is
162
    generic(
163
      hindex         : integer := 0;
164
      pindex         : integer := 0;
165
      paddr          : integer := 0;
166
      pmask          : integer := 16#FFF#;
167
      pirq           : integer := 0;
168
      memtech        : integer := inferred;
169
      ifg_gap        : integer := 24;
170
      attempt_limit  : integer := 16;
171
      backoff_limit  : integer := 10;
172
      slot_time      : integer := 128;
173
      mdcscaler      : integer range 0 to 255 := 25;
174
      enable_mdio    : integer range 0 to 1 := 0;
175
      fifosize       : integer range 4 to 512 := 8;
176
      nsync          : integer range 1 to 2 := 2;
177
      edcl           : integer range 0 to 1 := 0;
178
      edclbufsz      : integer range 1 to 64 := 1;
179
      macaddrh       : integer := 16#00005E#;
180
      macaddrl       : integer := 16#000000#;
181
      ipaddrh        : integer := 16#c0a8#;
182
      ipaddrl        : integer := 16#0035#;
183
      phyrstadr      : integer := 0);
184
    port(
185
      rst            : in  std_ulogic;
186
      clk            : in  std_ulogic;
187
      ahbmi          : in  ahb_mst_in_type;
188
      ahbmo          : out ahb_mst_out_type;
189
      apbi           : in  apb_slv_in_type;
190
      apbo           : out apb_slv_out_type;
191
      ethi           : in  eth_in_type;
192
      etho           : out eth_out_type
193
    );
194
  end component;
195
end package;

powered by: WebSVN 2.1.0

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