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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [techmap/] [maps/] [clkand.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
-- Entity:      clkand
20
-- File:        clkand.vhd
21
-- Author:      Jiri Gaisler - Gaisler Research
22
-- Description: Clock gating
23
------------------------------------------------------------------------------
24
 
25
library ieee;
26
use ieee.std_logic_1164.all;
27
use work.gencomp.all;
28
use work.allclkgen.all;
29
 
30
entity clkand is
31
  generic( tech : integer := 0;
32
           ren  : integer range 0 to 1 := 0); -- registered enable
33
  port(
34
    i      :  in  std_ulogic;
35
    en     :  in  std_ulogic;
36
    o      :  out std_ulogic
37
  );
38
end entity;
39
 
40
architecture rtl of clkand is
41
signal eni : std_ulogic;
42
begin
43
 
44
  re : if ren = 1 generate
45
    renproc : process(i)
46
    begin
47
      if falling_edge(i) then eni <= en; end if;
48
    end process;
49
  end generate;
50
 
51
  ce : if ren = 0 generate eni <= en; end generate;
52
 
53
  xil : if (tech = virtex2) or (tech = spartan3) or (tech = spartan3e)
54
          or (tech = virtex4) or (tech = virtex5) generate
55
    clkgate : clkand_unisim port map(I => i, en => eni, O => o);
56
  end generate;
57
 
58
  ut : if (tech = ut25) generate
59
    clkgate : clkand_ut025crh port map(I => i, en => eni, O => o);
60
  end generate;
61
 
62
  gen : if has_clkand(tech) = 0 generate
63
    o <= i and eni;
64
  end generate;
65
end architecture;
66
 
67
 
68
 
69
 

powered by: WebSVN 2.1.0

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