嗨,我正在尝试使用相位锁定环来为VGA控制器生成时钟 . 我没有运气,决定制作自己的时钟然后工作正常 . 我让VGA控制器正常工作 . 回到PLL虽然我仍然无法选择PLL来为我提供输出 . 我做了一个小测试模型来模拟它 .
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY PLL4 IS
PORT (
clk : IN std_logic;
a : IN std_logic;
rst : IN std_logic:='0';
x : OUT std_logic
);
END ENTITY PLL4;
ARCHITECTURE A1 OF PLL4 IS
COMPONENT PLL_4 IS
PORT(
clk_in_clk : in std_logic; -- clk
rst_reset : in std_logic; -- reset
clk_out_clk : out std_logic -- clk
);
END COMPONENT PLL_4;
SIGNAL clk25 : std_logic;
BEGIN
CLK_25 : PLL_4 PORT MAP (clk,rst,clk25);
x <= a and clk25;
END ARCHITECTURE A1;
当我使用mod sim模拟这个时,我得到以下内容
我从未看到PLL时钟输出 . 任何人都可以给我一些建议 .
- 更新 - 在添加来自CLK_25:PLL的信号后,我现在在Modsim上获得以下信息 . 第一个连接到实例化以及clk到clk_in_clk,但是clk_out_clk的值会发生变化 . 见下文:
这让我觉得我遇到的问题是使用Qsys创建的PLL模型.Qsys生成的.vhd中包含的模型如下:
-- PLL_4.vhd
-- Generated using ACDS version 13.0sp1 232 at 2016.02.09.16:46:16
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity PLL_4 is
port (
clk_in_clk : in std_logic := '0'; -- clk_in.clk
rst_reset : in std_logic := '0'; -- rst.reset
clk_out_clk : out std_logic -- clk_out.clk
);
end entity PLL_4;
architecture rtl of PLL_4 is
component PLL_4_altpll_0 is
port (
clk : in std_logic := 'X'; -- clk
reset : in std_logic := 'X'; -- reset
read : in std_logic := 'X'; -- read
write : in std_logic := 'X'; -- write
address : in std_logic_vector(1 downto 0) := (others => 'X'); -- address
readdata : out std_logic_vector(31 downto 0); -- readdata
writedata : in std_logic_vector(31 downto 0) := (others => 'X'); -- writedata
c0 : out std_logic; -- clk
areset : in std_logic := 'X'; -- export
locked : out std_logic; -- export
phasedone : out std_logic -- export
);
end component PLL_4_altpll_0;
begin
altpll_0 : component PLL_4_altpll_0
port map (
clk => clk_in_clk, -- inclk_interface.clk
reset => rst_reset, -- inclk_interface_reset.reset
read => open, -- pll_slave.read
write => open, -- .write
address => open, -- .address
readdata => open, -- .readdata
writedata => open, -- .writedata
c0 => clk_out_clk, -- c0.clk
areset => open, -- areset_conduit.export
locked => open, -- locked_conduit.export
phasedone => open -- phasedone_conduit.export
);
end architecture rtl; -- of PLL_4
1 回答
我无法直接模拟您的VHDL代码,因为您没有发布
PLL_4_altpll_0
的代码 . 因此,我使用Quartus-II的MegaWizard插件管理器创建了一个合适的PLL . 无论如何,如果我直接模拟ModelSim中的PLL4
实体并在信号clk
上应用时钟以及1
来发信号a
,我会得到与您相同的输出:clk25
未定义 .但如果我使用单独的 testbench ,它会按预期工作 . 您必须在Quartus II中设置测试平台,菜单Assignements - > Settings - > Simulation - > Compile test bench - > Test Benches - > New . 这是我的测试平台代码 . 应用重置是可选的,所以我将其保留为
0
.这是模拟输出: