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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.interface/] [clock/] [1.0/] [vhd/] [clk_gen.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : Clock generator for simulation
3
-- Project    : Nocbench & Funbase
4
-------------------------------------------------------------------------------
5
-- File       : clk_gen.vhd
6
-- Author     : ege
7
-- Created    : 2012-01-27
8
-- Last update: 2012-01-31
9
-- Description: Just toggles the 1-bit clock output forever.
10
-- 
11
-------------------------------------------------------------------------------
12
-- Copyright (c) 2010
13
-------------------------------------------------------------------------------
14
-- Revisions  :
15
-- Date        Version  Author  Description
16
-- April 2010   1.0     ege     First version
17
-------------------------------------------------------------------------------
18
-------------------------------------------------------------------------------
19
-- Funbase IP library Copyright (C) 2011 TUT Department of Computer Systems
20
--
21
--
22
-- This source file may be used and distributed without
23
-- restriction provided that this copyright statement is not
24
-- removed from the file and that any derivative work contains
25
-- the original copyright notice and the associated disclaimer.
26
--
27
-- This source file is free software; you can redistribute it
28
-- and/or modify it under the terms of the GNU Lesser General
29
-- Public License as published by the Free Software Foundation;
30
-- either version 2.1 of the License, or (at your option) any
31
-- later version.
32
--
33
-- This source is distributed in the hope that it will be
34
-- useful, but WITHOUT ANY WARRANTY; without even the implied
35
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
36
-- PURPOSE.  See the GNU Lesser General Public License for more
37
-- details.
38
--
39
-- You should have received a copy of the GNU Lesser General
40
-- Public License along with this source; if not, download it
41
-- from http://www.opencores.org/lgpl.shtml
42
-------------------------------------------------------------------------------
43
library ieee;
44
use ieee.std_logic_1164.all;
45
 
46
entity clk_gen is
47
 
48
  generic (
49
    hi_period_ns_g : integer := 1;      -- In nanoseconds
50
    lo_period_ns_g : integer := 1       -- In nanoseconds
51
    );
52
  port (
53
    clk_out : out std_logic
54
    );
55
 
56
end clk_gen;
57
 
58
architecture behav of clk_gen is
59
 
60
  signal clk_tmp : std_logic := '0';
61
 
62
begin  -- behav
63
 
64
  clk_out <= clk_tmp;
65
 
66
  toggle : process (clk_tmp)
67
  begin  -- process toggle
68
    if clk_tmp = '0' then
69
      clk_tmp <= '1' after lo_period_ns_g * 1 ns;
70
    else
71
      clk_tmp <= '0' after hi_period_ns_g * 1 ns;
72
    end if;
73
  end process toggle;
74
 
75
 
76
 
77
end behav;

powered by: WebSVN 2.1.0

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