1 |
12 |
wfjm |
-- $Id: xlib.vhd 389 2011-07-07 21:59:00Z mueller $
|
2 |
2 |
wfjm |
--
|
3 |
8 |
wfjm |
-- Copyright 2007-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
2 |
wfjm |
--
|
5 |
|
|
-- This program is free software; you may redistribute and/or modify it under
|
6 |
|
|
-- the terms of the GNU General Public License as published by the Free
|
7 |
|
|
-- Software Foundation, either version 2, or at your option any later version.
|
8 |
|
|
--
|
9 |
|
|
-- This program is distributed in the hope that it will be useful, but
|
10 |
|
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
11 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12 |
|
|
-- for complete details.
|
13 |
|
|
--
|
14 |
|
|
------------------------------------------------------------------------------
|
15 |
|
|
-- Package Name: xlib
|
16 |
|
|
-- Description: Xilinx specific components
|
17 |
|
|
--
|
18 |
|
|
-- Dependencies: -
|
19 |
|
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
|
20 |
|
|
-- Revision History:
|
21 |
|
|
-- Date Rev Version Comment
|
22 |
8 |
wfjm |
-- 2010-11-07 337 1.0.5 add dcm_sp_sfs
|
23 |
2 |
wfjm |
-- 2008-05-23 149 1.0.4 add iob_io(_gen)
|
24 |
|
|
-- 2008-05-22 148 1.0.3 add iob_keeper(_gen);
|
25 |
|
|
-- 2008-05-18 147 1.0.2 add PULL generic to iob_reg_io(_gen)
|
26 |
|
|
-- 2007-12-16 101 1.0.1 add INIT generic ports
|
27 |
|
|
-- 2007-12-08 100 1.0 Initial version
|
28 |
|
|
------------------------------------------------------------------------------
|
29 |
|
|
|
30 |
|
|
library ieee;
|
31 |
|
|
use ieee.std_logic_1164.all;
|
32 |
|
|
|
33 |
|
|
use work.slvtypes.all;
|
34 |
|
|
|
35 |
|
|
package xlib is
|
36 |
|
|
|
37 |
|
|
component iob_reg_i is -- registered IOB, input
|
38 |
|
|
generic (
|
39 |
|
|
INIT : slbit := '0'); -- initial state
|
40 |
|
|
port (
|
41 |
|
|
CLK : in slbit; -- clock
|
42 |
|
|
CE : in slbit := '1'; -- clock enable
|
43 |
|
|
DI : out slbit; -- input data
|
44 |
|
|
PAD : in slbit -- i/o pad
|
45 |
|
|
);
|
46 |
|
|
end component;
|
47 |
|
|
|
48 |
|
|
component iob_reg_i_gen is -- registered IOB, input, vector
|
49 |
|
|
generic (
|
50 |
|
|
DWIDTH : positive := 16; -- data port width
|
51 |
|
|
INIT : slbit := '0'); -- initial state
|
52 |
|
|
port (
|
53 |
|
|
CLK : in slbit; -- clock
|
54 |
|
|
CE : in slbit := '1'; -- clock enable
|
55 |
|
|
DI : out slv(DWIDTH-1 downto 0); -- input data
|
56 |
|
|
PAD : in slv(DWIDTH-1 downto 0) -- i/o pad
|
57 |
|
|
);
|
58 |
|
|
end component;
|
59 |
|
|
|
60 |
|
|
component iob_reg_o is -- registered IOB, output
|
61 |
|
|
generic (
|
62 |
|
|
INIT : slbit := '0'); -- initial state
|
63 |
|
|
port (
|
64 |
|
|
CLK : in slbit; -- clock
|
65 |
|
|
CE : in slbit := '1'; -- clock enable
|
66 |
|
|
DO : in slbit; -- output data
|
67 |
|
|
PAD : out slbit -- i/o pad
|
68 |
|
|
);
|
69 |
|
|
end component;
|
70 |
|
|
|
71 |
|
|
component iob_reg_o_gen is -- registered IOB, output, vector
|
72 |
|
|
generic (
|
73 |
|
|
DWIDTH : positive := 16; -- data port width
|
74 |
|
|
INIT : slbit := '0'); -- initial state
|
75 |
|
|
port (
|
76 |
|
|
CLK : in slbit; -- clock
|
77 |
|
|
CE : in slbit := '1'; -- clock enable
|
78 |
|
|
DO : in slv(DWIDTH-1 downto 0); -- output data
|
79 |
|
|
PAD : out slv(DWIDTH-1 downto 0) -- i/o pad
|
80 |
|
|
);
|
81 |
|
|
end component;
|
82 |
|
|
|
83 |
|
|
component iob_reg_io is -- registered IOB, in/output
|
84 |
|
|
generic (
|
85 |
|
|
INITI : slbit := '0'; -- initial state ( in flop)
|
86 |
|
|
INITO : slbit := '0'; -- initial state (out flop)
|
87 |
|
|
INITE : slbit := '0'; -- initial state ( oe flop)
|
88 |
|
|
PULL : string := "NONE"); -- pull-up,-down or keeper
|
89 |
|
|
port (
|
90 |
|
|
CLK : in slbit; -- clock
|
91 |
|
|
CEI : in slbit := '1'; -- clock enable ( in flops)
|
92 |
|
|
CEO : in slbit := '1'; -- clock enable (out flops)
|
93 |
|
|
OE : in slbit; -- output enable
|
94 |
|
|
DI : out slbit; -- input data (read from pad)
|
95 |
|
|
DO : in slbit; -- output data (write to pad)
|
96 |
|
|
PAD : inout slbit -- i/o pad
|
97 |
|
|
);
|
98 |
|
|
end component;
|
99 |
|
|
|
100 |
|
|
component iob_reg_io_gen is -- registered IOB, in/output, vector
|
101 |
|
|
generic (
|
102 |
|
|
DWIDTH : positive := 16; -- data port width
|
103 |
|
|
INITI : slbit := '0'; -- initial state ( in flop)
|
104 |
|
|
INITO : slbit := '0'; -- initial state (out flop)
|
105 |
|
|
INITE : slbit := '0'; -- initial state ( oe flop)
|
106 |
|
|
PULL : string := "NONE"); -- pull-up,-down or keeper
|
107 |
|
|
port (
|
108 |
|
|
CLK : in slbit; -- clock
|
109 |
|
|
CEI : in slbit := '1'; -- clock enable ( in flops)
|
110 |
|
|
CEO : in slbit := '1'; -- clock enable (out flops)
|
111 |
|
|
OE : in slbit; -- output enable
|
112 |
|
|
DI : out slv(DWIDTH-1 downto 0); -- input data (read from pad)
|
113 |
|
|
DO : in slv(DWIDTH-1 downto 0); -- output data (write to pad)
|
114 |
|
|
PAD : inout slv(DWIDTH-1 downto 0) -- i/o pad
|
115 |
|
|
);
|
116 |
|
|
end component;
|
117 |
|
|
|
118 |
|
|
component iob_io is -- un-registered IOB, in/output
|
119 |
|
|
generic (
|
120 |
|
|
PULL : string := "NONE"); -- pull-up,-down or keeper
|
121 |
|
|
port (
|
122 |
|
|
OE : in slbit; -- output enable
|
123 |
|
|
DI : out slbit; -- input data (read from pad)
|
124 |
|
|
DO : in slbit; -- output data (write to pad)
|
125 |
|
|
PAD : inout slbit -- i/o pad
|
126 |
|
|
);
|
127 |
|
|
end component;
|
128 |
|
|
|
129 |
|
|
component iob_io_gen is -- un-registered IOB, in/output, vector
|
130 |
|
|
generic (
|
131 |
|
|
DWIDTH : positive := 16; -- data port width
|
132 |
|
|
PULL : string := "NONE"); -- pull-up,-down or keeper
|
133 |
|
|
port (
|
134 |
|
|
OE : in slbit; -- output enable
|
135 |
|
|
DI : out slv(DWIDTH-1 downto 0); -- input data (read from pad)
|
136 |
|
|
DO : in slv(DWIDTH-1 downto 0); -- output data (write to pad)
|
137 |
|
|
PAD : inout slv(DWIDTH-1 downto 0) -- i/o pad
|
138 |
|
|
);
|
139 |
|
|
end component;
|
140 |
|
|
|
141 |
|
|
component iob_keeper is -- keeper for IOB
|
142 |
|
|
port (
|
143 |
|
|
PAD : inout slbit -- i/o pad
|
144 |
|
|
);
|
145 |
|
|
end component;
|
146 |
|
|
|
147 |
|
|
component iob_keeper_gen is -- keeper for IOB, vector
|
148 |
|
|
generic (
|
149 |
|
|
DWIDTH : positive := 16); -- data port width
|
150 |
|
|
port (
|
151 |
|
|
PAD : inout slv(DWIDTH-1 downto 0) -- i/o pad
|
152 |
|
|
);
|
153 |
|
|
end component;
|
154 |
|
|
|
155 |
8 |
wfjm |
component dcm_sp_sfs is -- DCM_SP as 'simple freq. synthesis'
|
156 |
|
|
generic (
|
157 |
|
|
CLKFX_DIVIDE : positive := 2; -- FX clock divide (1-32)
|
158 |
|
|
CLKFX_MULTIPLY : positive := 2; -- FX clock divide (2-32)
|
159 |
|
|
CLKIN_PERIOD : real := 20.0); -- CLKIN period (def is 20.0 ns)
|
160 |
|
|
port (
|
161 |
|
|
CLKIN : in slbit; -- clock input
|
162 |
|
|
CLKFX : out slbit; -- clock output (synthesized freq.)
|
163 |
|
|
LOCKED : out slbit -- dcm locked
|
164 |
|
|
);
|
165 |
|
|
end component;
|
166 |
|
|
|
167 |
12 |
wfjm |
end package xlib;
|