没有合适的资源?快使用搜索试试~ 我知道了~
首页SystemVerilog-2012:统一硬件设计、规范与验证语言标准
"SystemVerilog-1800-2012.pdf 是一份关于SystemVerilog的官方标准文档,由IEEE发布,旨在统一硬件设计、规范和验证语言。该标准由IEEE计算机学会的设计自动化标准委员会和IEEE标准协会企业顾问组赞助。这份文档是2012年对2009年版本的修订版(IEEE Std 1800™-2009),在2012年12月5日得到IEEE-SA标准局的批准。"
SystemVerilog是一种强大的硬件描述语言(HDL),它不仅用于描述数字系统的结构,还支持高级的验证方法。作为编程语言,SystemVerilog提供了丰富的语法特性,使得设计者可以进行更高效、更精确的硬件建模和验证。以下是一些关键的知识点:
1. **数据类型**:SystemVerilog支持多种数据类型,包括基本类型(如int、byte、logic)、枚举、数组、结构体、联合体等,以及位向量类型(bit、reg)。
2. **并发结构**:SystemVerilog引入了进程(process)的概念,如always_comb、always_latch、always_ff等,它们分别对应于组合逻辑、边沿触发和电平触发的时序逻辑。
3. **接口与类**:接口(interface)用于定义无状态的行为,而类(class)则引入面向对象编程的概念,支持继承、封装和多态性,这在验证环境中尤其有用。
4. **约束与随机化**:SystemVerilog引入了基于约束的随机化,允许设计者定义随机变量的约束条件,以生成有意义的随机测试激励。
5. **覆盖点和覆盖率**:覆盖点(coverage points)和覆盖率(coverage)是验证的关键组成部分,它们帮助验证工程师评估验证活动的全面性。
6. **事务级建模**:SystemVerilog支持事务级建模(Transaction-Level Modeling, TLM),允许设计者用抽象的事务来描述系统行为,提高验证效率。
7. **验证组件和环境**:SystemVerilog提供了预定义的验证组件,如assertion(断言)、property(属性)、checker(检查器)等,以及用于构建验证环境的高级构造。
8. **并行与互连**:SystemVerilog支持复杂的并行操作和互连结构,如pipeline、fork-join、event queues和channels,这些特性对于多核和分布式系统的设计和验证至关重要。
9. **接口与模块的综合**:虽然SystemVerilog主要用于高级验证,但部分特性如非阻塞赋值(non-blocking assignments)、接口等也可被综合工具处理,生成可实现的RTL代码。
10. **IP-XACT**:SystemVerilog与IP-XACT(IEEE 1685)标准结合,提供了一种标准化的方法来描述、包装和集成知识产权(IP)核。
通过这份标准文档,读者能够深入理解SystemVerilog的各种特性,从而在硬件设计和验证过程中更加得心应手。对于从事SoC(System on Chip)设计、验证工程师或集成电路领域的专业人士来说,掌握SystemVerilog是非常重要的技能。

xiv
Copyright © 2013 IEEE. All rights reserved.
11. Operators and expressions ............................................................................................................... 218
11.1 General................................................................................................................................. 218
11.2 Overview.............................................................................................................................. 218
11.3 Operators.............................................................................................................................. 219
11.4 Operator descriptions........................................................................................................... 223
11.5 Operands .............................................................................................................................. 243
11.6 Expression bit lengths.......................................................................................................... 247
11.7 Signed expressions............................................................................................................... 249
11.8 Expression evaluation rules .................................................................................................250
11.9 Tagged union expressions and member access.................................................................... 251
11.10 String literal expressions...................................................................................................... 253
11.11 Operator overloading ........................................................................................................... 254
11.12 Minimum, typical, and maximum delay expressions .......................................................... 256
11.13 Let construct ........................................................................................................................ 258
12. Procedural programming statements ............................................................................................... 264
12.1 General................................................................................................................................. 264
12.2 Overview.............................................................................................................................. 264
12.3 Syntax .................................................................................................................................. 264
12.4 Conditional if–else statement...............................................................................................265
12.5 Case statement ..................................................................................................................... 270
12.6 Pattern matching conditional statements ............................................................................. 275
12.7 Loop statements ................................................................................................................... 279
12.8 Jump statements................................................................................................................... 283
13. Tasks and functions (subroutines) ................................................................................................... 285
13.1 General................................................................................................................................. 285
13.2 Overview.............................................................................................................................. 285
13.3 Tasks .................................................................................................................................... 285
13.4 Functions.............................................................................................................................. 289
13.5 Subroutine calls and argument passing................................................................................ 295
13.6 Import and export functions.................................................................................................300
13.7 Task and function names .....................................................................................................300
13.8 Parameterized tasks and functions....................................................................................... 300
14. Clocking blocks ............................................................................................................................... 302
14.1 General................................................................................................................................. 302
14.2 Overview.............................................................................................................................. 302
14.3 Clocking block declaration ..................................................................................................302
14.4 Input and output skews ........................................................................................................ 304
14.5 Hierarchical expressions ...................................................................................................... 305
14.6 Signals in multiple clocking blocks ..................................................................................... 306
14.7 Clocking block scope and lifetime....................................................................................... 306
14.8 Multiple clocking blocks example....................................................................................... 306
14.9 Interfaces and clocking blocks............................................................................................. 307
14.10 Clocking block events.......................................................................................................... 308
14.11 Cycle delay: ## .................................................................................................................... 308
14.12 Default clocking................................................................................................................... 309
14.13 Input sampling ..................................................................................................................... 310
14.14 Global clocking.................................................................................................................... 311

