今天编了一段代码,主要试着用下CoolRunner-II芯片自带的硬件时钟分频电路。 代码如下: 使用芯片自带的硬件2分频component ,有模块的声明跟例化,都是照着CoolRunner 11 Advanced Features使用说明做的,但是modulsim仿真没有结果,查看clk_dv2信号量为红色未知状态,dataout一样没有结果输出,烦请知道的同仁不吝赐教,谢谢。 -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity det_register is port( clock: in std_logic; datain: in std_logic; dataout: out std_logic);
end det_register;
architecture Behavioral of det_register is
component CLK_DIV2 is port ( CLKIN : in std_logic; CLKDV : out std_logic); end component;
signal clk_dv2 : std_logic; begin u1: CLK_DIV2 port map(CLKIN => clock,CLKDV => clk_dv2); process(datain,clk_dv2) begin if(clk_dv2'event and clk_dv2='1')then dataout<=datain; end if; end process;
end Behavioral;
|