我有 256 BGA 封装的 Lattice iCE40 HX8K FPGA。我想使用可用的 PLL 模块之一将 37MHz 的外部时钟频率转换为内部时钟,以便在 74MHz 的 FPGA 内部使用。
我在 IceCube2 中使用了“配置 PLL 模块”并使用了以下配置: - PLL 类型部分: - 由 PLL 输出驱动的全局网络:1;- 专用时钟垫;- PLL 操作模式: - 无补偿模式;- 附加延迟设置:否;- 频率: - 输入 - 37MHz;- 输出 - 74MHz;- 其他 - 未选择任何内容;
然后我得到两个 VHDL 文件——SO_pll.vhd 和 SO_pll_inst.vhd。我有文件 Design.vhd 我的代码应该去的地方。如果我正确理解 Lattice 文档,我需要指定我的 Design.vhd(它的实体)是顶级模块,我这样做了。我需要在 IceCube2 的设计文件列表中包含 SO_pll.vhd,我这样做了。最后 - 我需要使用 SO_pll_inst.vhd 中提供的模板在我的主代码中通过将 PLL 信号端口映射到我的 Design.vhd 中的信号来实例化 PLL。麻烦来了——怎么办?
---Design.vhd---
library IEEE;
use IEEE.std_logic_1164.all;
entity Design is
port(
I_CLK: in std_logic
);
end entity Design;
architecture RTL of Design is
signal S_CLK : std_logic;
signal S_RESET : std_logic;
begin
SO_pll_inst: SO_pll
port map(
REFERENCECLK => I_CLK,
PLLOUTCORE => open,
PLLOUTGLOBAL => S_CLK,
RESET => S_RESET
);
end RTL;
---SO_pll_inst.vhd---Generated by IceCube2
SO_pll_inst: SO_pll
port map(
REFERENCECLK => ,
PLLOUTCORE => ,
PLLOUTGLOBAL => ,
RESET =>
);
---SO_pll.vhd---Generated by IceCube2
library IEEE;
use IEEE.std_logic_1164.all;
entity SO_pll is
port(
REFERENCECLK: in std_logic;
RESET: in std_logic;
PLLOUTCORE: out std_logic;
PLLOUTGLOBAL: out std_logic
);
end entity SO_pll;
architecture BEHAVIOR of SO_pll is
signal openwire : std_logic;
signal openwirebus : std_logic_vector (7 downto 0);
component SB_PLL40_CORE
generic (
--- Feedback
FEEDBACK_PATH : string := "SIMPLE"; -- String (simple, delay,
phase_and_delay, external)
DELAY_ADJUSTMENT_MODE_FEEDBACK : string := "FIXED";
DELAY_ADJUSTMENT_MODE_RELATIVE : string := "FIXED";
SHIFTREG_DIV_MODE : bit_vector(1 downto 0) := "00";
-- 0-->Divide by 4, 1-->Divide by 7, 3 -->Divide by 5
FDA_FEEDBACK : bit_vector(3 downto 0) := "0000";
-- Integer (0-15).
FDA_RELATIVE : bit_vector(3 downto 0) := "0000";
-- Integer (0-15).
PLLOUT_SELECT : string := "GENCLK";
--- Use the spread sheet to populate the values below
DIVF : bit_vector(6 downto 0);
-- Determine a good default value
DIVR : bit_vector(3 downto 0);
-- Determine a good default value
DIVQ : bit_vector(2 downto 0);
-- Determine a good default value
FILTER_RANGE : bit_vector(2 downto 0);
-- Determine a good default value
--- Additional C-Bits
ENABLE_ICEGATE : bit := '0';
--- Test Mode Parameter
TEST_MODE : bit := '0';
EXTERNAL_DIVIDE_FACTOR : integer := 1
-- Not Used by model, Added for PLL config GUI
);
port (
REFERENCECLK : in std_logic; -- Driven by core logic
PLLOUTCORE : out std_logic; -- PLL output to core logic
PLLOUTGLOBAL : out std_logic; -- PLL output to global network
EXTFEEDBACK : in std_logic; -- Driven by core logic
DYNAMICDELAY : in std_logic_vector (7 downto 0); -- Driven by core
logic
LOCK : out std_logic; -- Output of PLL
BYPASS : in std_logic; -- Driven by core logic
RESETB : in std_logic; -- Driven by core logic
LATCHINPUTVALUE : in std_logic; -- iCEGate Signal
-- Test Pins
SDO : out std_logic; -- Output of PLL
SDI : in std_logic; -- Driven by core logic
SCLK : in std_logic -- Driven by core logic
);
end component;
begin
SO_pll_inst: SB_PLL40_CORE
-- Fin=37, Fout=74
generic map(
DIVR => "0000",
DIVF => "0001111",
DIVQ => "011",
FILTER_RANGE => "011",
FEEDBACK_PATH => "SIMPLE",
DELAY_ADJUSTMENT_MODE_FEEDBACK => "FIXED",
FDA_FEEDBACK => "0000",
DELAY_ADJUSTMENT_MODE_RELATIVE => "FIXED",
FDA_RELATIVE => "0000",
SHIFTREG_DIV_MODE => "00",
PLLOUT_SELECT => "GENCLK",
ENABLE_ICEGATE => '0'
)
port map(
REFERENCECLK => REFERENCECLK,
PLLOUTCORE => PLLOUTCORE,
PLLOUTGLOBAL => PLLOUTGLOBAL,
EXTFEEDBACK => openwire,
DYNAMICDELAY => openwirebus,
RESETB => RESET,
BYPASS => '0',
LATCHINPUTVALUE => openwire,
LOCK => open,
SDI => openwire,
SDO => open,
SCLK => openwire
);
end BEHAVIOR;
我刚刚将 Design.vhd 和 SO_pll.vhd 添加到设计文件列表中。如果我使用 Lattice LSE 运行综合,则综合成功,但布局报告显示使用了 0/2 个 PLL。如果我用 Synplify Pro 布局器运行 Synthesys,报告说使用了 1/2 PLL,但我真的不能使用它,因为我没有映射信号。
当我从 SO_pll_inst.vhd 获取模板并将其放置在 Design.vhd 的体系结构中时,我收到错误消息:“错误 - 综合:design.vhd(19): so_pll is not declared. VHDL-1241”好吧,显然我错过了一些东西。如果它是一个模板,我希望只是映射我的信号并让它运行。但不是。要么我做错了什么,要么......我做错了什么:)请帮忙。