xv
Copyright © 2013 IEEE. All rights reserved.
14.15 Synchronous events ............................................................................................................. 315
14.16 Synchronous drives.............................................................................................................. 315
15. Interprocess synchronization and communication........................................................................... 320
15.1 General................................................................................................................................. 320
15.2 Overview.............................................................................................................................. 320
15.3 Semaphores.......................................................................................................................... 320
15.4 Mailboxes............................................................................................................................. 322
15.5 Named events....................................................................................................................... 325
16. Assertions......................................................................................................................................... 330
16.1 General................................................................................................................................. 330
16.2 Overview.............................................................................................................................. 330
16.3 Immediate assertions............................................................................................................ 330
16.4 Deferred assertions .............................................................................................................. 333
16.5 Concurrent assertions overview........................................................................................... 340
16.6 Boolean expressions ............................................................................................................ 343
16.7 Sequences............................................................................................................................. 344
16.8 Declaring sequences ............................................................................................................ 348
16.9 Sequence operations ............................................................................................................ 356
16.10 Local variables..................................................................................................................... 378
16.11 Calling subroutines on match of a sequence........................................................................ 384
16.12 Declaring properties............................................................................................................. 385
16.13 Multiclock support............................................................................................................... 411
16.14 Concurrent assertions........................................................................................................... 421
16.15 Disable iff resolution ........................................................................................................... 438
16.16 Clock resolution................................................................................................................... 440
16.17 Expect statement .................................................................................................................. 445
16.18 Clocking blocks and concurrent assertions.......................................................................... 446
17. Checkers........................................................................................................................................... 448
17.1 Overview.............................................................................................................................. 448
17.2 Checker declaration ............................................................................................................. 448
17.3 Checker instantiation ........................................................................................................... 451
17.4 Context inference................................................................................................................. 454
17.5 Checker procedures.............................................................................................................. 455
17.6 Covergroups in checkers...................................................................................................... 457
17.7 Checker variables................................................................................................................. 458
17.8 Functions in checkers........................................................................................................... 464
17.9 Complex checker example................................................................................................... 464
18. Constrained random value generation ............................................................................................. 467
18.1 General................................................................................................................................. 467
18.2 Overview.............................................................................................................................. 467
18.3 Concepts and usage.............................................................................................................. 467
18.4 Random variables ................................................................................................................ 470
18.5 Constraint blocks ................................................................................................................. 472
18.6 Randomization methods ...................................................................................................... 492
18.7 In-line constraints—randomize() with................................................................................. 493
18.8 Disabling random variables with rand_mode() ................................................................... 496
18.9 Controlling constraints with constraint_mode() .................................................................. 497

xvi
Copyright © 2013 IEEE. All rights reserved.
18.10 Dynamic constraint modification......................................................................................... 498
18.11 In-line random variable control ........................................................................................... 499
18.12 Randomization of scope variables—std::randomize()......................................................... 500
18.13 Random number system functions and methods ................................................................. 501
18.14 Random stability .................................................................................................................. 503
18.15 Manually seeding randomize ............................................................................................... 505
18.16 Random weighted case—randcase ...................................................................................... 506
18.17 Random sequence generation—randsequence..................................................................... 507
19. Functional coverage......................................................................................................................... 517
19.1 General................................................................................................................................. 517
19.2 Overview.............................................................................................................................. 517
19.3 Defining the coverage model: covergroup........................................................................... 518
19.4 Using covergroup in classes ................................................................................................ 520
19.5 Defining coverage points ..................................................................................................... 522
19.6 Defining cross coverage....................................................................................................... 533
19.7 Specifying coverage options................................................................................................ 542
19.8 Predefined coverage methods .............................................................................................. 547
19.9 Predefined coverage system tasks and system functions..................................................... 549
19.10 Organization of option and type_option members .............................................................. 549
19.11 Coverage computation ......................................................................................................... 550
20. Utility system tasks and system functions ....................................................................................... 555
20.1 General................................................................................................................................. 555
20.2 Simulation control system tasks .......................................................................................... 556
20.3 Simulation time system functions........................................................................................ 556
20.4 Timescale system tasks........................................................................................................ 558
20.5 Conversion functions ........................................................................................................... 561
20.6 Data query functions............................................................................................................ 562
20.7 Array querying functions ..................................................................................................... 564
20.8 Math functions ..................................................................................................................... 566
20.9 Bit vector system functions.................................................................................................. 568
20.10 Severity tasks ....................................................................................................................... 569
20.11 Elaboration system tasks...................................................................................................... 570
20.12 Assertion control system tasks.............................................................................................571
20.13 Sampled value system functions.......................................................................................... 578
20.14 Coverage system functions ..................................................................................................579
20.15 Probabilistic distribution functions...................................................................................... 579
20.16 Stochastic analysis tasks and functions ............................................................................... 581
20.17 Programmable logic array modeling system tasks .............................................................. 583
20.18 Miscellaneous tasks and functions....................................................................................... 586
21. Input/output system tasks and system functions.............................................................................. 588
21.1 General................................................................................................................................. 588
21.2 Display system tasks............................................................................................................ 588
21.3 File input/output system tasks and system functions........................................................... 599
21.4 Loading memory array data from a file ............................................................................... 609
21.5 Writing memory array data to a file..................................................................................... 613
21.6 Command line input............................................................................................................. 614
21.7 Value change dump (VCD) files ......................................................................................... 617

xvii
Copyright © 2013 IEEE. All rights reserved.
22. Compiler directives.......................................................................................................................... 638
22.1 General................................................................................................................................. 638
22.2 Overview ............................................................................................................................. 638
22.3 `resetall................................................................................................................................. 638
22.4 `include ................................................................................................................................ 639
22.5 `define, `undef, and `undefineall ......................................................................................... 639
22.6 `ifdef, `else, `elsif, `endif, `ifndef ........................................................................................ 645
22.7 `timescale............................................................................................................................. 648
22.8 `default_nettype ................................................................................................................... 649
22.9 `unconnected_drive and `nounconnected_drive .................................................................. 650
22.10 `celldefine and `endcelldefine.............................................................................................. 650
22.11 `pragma ................................................................................................................................ 650
22.12 `line ...................................................................................................................................... 651
22.13 `__FILE__ and `__LINE__ ................................................................................................. 652
22.14 `begin_keywords, `end_keywords ....................................................................................... 653
Part Two: Hierarchy Constructs
23. Modules and hierarchy..................................................................................................................... 660
23.1 General................................................................................................................................. 660
23.2 Module definitions............................................................................................................... 660
23.3 Module instances (hierarchy)............................................................................................... 672
23.4 Nested modules.................................................................................................................... 683
23.5 Extern modules .................................................................................................................... 684
23.6 Hierarchical names .............................................................................................................. 685
23.7 Member selects and hierarchical names .............................................................................. 688
23.8 Upwards name referencing .................................................................................................. 689
23.9 Scope rules .......................................................................................................................... 692
23.10 Overriding module parameters ............................................................................................ 694
23.11 Binding auxiliary code to scopes or instances ..................................................................... 701
24. Programs .......................................................................................................................................... 705
24.1 General................................................................................................................................. 705
24.2 Overview.............................................................................................................................. 705
24.3 The program construct ......................................................................................................... 705
24.4 Eliminating testbench races .................................................................................................709
24.5 Blocking tasks in cycle/event mode..................................................................................... 709
24.6 Programwide space and anonymous programs.................................................................... 710
24.7 Program control tasks .......................................................................................................... 710
25. Interfaces.......................................................................................................................................... 711
25.1 General................................................................................................................................. 711
25.2 Overview.............................................................................................................................. 711
25.3 Interface syntax.................................................................................................................... 712
25.4 Ports in interfaces........................................................................................................
......... 716
25.5 Modports.............................................................................................................................. 717
25.6 Interfaces and specify blocks...............................................................................................723
25.7 Tasks and functions in interfaces......................................................................................... 724
25.8 Parameterized interfaces ...................................................................................................... 730
25.9 Virtual interfaces.................................................................................................................. 732
25.10 Access to interface objects................................................................................................... 737

xviii
Copyright © 2013 IEEE. All rights reserved.
26. Packages........................................................................................................................................... 738
26.1 General................................................................................................................................. 738
26.2 Package declarations............................................................................................................ 738
26.3 Referencing data in packages .............................................................................................. 739
26.4 Using packages in module headers...................................................................................... 743
26.5 Search order rules ................................................................................................................ 744
26.6 Exporting imported names from packages .......................................................................... 746
26.7 The std built-in package....................................................................................................... 747
27. Generate constructs.......................................................................................................................... 749
27.1 General................................................................................................................................. 749
27.2 Overview.............................................................................................................................. 749
27.3 Generate construct syntax.................................................................................................... 749
27.4 Loop generate constructs ..................................................................................................... 751
27.5 Conditional generate constructs........................................................................................... 755
27.6 External names for unnamed generate blocks ..................................................................... 758
28. Gate-level and switch-level modeling ............................................................................................. 760
28.1 General................................................................................................................................. 760
28.2 Overview.............................................................................................................................. 760
28.3 Gate and switch declaration syntax ..................................................................................... 760
28.4 and, nand, nor, or, xor, and xnor gates................................................................................. 766
28.5 buf and not gates .................................................................................................................. 767
28.6 bufif1, bufif0, notif1, and notif0 gates................................................................................. 768
28.7 MOS switches ...................................................................................................................... 769
28.8 Bidirectional pass switches.................................................................................................. 770
28.9 CMOS switches ................................................................................................................... 771
28.10 pullup and pulldown sources ............................................................................................... 772
28.11 Logic strength modeling ...................................................................................................... 772
28.12 Strengths and values of combined signals ........................................................................... 774
28.13 Strength reduction by nonresistive devices ......................................................................... 786
28.14 Strength reduction by resistive devices ............................................................................... 786
28.15 Strengths of net types........................................................................................................... 786
28.16 Gate and net delays .............................................................................................................. 787
29. User-defined primitives ................................................................................................................... 791
29.1 General................................................................................................................................. 791
29.2 Overview.............................................................................................................................. 791
29.3 UDP definition..................................................................................................................... 791
29.4 Combinational UDPs ........................................................................................................... 795
29.5 Level-sensitive sequential UDPs ......................................................................................... 796
29.6 Edge-sensitive sequential UDPs .......................................................................................... 796
29.7 Sequential UDP initialization .............................................................................................. 797
29.8 UDP instances...................................................................................................................... 799
29.9 Mixing level-sensitive and edge-sensitive descriptions....................................................... 800
29.10 Level-sensitive dominance ..................................................................................................801
30. Specify blocks.................................................................................................................................. 802
30.1 General................................................................................................................................. 802
30.2 Overview.............................................................................................................................. 802
剩余1314页未读,继续阅读
448 浏览量
243 浏览量
756 浏览量
298 浏览量
2096 浏览量
438 浏览量
151 浏览量
1041 浏览量

idleperson
- 粉丝: 0
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

最新资源
- 心电图前端设计:集成呼吸起搏检测功能
- 移动端省市区三级联动功能实现与展示
- 建筑涂料喷刷机器人的操作指南解析
- 深入解析Android MaterialDialog开源项目
- Linux命令库详解与Shell操作指南
- dotlambda库:Racket中支持点标识符和Lambda表达式
- PLSQL与Oracle客户端使用与配置教程
- IDEA开发的图书管理系统功能详解
- Bootstrap前端模板开发快速指南
- Android平台的简易数独游戏教程
- Android ReCap API示例代码教程
- 全隔离式锂离子电池监控与保护系统设计
- 模式分类Duda课后习题Matlab程序实现与工具箱指南
- Python脚本自动获取B站直播奖励
- 新型建筑用混凝土定型模具的介绍与应用
- Odoo10公司系统邮件发送功能学习指南
安全验证
文档复制为VIP权益,开通VIP直接复制
