Quartus II 时钟约束概念.docx

上传人:牧羊曲112 文档编号:3062239 上传时间:2023-03-10 格式:DOCX 页数:16 大小:42.87KB
返回 下载 相关 举报
Quartus II 时钟约束概念.docx_第1页
第1页 / 共16页
Quartus II 时钟约束概念.docx_第2页
第2页 / 共16页
Quartus II 时钟约束概念.docx_第3页
第3页 / 共16页
Quartus II 时钟约束概念.docx_第4页
第4页 / 共16页
Quartus II 时钟约束概念.docx_第5页
第5页 / 共16页
亲,该文档总共16页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《Quartus II 时钟约束概念.docx》由会员分享,可在线阅读,更多相关《Quartus II 时钟约束概念.docx(16页珍藏版)》请在三一办公上搜索。

1、Quartus II 时钟约束概念Quartus II Handbook, Volume 3 6-28 时钟约束: 约束所有时钟对准确的时序分析结果而言是必不可少的。Quartus II TimeQuest Timing Analyzer为各种各样的时钟配置和典型时钟提供许多SDC命令。 时钟 使用create_clock命令为任何register, port或pin进行时钟特性描述,使其具有独一的时钟特性。例62展示了create_clock命令: Example 62. create_clock Command create_clock -period -name -waveform -a

2、dd Table 66. create_clock Command Options 选项 -period -name -waveform -add Example 63 约束时钟频率100MHz,占空比50%,0ns上升沿,5ns下降沿。 指定时钟周期 指定时钟名称 指定时钟上升沿/下降沿 可以对一个时钟节点进行多个时钟约束 指定你要约束的时钟 描述 这个章节将介绍SDC可用的应用编程接口,以及描述指定的时钟特性。 Example 63. 100MHz Clock Creation create_clock period 10 waveform 0 5 clk Example 64和上例相差9

3、0度的相位。 Example 64. 100MHz Shifted by 90 Degrees Clock Creation create_clock period 10 waveform 2.5 7.5 clk_sys 使用create_clock命令约束时钟缺省的source Latency值为0。Quartus II TimeQuest Timing Analyzer自动为非虚拟时钟计算时钟网络延时。 Quartus II Handbook, Volume 3 6-29 生成时钟 Quartus II TimeQuest Timing Analyzer可以把修改或改变主时钟特性的分频时钟

4、、波纹时钟和电路作为生成时钟。 你可以定义这些电路的输出作为生成时钟。这些定义可以让Quartus II TimeQuest Timing Analyzer分析这些时钟以及关联的时钟网络延时。 使用create_generated_clock命令定义生成时钟。 Example 65. create_generated_clock Command create_generated_clock -name -source -edges -edge_shift -divide_by -multiply_by -duty_cycle -add -invert -master_clock -phase

5、-offset Table 67. create_generated_clock Command Options 选项 -name -source -edges | -edge_shift -divide_by | -multiply_by 生成时钟名 指定被设定的时钟节点 -edges指定和主时钟的上升沿和下降沿有关的新的上升沿和下降沿 -divide_by和-multiply_by要素是基于第一个时钟上升沿,通过设定来延长或者缩短指定要素的波形 -duty_cycle -add -invert -master_clock -phase -offset 源延时是由于从主时钟开始的时钟网络延时

6、所致。你可以使用set_clock_latency source命令约束源延时。 Figure 617 展示了如何产生一个基于10ns时钟的反向生成时钟: Figure 617. Generating an Inverted Clock create_clock -period 10 get_ports clk create_generated_clock -divide_by 1 -invert -source get_registers clk get_registers gen|clkreg 指定生成时钟的占空比 允许你对同一个管脚添加多个时钟约束 用于主管脚上有多个时钟存在时指定一个主

7、时钟 指定生成时钟的相位 指定生成时钟的偏移 指定被分配到的目标管脚 描述 Figure 618 展示了如何使用-edges和-edge_shift选项以改变生成时钟。 Figure 618. Edges and Edge Shifting a Generated Clock create_clock -period 10 -waveform 0 5 get_ports clk # Creates a divide-by-t clock create_generated_clock -source get_ports clk -edges 1 3 5 get_registers clkdivA

8、|clkreg # Creates a divide-by-2 clock independent of the master clocks duty cycle (now 50%) create_generated_clock -source get_ports clk -edges 1 1 5 -edge_shift 0 2.5 0 Figure 619 展示了-multiply_by选项对生成时钟的影响。 Figure 619. Multiplying a Generated Clock create_clock -period 10 -waveform 0 5 get_ports cl

