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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [vlib/] [genlib/] [clkdivce.vhd] - Diff between revs 8 and 13

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 8 Rev 13
Line 1... Line 1...
-- $Id: clkdivce.vhd 341 2010-11-27 23:05:43Z mueller $
-- $Id: clkdivce.vhd 418 2011-10-23 20:11:40Z mueller $
--
--
-- Copyright 2007-2008 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2007-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
--
-- This program is free software; you may redistribute and/or modify it under
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
-- Software Foundation, either version 2, or at your option any later version.
--
--
Line 16... Line 16...
-- Description:    Generate usec and msec enable signals
-- Description:    Generate usec and msec enable signals
--
--
-- Dependencies:   -
-- Dependencies:   -
-- Test bench:     -
-- Test bench:     -
-- Target Devices: generic
-- Target Devices: generic
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2, 12.1; ghdl 0.18-0.29
-- Tool versions:  xst 8.2, 9.1, 9.2, 12.1, 13.1; ghdl 0.18-0.29
-- Revision History: 
-- Revision History: 
-- Date        Rev  Version    Comment
-- Date        Rev  Version    Comment
 
-- 2011-10-22   418   1.0.3  now numeric_std clean
-- 2008-01-20   112   1.0.2  rename clkgen->clkdivce; remove SYS_CLK port
-- 2008-01-20   112   1.0.2  rename clkgen->clkdivce; remove SYS_CLK port
-- 2007-10-12    88   1.0.1  avoid ieee.std_logic_unsigned, use cast to unsigned
-- 2007-10-12    88   1.0.1  avoid ieee.std_logic_unsigned, use cast to unsigned
-- 2007-06-30    62   1.0    Initial version 
-- 2007-06-30    62   1.0    Initial version 
------------------------------------------------------------------------------
------------------------------------------------------------------------------
 
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.numeric_std.all;
 
 
use work.slvtypes.all;
use work.slvtypes.all;
 
 
entity clkdivce is                      -- generate usec/msec ce pulses
entity clkdivce is                      -- generate usec/msec ce pulses
  generic (
  generic (
Line 53... Line 54...
    usec : slbit;                       -- usec pulse
    usec : slbit;                       -- usec pulse
    msec : slbit;                       -- msec pulse
    msec : slbit;                       -- msec pulse
  end record regs_type;
  end record regs_type;
 
 
  constant regs_init : regs_type := (
  constant regs_init : regs_type := (
    conv_std_logic_vector(USECDIV-1,CDUWIDTH),
    slv(to_unsigned(USECDIV-1,CDUWIDTH)),
    conv_std_logic_vector(MSECDIV-1,10),
    slv(to_unsigned(MSECDIV-1,10)),
    '0','0'
    '0','0'
  );
  );
 
 
  signal R_REGS : regs_type := regs_init;  -- state registers
  signal R_REGS : regs_type := regs_init;  -- state registers
  signal N_REGS : regs_type := regs_init;  -- next value state regs
  signal N_REGS : regs_type := regs_init;  -- next value state regs
Line 71... Line 72...
    severity FAILURE;
    severity FAILURE;
 
 
  proc_regs: process (CLK)
  proc_regs: process (CLK)
  begin
  begin
 
 
    if CLK'event and CLK='1' then
    if rising_edge(CLK) then
      R_REGS <= N_REGS;
      R_REGS <= N_REGS;
    end if;
    end if;
 
 
  end process proc_regs;
  end process proc_regs;
 
 
Line 90... Line 91...
    n := R_REGS;
    n := R_REGS;
 
 
    n.usec := '0';
    n.usec := '0';
    n.msec := '0';
    n.msec := '0';
 
 
    n.ucnt := unsigned(r.ucnt) - 1;
    n.ucnt := slv(unsigned(r.ucnt) - 1);
    if unsigned(r.ucnt) = 0 then
    if unsigned(r.ucnt) = 0 then
      n.usec := '1';
      n.usec := '1';
      n.ucnt := conv_std_logic_vector(USECDIV-1,CDUWIDTH);
      n.ucnt := slv(to_unsigned(USECDIV-1,CDUWIDTH));
      n.mcnt := unsigned(r.mcnt) - 1;
      n.mcnt := slv(unsigned(r.mcnt) - 1);
      if unsigned(r.mcnt) = 0 then
      if unsigned(r.mcnt) = 0 then
        n.msec := '1';
        n.msec := '1';
        n.mcnt := conv_std_logic_vector(MSECDIV-1,10);
        n.mcnt := slv(to_unsigned(MSECDIV-1,10));
      end if;
      end if;
    end if;
    end if;
 
 
    N_REGS <= n;
    N_REGS <= n;
 
 

powered by: WebSVN 2.1.0

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