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

Subversion Repositories w11

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

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

Line No. Rev Author Line
1 13 wfjm
-- $Id: simclkcnt.vhd 423 2011-11-12 22:22:25Z 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 13 wfjm
-- Tool versions:  xst 12.1, 13.1; ghdl 0.29
22 8 wfjm
--
23
-- Revision History: 
24
-- Date         Rev Version  Comment
25 13 wfjm
-- 2011-11-12   423   1.0.1  now numeric_std clean
26 8 wfjm
-- 2010-11-13    72   1.0    Initial version 
27
------------------------------------------------------------------------------
28
 
29
library ieee;
30
use ieee.std_logic_1164.all;
31 13 wfjm
use ieee.numeric_std.all;
32 8 wfjm
use work.slvtypes.all;
33
 
34
entity simclkcnt is                   -- test bench system clock cycle counter
35
  port (
36
    CLK  : in slbit;                  -- clock
37
    CLK_CYCLE  : out slv31            -- clock cycle number
38
  );
39
end entity simclkcnt;
40
 
41
architecture sim of simclkcnt is
42
  signal R_CLKCNT : slv31 := (others=>'0');
43
begin
44
 
45
  proc_clk: process (CLK)
46
  begin
47
 
48 13 wfjm
    if rising_edge(CLK) then
49
      R_CLKCNT <= slv(unsigned(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.