9、k # Creates a multiply-by-2 clock create_generated_clock -source get_ports clk -multiply_by 2 get_registers Quartus II Handbook, Volume 3 6-32 虚拟时钟Virtual Clocks 虚拟时钟是一个在设计中没有真正源或者说与设计没有直接关系的一个时钟。例如,如果一个时钟不是设计中的时钟,而仅仅作为一个外部器件的时钟源,并且外部器件和该设计有输入或者输出的管脚,那么就认为这个时钟是虚拟时钟。 使用create_clock命令创造一个虚拟时钟,对源选项没有指定

10、值。 你可以使用set_input_delay和set_output_delay约束虚拟时钟。 Figure 620展示了Quartus II TimeQuest Timing Analyzer若要正确的分析外部寄存器和内部设计逻辑之间的关系,在何处需要设置虚拟时钟的实例。虽然名为virt_clk的晶振没有和Altera器件直接相互作用,但是担当起了外部寄存器的源时钟的角色,所以时钟virt_clk必须申明。 Example 66 展示了定义一个周期10ns,名为virt_clk,50%占空比,上升沿在0ns的虚拟时钟的命令。虚拟时钟用于作为输出延时约束的时钟源。 在你产生虚拟时钟之后,你可以

11、执行register-to-register的分析报告。 Example 66. 虚拟时钟Example 1 #create base clock for the design create_clock -period 5 get_ports system_clk #create the virtual clock for the external register create_clock -period 10 -name virt_clk -waveform 0 5 #set the output delay referencing the virtual clock set_output

12、_delay -clock virt_clk -max 1.5 get_ports dataout Example 67 展示了产生一个周期为10ns,占空比为50%,相移90度虚拟时钟的命令。 Example 67. Virtual Clock Example 2 create_clock -name virt_clk period 10 waveform 2.5 7.5 Quartus II Handbook, Volume 3 6-33 多频时钟 Multi-Frequency Clocks 某些情况下在设计中会有很多个时钟源提供时钟信号。增加的时钟也许扮演一个低频率低功耗时钟的角色。在

13、分析这种设计时,create_clock命令提供了add选项让你添加多个时钟节点。 Example 68展示了时钟周期为10ns的节点clk,然后对同一个节点添加时钟周期为15ns的时钟。Quartus II TimeQuest Timing Analyzer在执行时序分析时两个时钟都用到了。 Example 68. Multi-Frequency Example create_clock period 10 name clock_primary waveform 0 5 get_ports clk create_clock period 15 name clock_secondary wav

14、eform 0 7.5 get_ports clk -add Quartus II Handbook, Volume 3 6-34 自动时钟检测 Automatic Clock Detection 想要为你的设计中所有的时钟节点自动添加时钟约束,那么就使用derive_clocks命令。这个命令从管脚或者寄存器生成时钟以确保设计中的每个寄存器都有时钟。 Example 69 展示了derive_clocks命令选项。 Example 69. derive_clocks Command derive_clocks -period -waveform Table 68 describes the

15、options for the derive_clocks command. 选项 -period 描述 指定时钟周期,你也可以指定时钟频率如下:-period MHz -waveform 指定沿变化时刻 derive_clocks命令不能为PLLs输出时钟进行约束。 derive_clocks命令相当于使用create_clock命令为每个寄存器或者管脚产生时钟。 Quartus II Handbook, Volume 3 6-35 锁相环时钟 Derive PLL Clocks PLLs在Altera器件中被用于时钟管理和综合。你可以定制基于你设计需要的PLL输出时钟约束。因为所有的时钟节

16、点应该有一个共同的时钟基准,故所有的PLL输出应该有一个关联时钟。 你可以使用create_generated_clock命令手动添加一个作为PLL输出的基准时钟,或者你也可以使用derive_pll_clocks命令自动搜寻时序网表并通过设置指定PLL输出来产生时钟。 使用derive_pll_clocks命令为PLL输出自动产生时钟的实例如下: derive_pll_clocks -use_tan_name Table 69. derive_pll_clocks Command Options 选项 -use_tan_name 描述 缺省下,时钟名为输出时钟名字。这个选项使用的网络名字类似

17、于在Quartus II Classic Timing Analyzer中使用的。 derive_pll_clocks命令调用create_generated_clock命令以产生PLL输出的生成时钟。 create_generated_clock命令的source是PLL的输入时钟。derive_pll_clocks命令的前后已固定,你必须手动为PLL生成一个输入时钟节点。如果PLL的输入时钟节点未被定义好,报告中不会出现PLL输出的时钟。取而代之的,当时序网表更新后,Quartus II TimeQuest Timing Analyzer发出一个类似于Figure 610的警告信息。 Ex

18、ample 610. Warning Message Warning: The master clock for this clock assignment could not be derived. Clock: was not created. 你可以把derive_pll_clocks命令添加到你的SDC文件中,以使得derive_pll_clocks命令可以自动检测PLL的任何变化。derive_pll_clocks在你的SDC文件中,每次读取该文件,PLL输出时钟脚的create_generated_clock命令就将生成。如果在derive_pll_clock命令后使用write_

