OpenCores
URL https://opencores.org/ocsvn/mips_enhanced/mips_enhanced/trunk

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [designs/] [leon3-altera-ep3sl150/] [delay_wire.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
-- Delayed bidirectional wire 
20
-- 
21
------------------------------------------------------------------------------
22
 
23
library ieee;
24
use ieee.std_logic_1164.all;
25
 
26
entity delay_wire is
27
  generic(
28
    data_width  : integer := 1;
29
    delay_atob  : real := 0.0;
30
    delay_btoa  : real := 0.0
31
  );
32
  port(
33
    a : inout std_logic_vector(data_width-1 downto 0);
34
    b : inout std_logic_vector(data_width-1 downto 0)
35
  );
36
end delay_wire;
37
 
38
architecture rtl of delay_wire is
39
 
40
signal a_dly,b_dly : std_logic_vector(data_width-1 downto 0) := (others => 'Z');
41
constant zvector : std_logic_vector(data_width-1 downto 0) := (others => 'Z');
42
 
43
begin
44
 
45
  process(a)
46
  begin
47
    if a'event then
48
      if b_dly = zvector then
49
        a_dly <= transport a after delay_atob*1 ns;
50
      else
51
        a_dly <= (others => 'Z');
52
      end if;
53
    end if;
54
  end process;
55
 
56
  process(b)
57
  begin
58
    if b'event then
59
      if a_dly = zvector then
60
        b_dly <= transport b after delay_btoa*1 ns;
61
      else
62
        b_dly <= (others => 'Z');
63
      end if;
64
    end if;
65
  end process;
66
 
67
  a <= b_dly; b <= a_dly;
68
 
69
end;

powered by: WebSVN 2.1.0

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