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: iopad
|
20 |
|
|
-- File: iopad.vhd
|
21 |
|
|
-- Author: Nils Johan Wessman - Gaisler Research
|
22 |
|
|
-- Description: differential io pad with technology wrapper
|
23 |
|
|
------------------------------------------------------------------------------
|
24 |
|
|
|
25 |
|
|
library techmap;
|
26 |
|
|
library ieee;
|
27 |
|
|
use ieee.std_logic_1164.all;
|
28 |
|
|
use techmap.gencomp.all;
|
29 |
|
|
use techmap.allpads.all;
|
30 |
|
|
|
31 |
|
|
entity iopad_ds is
|
32 |
|
|
generic (tech : integer := 0; level : integer := 0; slew : integer := 0;
|
33 |
|
|
voltage : integer := x33v; strength : integer := 12;
|
34 |
|
|
oepol : integer := 0);
|
35 |
|
|
port (padp, padn : inout std_ulogic; i, en : in std_ulogic; o : out std_ulogic);
|
36 |
|
|
end;
|
37 |
|
|
|
38 |
|
|
architecture rtl of iopad_ds is
|
39 |
|
|
signal oen : std_ulogic;
|
40 |
|
|
begin
|
41 |
|
|
oen <= not en when oepol /= padoen_polarity(tech) else en;
|
42 |
|
|
gen0 : if has_pads(tech) = 0 generate
|
43 |
|
|
padp <= i after 2 ns when oen = '0'
|
44 |
|
|
-- pragma translate_off
|
45 |
|
|
else 'X' after 2 ns when is_x(oen)
|
46 |
|
|
-- pragma translate_on
|
47 |
|
|
else 'Z' after 2 ns;
|
48 |
|
|
padn <= not i after 2 ns when oen = '0'
|
49 |
|
|
-- pragma translate_off
|
50 |
|
|
else 'X' after 2 ns when is_x(oen)
|
51 |
|
|
-- pragma translate_on
|
52 |
|
|
else 'Z' after 2 ns;
|
53 |
|
|
o <= to_X01(padp) after 1 ns;
|
54 |
|
|
end generate;
|
55 |
|
|
xcv : if (tech = virtex5) generate
|
56 |
|
|
x0 : virtex5_iopad_ds generic map (level, slew, voltage, strength)
|
57 |
|
|
port map (padp, padn, i, oen, o);
|
58 |
|
|
end generate;
|
59 |
|
|
end;
|
60 |
|
|
|
61 |
|
|
library techmap;
|
62 |
|
|
library ieee;
|
63 |
|
|
use ieee.std_logic_1164.all;
|
64 |
|
|
use techmap.gencomp.all;
|
65 |
|
|
|
66 |
|
|
entity iopad_dsv is
|
67 |
|
|
generic (tech : integer := 0; level : integer := 0; slew : integer := 0;
|
68 |
|
|
voltage : integer := x33v; strength : integer := 12; width : integer := 1;
|
69 |
|
|
oepol : integer := 0);
|
70 |
|
|
port (
|
71 |
|
|
padp, padn : inout std_logic_vector(width-1 downto 0);
|
72 |
|
|
i : in std_logic_vector(width-1 downto 0);
|
73 |
|
|
en : in std_ulogic;
|
74 |
|
|
o : out std_logic_vector(width-1 downto 0));
|
75 |
|
|
end;
|
76 |
|
|
architecture rtl of iopad_dsv is
|
77 |
|
|
begin
|
78 |
|
|
v : for j in width-1 downto 0 generate
|
79 |
|
|
x0 : iopad_ds generic map (tech, level, slew, voltage, strength, oepol)
|
80 |
|
|
port map (padp(j), padn(j), i(j), en, o(j));
|
81 |
|
|
end generate;
|
82 |
|
|
end;
|
83 |
|
|
|
84 |
|
|
library techmap;
|
85 |
|
|
library ieee;
|
86 |
|
|
use ieee.std_logic_1164.all;
|
87 |
|
|
use techmap.gencomp.all;
|
88 |
|
|
|
89 |
|
|
entity iopad_dsvv is
|
90 |
|
|
generic (tech : integer := 0; level : integer := 0; slew : integer := 0;
|
91 |
|
|
voltage : integer := x33v; strength : integer := 12; width : integer := 1;
|
92 |
|
|
oepol : integer := 0);
|
93 |
|
|
port (
|
94 |
|
|
padp, padn : inout std_logic_vector(width-1 downto 0);
|
95 |
|
|
i : in std_logic_vector(width-1 downto 0);
|
96 |
|
|
en : in std_logic_vector(width-1 downto 0);
|
97 |
|
|
o : out std_logic_vector(width-1 downto 0));
|
98 |
|
|
end;
|
99 |
|
|
architecture rtl of iopad_dsvv is
|
100 |
|
|
begin
|
101 |
|
|
v : for j in width-1 downto 0 generate
|
102 |
|
|
x0 : iopad_ds generic map (tech, level, slew, voltage, strength, oepol)
|
103 |
|
|
port map (padp(j), padn(j), i(j), en(j), o(j));
|
104 |
|
|
end generate;
|
105 |
|
|
end;
|