19、sdc命令,新的SDC文件包含了独立的PLL输出时钟管脚的create_generated_clock命令,并且不是derive_pll_clocks命令。任何PLL属性的变化不会自动的反应到新的SDC文件中。你必须通过写入derive_pll_clocks命令手动更新新的SDC文件中的create_generated_clock命令。 通过添加适当的multicycle约束计算不确定因素,derive_pll_clocks将约束设计中的任何LVDS传送和LVDS接收。 例如,Figure 621展示了一个寄存器到寄存器路径的单一PLL设计。 使用derive_pll_clocks命令自动约束

20、PLL。当Figure 621的设计中使用到这个命令,将产生Example 611的信息。 Example 611. derive_pll_clocks Generated Messages Info: Info: Deriving PLL Clocks: Info: create_generated_clock -source pll_inst|altpll_component|pll|inclk0 -divide_by 2 -name pll_inst|altpll_component|pll|CLK0 pll_inst|altpll_component|pll|clk0 Info: 名为

21、pll_inst|altpll_component|pll|inclk0的节点用于作为PLL输入时钟脚的源参考选项。此外,PLL输出时钟的名字是PLL输出时钟节点pll_inst|altpll_component|pll|clk0。 如果PLL处于时钟替换模式,PLL输出时钟将产生多时钟;一个是主要输入时钟,另一个是次要输入时钟。假若那样的话,你可以使用set_cock_groups命令加上-exclusive选项以削减主要和次要输出时钟。在你可以为这个设计产生任何报告之前,你必须为PLL输入时钟管脚产生一个基本时钟,使用类似下面的命令: create_clock -period 5 get_

22、ports pll_inclk 你不用在PLL的输入时钟管脚pll_inst|altpll_component|pll|inclk0上产生基本时钟。PLL输入时钟管脚产生所有的扇出时钟管脚,包括PLL输入时钟管脚。 Quartus II Handbook, Volume 3 6-37 缺省时钟约束 Default Clock Constraints 为了提供彻底的时钟分析,如果你的设计中没有基本时钟约束,Quartus II TimeQuest Timing Analyzer在缺省时会自动的检测所有未被约束的时钟节点。Quartus II TimeQuest Timing Analyzer使用

23、以下命令产生1GHz的时钟约束你的未约束时钟: derive_clocks -period 1 独立的时钟约束可能会出现在设计中。这将导致不切实际的分析设计中的时序要求。derive_clocks的使用应该避免出现在最终的时序里。 缺省时钟约束仅仅被用于Quartus II TimeQuest Timing Analyzer检测所有没有时钟连接的同步单元。例如,如果一个设计约束两个时钟,而仅有一个时钟已经约束了,这将不会使用缺省时钟约束。然而,如果两个时钟都未被约束,那么将会启动缺省时钟约束。 Quartus II Handbook, Volume 3 6-37 Clock Groups 设计

24、中存在着许多时钟,然而,并非所有时钟都相互关联,况且某些时钟间相互关联是没有必要的。异步时钟就是不相关时钟。专用时钟也不一定在同一时刻激活。必须向Quartus II TimeQuest Timing Analyzer指明相互排斥的时钟,从而阻止其把这些时钟作为关联时钟进行分析。 使用set_clock_groups命令指明相互排斥或者异步的时钟。Example 612 展示了set_clock_groups命令及选项。 Example 612. set_clock_groups Command set_clock_groups -asynchronous | -exclusive -grou

25、p -group -group . Table 610 describes the options for the set_clock_groups command. 选项 -asynchronous 描述 异步时钟两个时钟没有相位关系并且不在同一时刻激活 -exclusive 专有时钟两个时钟中仅有一个在特定时间激活。2选1时钟就是专有时钟的一个实例 -group Example 613展示了set_clock_groups命令和等价命令set_false_path的用法。 Example 613. set_clock_groups Example # Clocks A and C are

26、never active when clocks B and D are active set_clock_groups -exclusive -group A C -group B D # Equivalent specification using false paths set_false_path -from get_clocks A -to get_clocks B set_false_path -from get_clocks A -to get_clocks D set_false_path -from get_clocks C -to get_clocks B set_fals

27、e_path -from get_clocks C -to get_clocks D set_false_path -from get_clocks B -to get_clocks A set_false_path -from get_clocks B -to get_clocks C set_false_path -from get_clocks D -to get_clocks A 指定相互独有的时钟名。用于指定时钟名 set_false_path -from get_clocks D -to get_clocks C Quartus II Handbook, Volume 3 6-39

