没有合适的资源?快使用搜索试试~ 我知道了~
可综合的SystemVerilog,打破 SystemVerilog仅用于验证的神话
需积分: 5 0 下载量 135 浏览量
2024-09-11
18:57:40
上传
评论
收藏 312KB PDF 举报
温馨提示
SystemVerilog 不仅仅用于验证!在最初设计 SystemVerilog 标准时,其主要目标之一是创建可综合的复杂硬件设计模型。SystemVerilog的主要目标之一是为复杂的硬件设计创建可综合的模型更准确、代码行数更少。这一目标已经实现,Synopsys 公司在 Design Compiler (DC) 和 Synplify-Pro 中出色地实现了 SystemVerilog。本文详细分析了用于 ASIC 和 FPGA 设计的 SystemVerilog 可综合子集,并介绍了使用这些构造的优势、 并介绍了与传统 Verilog 相比使用这些构造的优势。读者将读者将从本文中获得新的 RTL 建模技巧,这些技巧确实能以更少的代码行数进行建模,同时还能以更少的代码行数进行建模。同时还能减少潜在的设计错误,实现较高的综合结果质量 (QoR)。目标受众 参与 RTL 设计和综合的工程师,针对 ASIC 和 FPGA实现。
资源推荐
资源详情
资源评论
SNUG Silicon Valley 2013 1 Synthesizing SystemVerilog
Synthesizing SystemVerilog
Busting the Myth that SystemVerilog is only for Verification
ABSTRACT
SystemVerilog is not just for Verification! When the SystemVerilog standard was first devised, one
of the primary goals was to enable creating synthesizable models of complex hardware designs
more accurately and with fewer lines of code. That goal was achieved, and Synopsys has done a
great job of implementing SystemVerilog in both Design Compiler (DC) and Synplify-Pro. This
paper examines in detail the synthesizable subset of SystemVerilog for ASIC and FPGA designs,
and presents the advantages of using these constructs over traditional Verilog. Readers will take
away from this paper new RTL modeling skills that will indeed enable modeling with fewer lines
of code, while at the same time reducing potential design errors and achieving high synthesis
Quality of Results (QoR).
Target audience: Engineers involved in RTL design and synthesis, targeting ASIC and FPGA
implementations.
Note: The information in this paper is based on Synopsys Design Compiler (also called HDL Compiler)
version 2012.06-SP4 and Synopsys Synplify-Pro version 2012.09-SP1. These were the most current
released versions available at the time this paper was written.
Stuart Sutherland
Sutherland HDL, Inc.
stuart@sutherland-hdl.com
Don Mills
Microchip Technology, Inc.
mills@microchip.com
SNUG Silicon Valley 2013 2 Synthesizing SystemVerilog
Table of Contents
1. Data types .................................................................................................................................4
1.1 Value sets ......................................................................................................................5
1.2 Net types .......................................................................................................................6
1.3 Variable types ...............................................................................................................6
1.4 Vector declarations (packed arrays) ..............................................................................6
1.5 Arrays (unpacked arrays) ..............................................................................................7
1.6 User-defined types ........................................................................................................9
2. Parameterized models .............................................................................................................13
3. Shared declaration spaces — packages and $unit ...................................................................14
3.1 Packages ......................................................................................................................14
3.2 $unit ............................................................................................................................16
4. RTL programming ..................................................................................................................17
4.1 Procedural blocks ........................................................................................................17
4.2 Operators .....................................................................................................................20
4.3 Casting ........................................................................................................................22
4.4 Decision statements ....................................................................................................23
4.5 Loop statements ..........................................................................................................26
4.6 Tasks and functions ....................................................................................................27
5. Module ports (internal to a module) .......................................................................................29
6. Netlists ....................................................................................................................................30
7. Interfaces .................................................................................................................................31
8. Miscellaneous synthesizable SystemVerilog constructs .........................................................33
8.1 Ending names ..............................................................................................................33
8.2 ‘begin_keywords and ‘end_keywords .......................................................................34
8.3 Vector fill tokens ........................................................................................................35
8.4 Constant variables (const) ...........................................................................................36
8.5 timeunit and timeprecision ..........................................................................................36
8.6 Expression size functions ($clog2, $bits) ...................................................................36
8.7 Assertions ....................................................................................................................37
9. Other synthesizable constructs ................................................................................................38
10. Difference between Design Compiler and Synplify-Pro ........................................................38
11. Wish List and Recommendations ...........................................................................................39
11.1 uwire single source nets ..............................................................................................39
11.2 Foreach loops ..............................................................................................................40
11.3 Task/function inputs with defaults ..............................................................................40
11.4 Task/function ref arguments .......................................................................................41
11.5 Set membership operator (inside) with expressions ...................................................42
11.6 Package chaining ........................................................................................................42
11.7 Extern module declarations ........................................................................................43
11.8 Configurations ............................................................................................................43
11.9 User-defined net types and generic net types .............................................................43
12. Summary .................................................................................................................................43
13. Acknowledgements .................................................................................................................44
14. References ...............................................................................................................................44
SNUG Silicon Valley 2013 3 Synthesizing SystemVerilog
1.0 Introduction — debunking the Verilog vs. SystemVerilog myth
There is a common misconception that “Verilog” is a hardware modeling language that is synthesizable,
and “SystemVerilog” is a verification language that is not synthesizable. That is completely false!
Verilog was first introduced in 1984 as a dual-purpose language to be used to both model hardware
functionality and to describe verification testbenches. Many of the Verilog language constructs, such as
if...else decision statements, were intended to be used for both hardware modeling and verification. A
number of the original Verilog constructs were intended strictly for verification, such as the
$display
print statement, and have no direct representation in hardware. Synthesis is concerned with the hardware
modeling aspect of the language, and therefore only supports a subset of the original Verilog language.
The IEEE officially standardized the Verilog language in 1995, with the standards number 1364-1995,
nicknamed Verilog-1995 [1].The IEEE then began work on extending the language for both design and
verification, and in 2001 released the 1364-2001 standard, commonly referred to as Verilog-2001 [2]. A
year later, the IEEE published the 1364.1-2002 Verilog RTL Synthesis standard [3], which defined the
subset of Verilog-2001 that should be considered synthesizable.
The IEEE also updated the Verilog standard, as 1364-2005, aka Verilog-2005 [4]. However, Integrated
Circuit functionality, complexity, and clock speeds evolved so rapidly in the 2000s, that an incremental
update to the Verilog standard was not going to be enough to keep pace with the continually greater
demand on the language capability to represent both hardware models and verification testbenches. The
new features that the IEEE specified to enhance the Verilog language were so substantial that the IEEE
created a new standards number, 1800-2005, and a new nickname, SystemVerilog [5], just to describe the
language additions. SystemVerilog-2005 was not a stand-alone language — it was merely a set of
extensions on top of Verilog-2005. One reason for the two documents was to help companies who provide
Verilog simulators and synthesis compilers to focus on implementing all of the new capabilities.
The confusing name change... In 2009, the IEEE merged the Verilog 1364-2005 and the SystemVerilog
extensions (1800-2005) into a single document. For reasons the authors have never understood, the IEEE
chose to stop using the original Verilog name, and changed the name of the merged standard to
SystemVerilog. The original 1364 Verilog standard was terminated, and the IEEE ratified the 1800-2009
SystemVerilog-2009 standard [6] as a complete hardware design and verification language. In the IEEE
nomenclature, there is no longer a current Verilog standard. There is only a SystemVerilog standard. Since
2009, you have not been using Verilog...you have been designing with—and synthesizing—
SystemVerilog! (The IEEE has subsequently released a SystemVerilog-2012 standard, with additional
enhancements to the original, now defunct, Verilog language.)
It is important to note that the SystemVerilog standard extended both the verification and the hardware
modeling capabilities of Verilog. The language growth chart in Figure 1 that follows is not intended to be
comprehensive, but serves to illustrate that a substantial number of the SystemVerilog extensions to the
original Verilog enhance the ability to model hardware. The focus of this paper is on how these constructs
synthesize and the advantages of using these SystemVerilog extensions in hardware design.
SNUG Silicon Valley 2013 4 Synthesizing SystemVerilog
Figure 1. Verilog to SystemVerilog growth chart
The intent of this paper is to provide a comprehensive list of everything that is synthesizable with
Synopsys Design Compiler (DC, also called HDL Compiler) and/or Synplify-Pro. The paper focusses on
the constructs that were added as part of SystemVerilog, and on how users can benefit from using these
enhancements. Synthesizable modeling constructs that are from the various versions of the Verilog
standard are mentioned for completeness, but are not discussed in detail in this paper.
It should be noted that there is no official SystemVerilog synthesis standard. The IEEE chose not to update
the 1364.1 Verilog synthesis standard to reflect the many synthesizable extensions that were added with
SystemVerilog. The authors feel that this is short-sighted and is a disservice to the engineering community,
but hope that this paper, used in conjunction with the old 1364.1-2002 Verilog synthesis standard, can
serve as an unofficial standard for the synthesizable subset of SystemVerilog.
2. Data types
Note: In this paper, the term “value sets” is used to refer to 2-state values (0 and 1) and 4-state values (0, 1,
Z, X). The term “data types” is used as a general term for all net types, variable types, and user-defined
types. The terms value sets and data types are not used in the same way in the official IEEE SystemVerilog
standard [7], which is written primarily for companies that implement software tools such as simulators
and synthesis compilers. The SystemVerilog standard uses terms such as “types”, “objects” and “kinds”,
which have specific meaning for those that implement tools, but which the authors feel are neither
commonplace nor intuitive for engineers that use the SystemVerilog language.
SNUG Silicon Valley 2013 5 Synthesizing SystemVerilog
2.1 Value sets
The original Verilog language only had 4-state values, where each bit of a vector could be a logic 0, 1, Z or
X. SystemVerilog added the ability to represent 2-state values, where each bit of a vector can only be 0 or
1. SystemVerilog added the
bit and logic keywords to the Verilog language to represent 2-state and 4-
state value sets, respectively. SystemVerilog net types, such as
wire, only use the logic 4-state value set.
Some variable types use 4-state
logic value sets, while other variables use 2-state bit value sets. (There
is more to the
bit and logic keywords for those that implement simulators and synthesis compilers, but
this generalization suffices for understanding how to model designs using SystemVerilog.)
The
bit and logic keywords can also be used without explicitly defining a net or variable, in which case
a net or variable is inferred from context. The keyword
bit always infers a variable. The keyword logic
infers a variable in most contexts, but infers a net if used in conjunction with a module input or inout
port declaration. The following declarations illustrate these inference rules:
module A;
...
endmodule
module M (
// module ports with inferred types
input i1, // infers a 4-state net
input logic i2, // infers a 4-state net
input bit i3, // infers a 2-state variable
output o1, // infers a 4-state net
output logic o2, // infers a 4-state variable
output bit o3 // infers a 2-state variable
);
// internal signals with inferred and explicit types
bit clock; // infers a 2-state variable
logic reset; // infers a 4-state variable
logic [7:0] data; // infers a 4-state variable
wire [7:0] n1; // explicitly declares a net, infers 4-state logic
wire logic [7:0] n2; // explicitly declares a 4-state net
var [7:0] v1; // explicitly declares a variable, infers logic
var logic [7:0] v2; // explicitly declares a 4-state variable
...
endmodule
Important: Synthesis treats bit and logic the same. 2-state and 4-state value sets are for simulation, and
have no meaning in synthesis.
SystemVerilog Advantage 1 — You no longer need to worry about when to declare modules ports
as
wire or reg (or, more specifically, a net or a variable). With SystemVerilog, you can declare all
module ports and local signals as
logic, and the language will correctly infer nets or variables for
you (there might be an occasional exception, where an engineer wishes to explicitly use a type
other than what
logic will infer, but those exceptions are rare).
Note that verification code is a little different. In a testbench, randomly generated test values should be
declared as
bit (2-state), rather than logic (4-state). See Sutherland [20] for a detailed exploration of
using 2-state and 4-state types in design and verification code.
剩余44页未读,继续阅读
资源评论
元直数字电路验证
- 粉丝: 7w+
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Java的简单文章管理系统设计源码
- 基于湖北商贸学院Java实习的资料汇总设计源码
- #Mitsubishi 三菱 PLC张力控制通用程序模板 采用三菱伺服FX3U的速度与力矩模式,收料采 用锥度与恒张力两种控制
- 基于Python实现的实用Windows CMD小命令集设计源码
- 基于Html+JavaScript+CSS+Java的母婴商城设计源码
- 77.潜龙出海副图选股.tn6
- The dataset for Nature Communications
- #Simulink #汽车级锂电池模型 均值模糊控制 MATLAB-simulink主动均衡电路模型 动力锂电池模组(16节
- 基于Html与Python的杨金秋组小组自动化合作设计源码
- L C型逆变器仿真, 控制方式选择电流闭环控制,调制方式为 svpwm 系统分别在 dq 坐标系下,状态方程下,传递函数下进行表
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功