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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [rtl/] [vlib/] [simlib/] [simclkcnt.vhd] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 wfjm
-- $Id: simclkcnt.vhd 649 2015-02-21 21:10:16Z mueller $
2 8 wfjm
--
3 13 wfjm
-- Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 8 wfjm
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
--
14
------------------------------------------------------------------------------
15
-- Module Name:    simclkcnt - sim
16
-- Description:    test bench system clock cycle counter
17
--
18
-- Dependencies:   -
19
-- Test bench:     -
20
-- Target Devices: generic
21 29 wfjm
-- Tool versions:  xst 12.1-14.7; ghdl 0.29-0.31
22 8 wfjm
--
23
-- Revision History: 
24
-- Date         Rev Version  Comment
25 17 wfjm
-- 2011-12-23   444   2.0    CLK_CYCLE now an integer
26 13 wfjm
-- 2011-11-12   423   1.0.1  now numeric_std clean
27 8 wfjm
-- 2010-11-13    72   1.0    Initial version 
28
------------------------------------------------------------------------------
29
 
30
library ieee;
31
use ieee.std_logic_1164.all;
32
use work.slvtypes.all;
33
 
34
entity simclkcnt is                   -- test bench system clock cycle counter
35
  port (
36
    CLK  : in slbit;                  -- clock
37 17 wfjm
    CLK_CYCLE  : out integer          -- clock cycle number
38 8 wfjm
  );
39
end entity simclkcnt;
40
 
41
architecture sim of simclkcnt is
42 17 wfjm
  signal R_CLKCNT : integer := 0;
43 8 wfjm
begin
44
 
45
  proc_clk: process (CLK)
46
  begin
47
 
48 13 wfjm
    if rising_edge(CLK) then
49 17 wfjm
      R_CLKCNT <= R_CLKCNT + 1;
50 8 wfjm
    end if;
51
 
52
  end process proc_clk;
53
 
54
  CLK_CYCLE <= R_CLKCNT;
55
 
56
end sim;

powered by: WebSVN 2.1.0

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