vivado 编译属性

编译属性

介绍

在AMD Vivado™ 设计套件,Vivado合成可以合成多种类型的属性。在里面在大多数情况下,这些属性具有相同的语法和行为。

•如果Vivado合成支持该属性。它使用属性并创建一个反映使用的属性。

•如果工具无法识别指定的属性,Vivado合成将通过属性及其值添加到生成的网表中。假设流中稍后的工具可以使用该属性。例如,LOC约束为不用于合成。尽管如此,Vivado放置程序仍使用该约束,并由转发Vivado合成。

支持的属性

ASYNC_REG

ASYNC_REG是一个影响Vivado工具流中许多进程的属性。这个该属性的目的是通知工具寄存器能够接收异步D输入引脚中相对于源时钟的数据,或者寄存器是同步寄存器在同步链内。Vivado合成,当遇到此属性时将其处理作为DONT_TOUCH属性并在网表中将ASYNC_REG属性向前推。这过程确保具有ASYNC_REG属性的对象不会被优化,并且流中稍后的工具将接收该属性以正确处理它。有关其他Vivado工具如何处理此属性的信息,请参见Vivado Design Suite属性参考指南(UG912)。您可以将此属性放置在任何寄存器上;值为FALSE(默认值)和TRUE。此属性可以在RTL或XDC中设置。

重要!在无负载信号上设置此属性时应小心。属性和信号可能无法保存。

ASYNC_REG Verilog示例

(* ASYNC_REG = "TRUE" *) reg [2:0] sync_regs;
ASYNC_REG VHDL Examples
attribute ASYNC_REG : string;
attribute ASYNC_REG of sync_regs : signal is "TRUE";
attribute ASYNC_REG : boolean;
attribute ASYNC_REG of sync_regs : signal is TRUE;

BLACK_BOX

BLACK_BOX属性是一个有用的调试属性,用于指导合成以创建黑盒用于该模块或实体。当找到属性时,即使模块或实体,Vivado合成为该级别创建了一个黑盒。此属性可以放置在模块、实体或组件。由于此属性会影响合成编译器,因此它只能设置在RTL中。

BLACK_BOX Verilog示例

(* black_box *) module test(in1, in2, clk, out1);

重要!在Verilog示例中,不需要任何值。属性的存在会创建黑色盒

BLACK_BOX VHDL示例

attribute black_box : string;
attribute black_box of beh : architecture is "yes";

有关黑匣子编码样式的更多信息,请参见黑匣子。

CASCADE_HEIGHT

CASCADE_HEIGHT属性是一个用于描述级联链长度的整数放入块RAM的大型RAMS。当RAM大于单个块RAM时Vivado合成工具决定了它必须如何配置。通常,该工具会选择级联其创建的块RAM。此属性可用于缩短链条的长度。将属性放置在有问题的RAM上,然后可以放置RTL文件中的属性。此属性的值为0或1有效地关闭任何块RAM的级联。

注意:此属性仅适用于AMD UltraScale™ 体系结构块RAM和URAM(UltraRAM)。有关UltraRAM的CASCADE_HEIGHT属性的更多信息,请访问CASCADE_HEIGHT。

CASCADE_HEIGHT Verilog示例

(* cascade_height = 4 *) reg [31:0] ram [(2**15) - 1:0];
CASCADE_HEIGHT VHDL example
attribute cascade_height : integer;
attribute cascade_height of ram : signal is 4;

时钟缓冲区类型

在输入时钟上应用CLOCK_BUFFER_TYPE来描述要使用的时钟缓冲区类型。默认情况下,Vivado合成使用BUFG作为时钟缓冲区。支持的值为“BUFG”,“BUFH”、“BUFIO”、“buffr”、“BUFR”或“none”。CLOCK_BUFFER_TYPE属性可以是放置在任何顶级时钟端口上。它可以在RTL和XDC中设置。

CLOCK_BUFFER_TYPE验证日志示例

(* clock_buffer_type = "none" *) input clk1;
CLOCK_BUFFER_TYPE VHDL example
entity test is port(
in1 : std_logic_vector (8 downto 0);
clk : std_logic;
out1 : std_logic_vector(8 downto 0));
attribute clock_buffer_type : string;
attribute clock_buffer_type of clk: signal is "BUFR";
end test;
CLOCK_BUFFER_TYPE XDC Example
set_property CLOCK_BUFFER_TYPE BUFG [get_ports clk]

