--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
---- ----
|
--
|
---- Ethernet Switch on Configurable Logic IP Core ----
|
-- This VHDL file was generated by EASE/HDL 7.4 Revision 4 from HDL Works B.V.
|
---- ----
|
--
|
---- This file is part of the ESoCL project ----
|
-- Ease library : work
|
---- http://www.opencores.org/cores/esoc/ ----
|
-- HDL library : work
|
---- ----
|
-- Host name : S212065
|
---- Description: see design description ESoCL_dd_71022001.pdf ----
|
-- User name : df768
|
---- ----
|
-- Time stamp : Tue Aug 19 08:05:18 2014
|
---- To Do: see roadmap description ESoCL_dd_71022001.pdf ----
|
--
|
---- and/or release bulleting ESoCL_rb_71022001.pdf ----
|
-- Designed by : L.Maarsen
|
---- ----
|
-- Company : LogiXA
|
---- Author(s): L.Maarsen ----
|
-- Project info : eSoC
|
---- Bert Maarsen, lmaarsen@opencores.org ----
|
--
|
---- ----
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
---- ----
|
|
---- Copyright (C) 2009 Authors and OPENCORES.ORG ----
|
|
---- ----
|
|
---- This source file may be used and distributed without ----
|
|
---- restriction provided that this copyright statement is not ----
|
|
---- removed from the file and that any derivative work contains ----
|
|
---- the original copyright notice and the associated disclaimer. ----
|
|
---- ----
|
|
---- This source file is free software; you can redistribute it ----
|
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
|
---- Public License as published by the Free Software Foundation; ----
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
|
---- later version. ----
|
|
---- ----
|
|
---- This source is distributed in the hope that it will be ----
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
|
---- details. ----
|
|
---- ----
|
|
---- You should have received a copy of the GNU Lesser General ----
|
|
---- Public License along with this source; if not, download it ----
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
|
---- ----
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- Object : Entity work.esoc_clk_en_gen
|
-- Object : Entity work.esoc_clk_en_gen
|
-- Last modified : Mon Apr 14 12:48:32 2014.
|
-- Last modified : Mon Apr 14 12:48:32 2014.
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
library ieee, std, work;
|
library ieee, std, work;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use std.textio.all;
|
use std.textio.all;
|
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
use work.package_esoc_configuration.all;
|
use work.package_esoc_configuration.all;
|
|
|
entity esoc_clk_en_gen is
|
entity esoc_clk_en_gen is
|
port(
|
port(
|
clk : in std_logic;
|
clk : in std_logic;
|
clk_div : in integer;
|
clk_div : in integer;
|
clk_en : out std_logic;
|
clk_en : out std_logic;
|
reset : in std_logic);
|
reset : in std_logic);
|
end entity esoc_clk_en_gen;
|
end entity esoc_clk_en_gen;
|
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- Object : Architecture work.esoc_clk_en_gen.esoc_clk_en_gen
|
-- Object : Architecture work.esoc_clk_en_gen.esoc_clk_en_gen
|
-- Last modified : Mon Apr 14 12:48:32 2014.
|
-- Last modified : Mon Apr 14 12:48:32 2014.
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
|
|
|
|
architecture esoc_clk_en_gen of esoc_clk_en_gen is
|
architecture esoc_clk_en_gen of esoc_clk_en_gen is
|
|
|
signal clk_count: integer;
|
signal clk_count: integer;
|
|
|
begin
|
begin
|
|
|
--=============================================================================================================
|
--=============================================================================================================
|
-- Process : proces to create clock enable signal
|
-- Process : proces to create clock enable signal
|
-- Description :
|
-- Description :
|
--=============================================================================================================
|
--=============================================================================================================
|
create_en: process(clk, reset)
|
create_en: process(clk, reset)
|
begin
|
begin
|
if reset = '1' then
|
if reset = '1' then
|
clk_count <= 0;
|
clk_count <= 0;
|
clk_en <= '0';
|
clk_en <= '0';
|
|
|
elsif clk'event and clk = '1' then
|
elsif clk'event and clk = '1' then
|
-- clear one-clock active signals
|
-- clear one-clock active signals
|
clk_en <= '0';
|
clk_en <= '0';
|
|
|
-- count down until 0, then assert the enable for one clock period
|
-- count down until 0, then assert the enable for one clock period
|
if clk_count = 0 then
|
if clk_count = 0 then
|
clk_count <= clk_div;
|
clk_count <= clk_div;
|
clk_en <= '1';
|
clk_en <= '1';
|
else
|
else
|
clk_count <= clk_count - 1 ;
|
clk_count <= clk_count - 1 ;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|
end architecture esoc_clk_en_gen ; -- of esoc_clk_en_gen
|
end architecture esoc_clk_en_gen ; -- of esoc_clk_en_gen
|
|
|
|
|