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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [vlib/] [genlib/] [gray_cnt_gen.vhd] - Diff between revs 16 and 24

Only display areas with differences | Details | Blame | View Log

Rev 16 Rev 24
-- $Id: gray_cnt_gen.vhd 418 2011-10-23 20:11:40Z mueller $
-- $Id: gray_cnt_gen.vhd 418 2011-10-23 20:11:40Z mueller $
--
--
-- Copyright 2007- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2007- 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.
--
--
-- This program is distributed in the hope that it will be useful, but
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- for complete details.
-- for complete details.
-- 
-- 
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Module Name:    gray_cnt_gen - syn
-- Module Name:    gray_cnt_gen - syn
-- Description:    Generic width Gray code counter
-- Description:    Generic width Gray code counter
--
--
-- Dependencies:   -
-- Dependencies:   -
-- Test bench:     -
-- Test bench:     -
-- Target Devices: generic
-- Target Devices: generic
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
-- Revision History: 
-- Revision History: 
-- Date         Rev Version    Comment
-- Date         Rev Version    Comment
-- 2007-12-26   106   1.0      Initial version 
-- 2007-12-26   106   1.0      Initial version 
------------------------------------------------------------------------------
------------------------------------------------------------------------------
 
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
 
 
use work.slvtypes.all;
use work.slvtypes.all;
use work.genlib.all;
use work.genlib.all;
 
 
entity gray_cnt_gen is                  -- gray code counter, generic vector
entity gray_cnt_gen is                  -- gray code counter, generic vector
  generic (
  generic (
    DWIDTH : positive := 4);            -- data width
    DWIDTH : positive := 4);            -- data width
  port (
  port (
    CLK : in slbit;                     -- clock
    CLK : in slbit;                     -- clock
    RESET : in slbit := '0';            -- reset
    RESET : in slbit := '0';            -- reset
    CE : in slbit := '1';               -- count enable
    CE : in slbit := '1';               -- count enable
    DATA : out slv(DWIDTH-1 downto 0)   -- data out
    DATA : out slv(DWIDTH-1 downto 0)   -- data out
  );
  );
end entity gray_cnt_gen;
end entity gray_cnt_gen;
 
 
 
 
architecture syn of gray_cnt_gen is
architecture syn of gray_cnt_gen is
 
 
begin
begin
 
 
  assert DWIDTH>=4
  assert DWIDTH>=4
    report "assert(DWIDTH>=4): only 4 or more bit width supported"
    report "assert(DWIDTH>=4): only 4 or more bit width supported"
    severity failure;
    severity failure;
 
 
 
 
  GRAY_4: if DWIDTH=4 generate
  GRAY_4: if DWIDTH=4 generate
  begin
  begin
    CNT : gray_cnt_4
    CNT : gray_cnt_4
      port map (
      port map (
        CLK   => CLK,
        CLK   => CLK,
        RESET => RESET,
        RESET => RESET,
        CE    => CE,
        CE    => CE,
        DATA  => DATA
        DATA  => DATA
      );
      );
  end generate GRAY_4;
  end generate GRAY_4;
 
 
  GRAY_5: if DWIDTH=5 generate
  GRAY_5: if DWIDTH=5 generate
  begin
  begin
    CNT : gray_cnt_5
    CNT : gray_cnt_5
      port map (
      port map (
        CLK   => CLK,
        CLK   => CLK,
        RESET => RESET,
        RESET => RESET,
        CE    => CE,
        CE    => CE,
        DATA  => DATA
        DATA  => DATA
      );
      );
  end generate GRAY_5;
  end generate GRAY_5;
 
 
  GRAY_N: if DWIDTH>5 generate
  GRAY_N: if DWIDTH>5 generate
  begin
  begin
    CNT : gray_cnt_n
    CNT : gray_cnt_n
      generic map (
      generic map (
        DWIDTH => DWIDTH)
        DWIDTH => DWIDTH)
      port map (
      port map (
        CLK   => CLK,
        CLK   => CLK,
        RESET => RESET,
        RESET => RESET,
        CE    => CE,
        CE    => CE,
        DATA  => DATA
        DATA  => DATA
      );
      );
  end generate GRAY_N;
  end generate GRAY_N;
 
 
end syn;
end syn;
 
 
 
 

powered by: WebSVN 2.1.0

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