直接启用(_E)

在输入端口或其他信号上应用DIRECT_ENABLE,使其直接进入使能线当有多个可能的使能时,或者当你想强制合成时,一个触发器的工具来使用触发器的启用线。DIRECT_ENABLE属性可以放置在任何端口或信号上。DIRECT_ENABLE Verilog示例

(* direct_enable = "yes" *) input ena3;
DIRECT_ENABLE VHDL Example
entity test is port(
in1 : std_logic_vector (8 downto 0);
clk : std_logic;
ena1, ena2, ena3 : in std_logic
out1 : std_logic_vector(8 downto 0));
attribute direct_enable : string;
attribute direct_enable of ena3: signal is "yes";
end test;
DIRECT_ENABLE XDC Example
set_property direct_enable yes [get_nets -of [get_ports ena3]]

注意:对于XDC的使用,此属性仅适用于类型net,因此必须使用get_nets命令对象。

DIRECT_RESET

在输入端口或其他信号上应用DIRECT_RESET,使其直接进入当有多个可能的重置时失败,或者当您想强制合成工具使用触发器的复位线。DIRECT_RESET属性可以放置在任何端口或信号上。

DIRECT_RESET Verilog示例

(* direct_reset = "yes" *) input rst3;
DIRECT_RESET VHDL Example
entity test is port(
in1 : std_logic_vector (8 downto 0);
clk : std_logic;
rst1, rst2, rst3 : in std_logic
out1 : std_logic_vector(8 downto 0));
attribute direct_reset : string;
attribute direct_reset of rst3: signal is "yes";
end test;
DIRECT_RESET XDC Example
set_property direct_reset yes [get_nets -of [get_ports rst3]]

笔记

对于XDC的使用,此属性仅适用于类型net,因此需要对对象

DONT_TOUCH

使用DONT_TOUCH属性代替KEEP或KEEP_HIERARCHY。DONT_TOUCH以与KEEP或KEEP_HIERARCHY属性相同的方式工作;但是,与KEEP和KEEP_HIERARCHY,DONT_TOUCH正向注释以放置和路由以防止逻辑优化。

小心!与KEEP和KEEP_HIERARCHY一样,使用DONT_TOUCH时要小心。在以下情况下如果其他属性与DONT_TOUCH冲突,则DONT_TOUCH属性优先。DONT_TOUCH的值为TRUE/FALSE或yes/no。您可以将此属性放置在任何信号、模块、实体或组件。

注意:模块或实体的端口不支持DONT_TOUCH属性。如果特定端口需要保留的,请使用-plane_hierarch-none设置或在模块上放置DONT_TOUCH/实体本身。

注意:使用XDC删除在RTL中设置的DONT_TOUCH时,可能会收到警告

在合成之后,当实现流读取相同的XDC,但所讨论的信号已经优化出来。这些警告可以忽略。但是,您也可以通过将XDC文件中的DONT_TOUCH属性标记为仅用于合成。

DONT_TOUCH Verilog示例

Verilog接线示例

(* dont_touch = "yes" *) wire sig1;
assign sig1 = in1 & in2;
assign out1 = sig1 & in2;
Verilog Module Example
(* DONT_TOUCH = "yes" *)
module example_dt_ver
(clk,
In1,
In2,
out1);
Verilog Instance Example
(* DONT_TOUCH = "yes" *) example_dt_ver U0
(.clk(clk),
.in1(a),
.in2(b),
out1(c));
DONT_TOUCH VHDL Examples
VHDL Signal Example
signal sig1 : std_logic;
attribute dont_touch : string;
attribute dont_touch of sig1 : signal is "true";
....
....
sig1 <= in1 and in2;
out1 <= sig1 and in3;
VHDL Entity Example
entity example_dt_vhd is
port (
clk : in std_logic;
In1 : in std_logic;
In2 : in std_logic;
out1 : out std_logic
);
attribute dont_touch : string;
attribute dont_touch of example_dt_vhd : entity is "true|yes";
end example_dt_vhd;
VHDL Component Example
entity rtl of test is
attribute dont_touch : string;
component my_comp
port (
in1 : in std_logic;
out1 : out std_logic);
end component;
attribute dont_touch of my_comp : component is "yes";
VHDL Example on Architecture
architecture rtl of test is
attribute dont_touch : string;
attribute dont_touch of rtl : architecture is "yes";
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cckkppll

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值