莱迪思FPGA内部时钟 [英] Lattice Fpga Internal clock

查看:576
本文介绍了莱迪思FPGA内部时钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置晶格MachX03的内部振荡器.我阅读了《 MachXO3 sysCLOCK PLL设计和使用指南》 *,并尝试使用文档第31页上的vhdl代码,但是在COMPONENT附近,我始终收到此错误(VHDL-1261)语法错误.有人可以告诉我如何使用VHDL使时钟工作吗?这是我要使用的代码:

I'm trying to configure a lattice MachX03's internal Oscillator. I read the MachXO3 sysCLOCK PLL Design and Usage Guide* and tried using the vhdl code found on page 31 of the documente, but I keep getting this error (VHDL-1261) syntax error near COMPONENT. Can someone tell me how I can get the clock to work using VHDL? here is the code I'm trying to use:

LIBRARY lattice;

library machXO3;
use machXO3.all;

COMPONENT OSCH
   GENERIC(
         NOM_FREQ: string := "53.20"); --53.20MHz, or can select other supported frequencies
   PORT(
         STDBY    : IN  STD_LOGIC;     --'0' OSC output is active, '1' OSC output off
         OSC      : OUT STD_LOGIC;     --the oscillator output
         SEDSTDBY : OUT STD_LOGIC);    --required only for simulation when using standby
END COMPONENT;


OSCInst0: OSCH
   GENERIC MAP (NOM_FREQ  => "53.20")
   PORT MAP (STDBY => '0', OSC => clk, SEDSTDBY => OPEN);

这是手册中的代码:

library machXO3;
use machXO3.all;

COMPONENT OSCH
-- synthesis translate_off
  GENERIC (NOM_FREQ: string := "2.56");
-- synthesis translate_on
  PORT (STDBY:INstd_logic;
          OSC:OUTstd_logic;
     SEDSTDBY:OUTstd_logic);
END COMPONENT;

  attribute NOM_FREQ : string;
  attribute NOM_FREQ of OSCinst0 : label is "2.56";

begin
OSCInst0: OSCH
-- synthesis translate_off
  GENERIC MAP( NOM_FREQ => "2.56" )
-- synthesis translate_on
  PORT MAP (STDBY=> stdby,
  OSC => osc_int,
  SEDSTDBY => stdby_sed
);

* http://www.latticesemi.com/view_document?document_id=50124

推荐答案

要使用内部Osc,基本上使用上面提到的菜单中的代码.为了获得简单的osc工作,请在vhdl中编写以下内容.该代码设置了2.56 Mhz时钟,这是内部时钟可以生成的最慢的时钟.内部发生器可以输出的最高频率是133 Mhz,请参阅文档的第30-20页 http ://www.latticesemi.com/view_document?document_id = 50124

to Use the internal Osc basically use the code in the menu, mentioned above. to get a simple osc working write the following in vhdl. the code sets up a 2.56 Mhz clock, the slowest the internal clock can generate. the highest frequency the interal generator can output is 133 Mhz, refer to pages 30-20 of the document http://www.latticesemi.com/view_document?document_id=50124

library  ieee;
use  ieee.std_logic_1164.all;

-- For Main Clock --
library machXO3l;
use machXO3l.all;
--------------------

entity Clock is
     port (stdby : in std_logic;
           osc_int: out std_logic
           );
end Clock;

architecture Clock_behav of Clock is

    COMPONENT OSCH
    -- synthesis translate_off
        GENERIC (NOM_FREQ: string := "2.56");
    -- synthesis translate_on
        PORT (STDBY : IN std_logic;
              OSC : OUT std_logic
                );
    END COMPONENT;
attribute NOM_FREQ : string;
attribute NOM_FREQ of OSCinst0 : label is "2.56";

begin

    Clock: OSCH
    -- synthesis translate_off
    GENERIC MAP( NOM_FREQ => "2.56" )
    -- synthesis translate_on
    PORT MAP (  STDBY => stdby,
                OSC => osc_int
    );

end Clock_behav;

这篇关于莱迪思FPGA内部时钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