28、 影响时钟特性 Clock Effect Characteristics create_clock和create_generated_clock命令产生不涉及板级影响的理想时钟。这个章节描述如何计算影响时钟特性的时钟延时和时钟不确定时间。 时钟延时 Clock Latency 时钟延时由两部分组成:源和网络。源延时,是指从源时钟到目的时钟端的传播延时,而网络延时是指从一个定义点时钟到一个寄存器时钟端口的传播延时。寄存器时钟节点总的延时是时钟路径上源和网络延时之和。 set_clock_latency命令仅仅支持源延时。当使用该命令时,-source选项需指定。 使用set_clock_late

29、ncy命令指定设计中的任意时钟端口的源延时Example 614展示了set_clock_latency命令选项。 Example 614. set_clock_latency Command set_clock_latency -source -clock -rise | -fall -late | -early Quartus II TimeQuest Timing Analyzer自动计算网络延时;因此,set_clock_latency命令仅仅指定源延时。 时钟不确定时间 Clock Uncertainty set_clock_uncertainty命令为时钟或者时钟到时钟传输指定了时

30、钟不确定时间或时钟偏斜。可以为个别的建立和保持时间指定不确定时间,也可以为个别时钟传输指定上升沿或下降沿。Quartus II TimeQuest Timing Analyzer为每个合适路径数据需要时间里扣除建立不确定时间,为每个合适路径的数据需要时间加上保持不确定时间。 使用set_clock_uncertainty命令指定时钟管脚的任意时钟不确定时间。Example 615展示了set_clock_uncertainty命令及选项。 Example 615. set_clock_uncertainty Command and Options set_clock_uncertainty -

31、rise_from | -fall_from | -from -rise_to | -fall_to | -to -setup | -hold Quartus II Handbook, Volume 3 6-41 获得时钟不确定时间 Derive Clock Uncertainty 使用derive_clock_uncertainty命令应用于交互时钟、内部时钟和I/O接口的不确定时间的自动检测。建立和保持不确定时间都适合于时钟到时钟的传输。Example 616展示了derive_clock_uncertainty命令选项。 Example 616. derive_clock_uncerta

32、inty Command derive_clock_uncertainty -overwrite -dtw Quartus II TimeQuest Timing Analyzer自动的添加设计中时钟到时钟传输的时钟不确定时间。随着set_clock_uncertainty命令已被应用于源和目的时钟对中的任何时钟不确定时间约束,比起由derive_clock_uncertainty命令约束的时钟不确定时间具有更高的优先权。例如,如果set_clock_uncertainty命令先指定了源时钟CLKA和目的时钟CLKB之间的时钟网络延时。那么derive_clock_uncertainty命令次

33、之,由derive_clock_uncertainty命令计算出的由源时钟CLKA到目的时钟CLKB的不确定时间将被忽略。 你可以使用-overwrite命令覆盖原先的时钟不确定时间分配,后者手动添加remove_clock_uncertainty命令进行移除。 在以下的时钟到时钟传输类型中,时钟必然能够出现,它们被derive_clock_uncertainty命令自动归类。 Inter-clock Intra-clock I/O Interface 交互时钟传输 Inter-Clock Transfers 交互时钟传输发生在FPGA核和来自内部PLL输出节点或管脚的源与目的时钟的寄存器到寄

34、存器传输。Figure 622展示了一个交互时钟传输的例子。 内部时钟传输 Intra-Clock Transfers 内部时钟传输发生在FPGA核和来自内部PLL输出节点或管脚的源与目的时钟的寄存器到寄存器传输。Figure 622展示了一个内部时钟传输的例子。 I/O接口时钟传输 I/O Interface Clock Transfers I/O接口时钟传输发生在数据从I/O端口到FPGA核或者从FPGA核到I/O端口时的时钟传输。Figure 624展示了一个I/O端口时钟传输的例子。 约束I/O总线不确定时间,你必须生成一个虚拟时钟来约束输入和输出管脚。当set_input_delay

35、或者set_output_delay命令以PLL输出作为参考时钟管脚时,虚拟时钟需阻止derive_clock_uncertainty命令应用于交互或者内部时钟传输在I/O总线时钟传输的确定时钟。 产生的虚拟时钟应该和驱动I/O端口的源时钟具有相同的属性。例如,Figure 625展示了一个典型的具有时钟说明的输入I/O接口。 Example 617展示了用SDC命令来约束Figure 625中的I/O接口。 Example 617. SDC Commands to Constrain the I/O Interface # Create the base clock for the cloc

36、k port create_clock period 10 name clk_in get_ports clk_in # Create a virtual clock with the same properties of the base clock driving # the source register create_clock period 10 name virt_clk_in # Create the input delay referencing the virtual clock and not the base # clock # DO NOT use set_input_delay clock clk_in # get_ports data_in set_input_delay clock virt_clk_in get_ports data_in

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号