1 |
2 |
slavek |
----------------------------------------------------------------------
|
2 |
|
|
---- ----
|
3 |
|
|
---- Shift register ----
|
4 |
|
|
---- ----
|
5 |
|
|
---- Author(s): ----
|
6 |
|
|
---- - Slavek Valach, s.valach@dspfpga.com ----
|
7 |
|
|
---- ----
|
8 |
|
|
----------------------------------------------------------------------
|
9 |
|
|
---- ----
|
10 |
|
|
---- Copyright (C) 2008 Authors and OPENCORES.ORG ----
|
11 |
|
|
---- ----
|
12 |
|
|
---- This source file may be used and distributed without ----
|
13 |
|
|
---- restriction provided that this copyright statement is not ----
|
14 |
|
|
---- removed from the file and that any derivative work contains ----
|
15 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
16 |
|
|
---- ----
|
17 |
|
|
---- This source file is free software; you can redistribute it ----
|
18 |
|
|
---- and/or modify it under the terms of the GNU General ----
|
19 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
20 |
|
|
---- either version 2.0 of the License, or (at your option) any ----
|
21 |
|
|
---- later version. ----
|
22 |
|
|
---- ----
|
23 |
|
|
---- This source is distributed in the hope that it will be ----
|
24 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
25 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
26 |
|
|
---- PURPOSE. See the GNU General Public License for more details.----
|
27 |
|
|
---- ----
|
28 |
|
|
---- You should have received a copy of the GNU General ----
|
29 |
|
|
---- Public License along with this source; if not, download it ----
|
30 |
|
|
---- from http://www.gnu.org/licenses/gpl.txt ----
|
31 |
|
|
---- ----
|
32 |
|
|
----------------------------------------------------------------------
|
33 |
|
|
|
34 |
|
|
library ieee;
|
35 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
36 |
|
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
37 |
|
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
38 |
|
|
library UNISIM;
|
39 |
|
|
use UNISIM.VCOMPONENTS.all;
|
40 |
|
|
|
41 |
|
|
-------------------------------------------------------------------------------
|
42 |
|
|
-- Entity section
|
43 |
|
|
-----------------------------------------------------------------------------
|
44 |
|
|
|
45 |
|
|
entity delay is
|
46 |
|
|
port (
|
47 |
|
|
CLK : in std_logic; -- Input clock
|
48 |
|
|
ADD_DELAY : in std_logic_vector(3 downto 0);
|
49 |
|
|
D_IN : in std_logic;
|
50 |
|
|
D_OUT : out std_logic);
|
51 |
|
|
end delay;
|
52 |
|
|
|
53 |
|
|
-----------------------------------------------------------------------------
|
54 |
|
|
-- Architecture section
|
55 |
|
|
-----------------------------------------------------------------------------
|
56 |
|
|
architecture implementation of delay is
|
57 |
|
|
|
58 |
|
|
constant gnd : std_logic := '0';
|
59 |
|
|
constant vcc : std_logic := '1';
|
60 |
|
|
|
61 |
|
|
BEGIN
|
62 |
|
|
|
63 |
|
|
SRL16_I : SRL16
|
64 |
|
|
-- pragma translate_off
|
65 |
|
|
generic map (
|
66 |
|
|
INIT => x"0000")
|
67 |
|
|
-- pragma translate_on
|
68 |
|
|
port map (
|
69 |
|
|
D => D_IN,
|
70 |
|
|
Clk => Clk,
|
71 |
|
|
A0 => ADD_DELAY(0),
|
72 |
|
|
A1 => ADD_DELAY(1),
|
73 |
|
|
A2 => ADD_DELAY(2),
|
74 |
|
|
A3 => ADD_DELAY(3),
|
75 |
|
|
Q => D_OUT);
|
76 |
|
|
|
77 |
|
|
end implementation;
|