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: grethm
|
20 |
|
|
-- File: grethm.vhd
|
21 |
|
|
-- Author: Jiri Gaisler
|
22 |
|
|
-- Description: Module to select between greth and greth1g
|
23 |
|
|
------------------------------------------------------------------------------
|
24 |
|
|
library ieee;
|
25 |
|
|
library grlib;
|
26 |
|
|
library gaisler;
|
27 |
|
|
use ieee.std_logic_1164.all;
|
28 |
|
|
use grlib.stdlib.all;
|
29 |
|
|
use grlib.amba.all;
|
30 |
|
|
library techmap;
|
31 |
|
|
use techmap.gencomp.all;
|
32 |
|
|
use gaisler.net.all;
|
33 |
|
|
|
34 |
|
|
entity grethm is
|
35 |
|
|
generic(
|
36 |
|
|
hindex : integer := 0;
|
37 |
|
|
pindex : integer := 0;
|
38 |
|
|
paddr : integer := 0;
|
39 |
|
|
pmask : integer := 16#FFF#;
|
40 |
|
|
pirq : integer := 0;
|
41 |
|
|
memtech : integer := 0;
|
42 |
|
|
ifg_gap : integer := 24;
|
43 |
|
|
attempt_limit : integer := 16;
|
44 |
|
|
backoff_limit : integer := 10;
|
45 |
|
|
slot_time : integer := 128;
|
46 |
|
|
mdcscaler : integer range 0 to 255 := 25;
|
47 |
|
|
enable_mdio : integer range 0 to 1 := 0;
|
48 |
|
|
fifosize : integer range 4 to 64 := 8;
|
49 |
|
|
nsync : integer range 1 to 2 := 2;
|
50 |
|
|
edcl : integer range 0 to 1 := 0;
|
51 |
|
|
edclbufsz : integer range 1 to 64 := 1;
|
52 |
|
|
burstlength : integer range 4 to 128 := 32;
|
53 |
|
|
macaddrh : integer := 16#00005E#;
|
54 |
|
|
macaddrl : integer := 16#000000#;
|
55 |
|
|
ipaddrh : integer := 16#c0a8#;
|
56 |
|
|
ipaddrl : integer := 16#0035#;
|
57 |
|
|
phyrstadr : integer range 0 to 32 := 0;
|
58 |
|
|
rmii : integer range 0 to 1 := 0;
|
59 |
|
|
sim : integer range 0 to 1 := 0;
|
60 |
|
|
giga : integer range 0 to 1 := 0;
|
61 |
|
|
oepol : integer range 0 to 1 := 0;
|
62 |
|
|
scanen : integer range 0 to 1 := 0
|
63 |
|
|
);
|
64 |
|
|
port(
|
65 |
|
|
rst : in std_ulogic;
|
66 |
|
|
clk : in std_ulogic;
|
67 |
|
|
ahbmi : in ahb_mst_in_type;
|
68 |
|
|
ahbmo : out ahb_mst_out_type;
|
69 |
|
|
apbi : in apb_slv_in_type;
|
70 |
|
|
apbo : out apb_slv_out_type;
|
71 |
|
|
ethi : in eth_in_type;
|
72 |
|
|
etho : out eth_out_type
|
73 |
|
|
);
|
74 |
|
|
end entity;
|
75 |
|
|
|
76 |
|
|
architecture rtl of grethm is
|
77 |
|
|
begin
|
78 |
|
|
|
79 |
|
|
m100 : if giga = 0 generate
|
80 |
|
|
u0 : greth generic map ( hindex, pindex, paddr, pmask, pirq,
|
81 |
|
|
memtech, ifg_gap, attempt_limit, backoff_limit, slot_time, mdcscaler,
|
82 |
|
|
enable_mdio, fifosize, nsync, edcl, edclbufsz, macaddrh, macaddrl,
|
83 |
|
|
ipaddrh, ipaddrl, phyrstadr, rmii, oepol, scanen)
|
84 |
|
|
port map ( rst, clk, ahbmi, ahbmo, apbi, apbo, ethi, etho);
|
85 |
|
|
|
86 |
|
|
end generate;
|
87 |
|
|
|
88 |
|
|
m1000 : if giga = 1 generate
|
89 |
|
|
u0 : greth_gbit generic map ( hindex, pindex, paddr, pmask, pirq,
|
90 |
|
|
memtech, ifg_gap, attempt_limit, backoff_limit, slot_time, mdcscaler,
|
91 |
|
|
nsync, edcl, edclbufsz, burstlength, macaddrh, macaddrl, ipaddrh,
|
92 |
|
|
ipaddrl, phyrstadr, sim, oepol, scanen)
|
93 |
|
|
port map ( rst, clk, ahbmi, ahbmo, apbi, apbo, ethi, etho);
|
94 |
|
|
end generate;
|
95 |
|
|
|
96 |
|
|
end architecture;
|
97 |
|
|
|