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/] [gaisler/] [pci/] [pcitb_clkgen.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:      pcitb_clkgen
20
-- File:        pcitb_clkgen.vhd
21
-- Author:      Alf Vaerneus, Gaisler Research
22
-- Description: PCI clock & reset generator
23
------------------------------------------------------------------------------
24
 
25
-- pragma translate_off
26
 
27
library ieee;
28
use ieee.std_logic_1164.all;
29
 
30
library gaisler;
31
use gaisler.pcitb.all;
32
 
33
entity pcitb_clkgen is
34
  generic (
35
    mhz66 : boolean := false;
36
    rstclocks : integer := 20);
37
  port (
38
    rsttrig : in std_logic;
39
    systclk : out pci_syst_type);
40
end pcitb_clkgen;
41
 
42
architecture tb of pcitb_clkgen is
43
 
44
signal clk : std_logic;
45
 
46
begin
47
 
48
  systclk.clk <= clk;
49
 
50
  clkgen: process
51
  begin
52
    if mhz66 then
53
      clk <= '1';
54
      wait for 7 ns;
55
      clk <= '0';
56
      wait for 8 ns;
57
    else
58
      clk <= '1';
59
      wait for 15 ns;
60
      clk <= '0';
61
      wait for 15 ns;
62
    end if;
63
  end process;
64
 
65
  reset : process
66
  begin
67
    if rsttrig = '1' then
68
      systclk.rst <= '0';
69
      if mhz66 then
70
        wait for rstclocks*15 ns;
71
      else
72
        wait for rstclocks*30 ns;
73
      end if;
74
      wait until clk = '1';
75
    end if;
76
    systclk.rst <= '1';
77
    wait for 1 ns;
78
  end process;
79
 
80
end;
81
 
82
-- pragma translate_on

powered by: WebSVN 2.1.0

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