📄 clkmux.vhd
字号:
-------------------------------------------------------------------------------- This file is a part of the GRLIB VHDL IP LIBRARY-- Copyright (C) 2003, Gaisler Research---- This program is free software; you can redistribute it and/or modify-- it under the terms of the GNU General Public License as published by-- the Free Software Foundation; either version 2 of the License, or-- (at your option) any later version.---- This program 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 General Public License for more details.---- You should have received a copy of the GNU General Public License-- along with this program; if not, write to the Free Software-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------- Entity: clkmux-- File: clkmux.vhd-- Author: Edvin Catovic - Gaisler Research-- Description: Glitch-free clock multiplexer------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;use work.gencomp.all;use work.libclk.all;entity clkmux is generic( tech : integer := 0); port( i0, i1 : in std_ulogic; sel : in std_ulogic; o : out std_ulogic );end entity;architecture rtl of clkmux is signal sel0, sel1, cg0, cg1 : std_ulogic; begin xil : if (tech = virtex2) or (tech = spartan3) or (tech = spartan3e) or (tech = virtex4) or (tech = virtex5) generate buf : clkmux_unisim port map(sel => sel, I0 => i0, I1 => i1, O => o); end generate; gen : if has_clkmux(tech) = 0 generate p0 : process(i0) begin if falling_edge(i0) then sel0 <= (not sel) and (not sel1); end if; end process; p1 : process(i1) begin if falling_edge(i1) then sel1 <= sel and (not sel0); end if; end process; cg0 <= i0 and sel0; cg1 <= i1 and sel1; o <= cg0 or cg1; end generate;end architecture;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -