【数字IC前端】浅谈SystemVerilog与UVM标准的发展(上)

本文深入探讨了SystemVerilog与UVM标准的发展历程,分析了这两种标准如何改变了硬件验证领域,以及在发展中遇到的问题。文章强调了标准化的重要性,特别是在提升工具兼容性和用户生产力方面的作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

浅谈SystemVerilog与UVM标准的发展(下)

每当一种标准模式,如Systemverilog and UVM ,被广泛采用时,无疑对用户和工具开发商都是有利的。对于用户而言,终于可以在多种工具中采用统一的代码准则了。而对于工具开发商,开发的工具也只需要支持一种特定的语言或者库就可以了。

但是呢,标准这些东西毕竟也都是人定的,标准不断发展衍进的过程中,缺点自然也是有的。

标准制定的缺点就在于所有的标准最终会到达一个使得收益递减的点,在这个点时,标准往往可以满足大多数用户的需求,而这时,标准制定委员会会受到一些非典型用户的驱使,这些不安分的用户会追求那些更优秀的功能,使标准不断创新“进步”,变成“更好”。但是不幸的是,这些功能经常使标准变得相当复杂,而且效率低,并且可能与以前版本的标准不兼容。标准的主要目标是为用户提供一个稳定好用的平台,而这些鸡肋的新功能点可能对用户的意义真的不大。

本文分上下两篇,上篇主要分析一下SystemVerilog与UVM标准的发展历程。下篇会谈到对UVM标准未来的发展动向的看法。

验证语言的发展

IEEE标准协会主席KarenBartleson 简要介绍了EDA发展的理想准则——“在标准上合作,在产品上展开竞争”。SystemVerilog和通用验证方法(Universal VerificationMethodology,UVM)

就是这一原则下较理想的产物。在这些标准出现之前,用户不得不使用诸如Verilog或者Vhdl等硬件描述语言(HDL)来创建它们的测试平台,或者使用专用硬件验证语言(HVL),但HVL将会将用户和特定的EDA供应商绑定,因为不同工具商支持的HVL都有所不同。HVL的产生,说明了HDL本身实在没办法对越来越复杂的设计,进行有效的建模验证。HVL主要由有这样两个关键的特性,使他们能够推广开来。

  • 其一是HVL描述对象的能力,对象可以在运行时具体分配,这使得描述testbench时更为灵活,而HDL的所有组件在初始时刻时就被静态地实例化了。
  • 其二是HVL带约束的随机化能力。将二者结合,就意味着验证环境可以依据算法创建,并且允许随机化的环境结构和随机化的激励数据。

在SystemVerilog标准的开发过程中,委员会明智地决定不对具体解决算法进行标准化,这就使得不同工具商间产生竞争,都力求在最短的时间内实现最大的解决空间覆盖率。这种竞争机制推动了工具开发这个重要领域的创新,对用户生产率具有深远的影响。HVL的开发,部分原因是由于认识到SOC功能验证实际上是软件问题而不是硬件问题。当HDL只能描述芯片中的静态硬件时,芯片操作却很期待一个“真实世界”,这个“真实世界”需要有很多动态行为,这些动态行为需要描述语言具有随机化、对象和其他HVL特征才能实现。另外,用户很快意识到,这些行为的环境可能相当复杂,并从头开始为每个项目重新开发新环境不是很可行的策略。因此诞生了验证方法的概念,以促进验证IP的重用。

第一种验证方法是由特定语言编写的,并只有特定的工具才能用,早期HVL自身就是基于不同工具特定的。一旦用户选择了一种语言与相应的模拟器,就非常难换到另一个家供应商了,因为这意味着必须要基于另一种语言,重写测试平台代码。不过后来即使出现了SystemVerilog,这种情况也并未改变太多,EDA供应商有一些专有语言扩展或底层PLI代码,因此仍然会锁定用户选择特定的工具和供应商。即使许多供应商声称支持SystemVerilog标准,即使用户也坚持使用所有的EDA供应商都支持的SystemVerilog公共子集,EDA工具还是会不支持由不兼容的方法编写的IP。

不过标准化的UVM解决了这些问题,如今,所有主要的模拟器供应商都支持UVM了。

SYSTEM VERILOG的发展

SystemVerilog源于一种名为SUPERLOG的语言,SUPERLOG是1999年由Verilog的原创者开发的。开发者的本意是替代verilog成为更现代化的描述语言,然而用户并不愿意从头开始使用一种新的语言,用户的Verilog设计和验证平台代码数据库已经很庞大了,所以他们显然只接受进化的方法,而不接收革命性方法。所以SUPERLOG语言只好被重新设计定义,以100%向下兼容Verilog。

最后,SUPERLOG赠给了Accellera,并成为2002年第一版SystemVerilog 3.0的基础。SystemVerilog将包括Verilog,Specman和Vera在内的许多不同语言融合成一个统一的设计与验证语言。在过去十年里,SystemVerilog已经集合了许多功能。开始时只作为Verilog加强版的140页面说明,到现在是一个1400页的手册了。

当然,一般人是不会注意到SystemVerilog各种功能的发展的历史因素了,想从SystemVerilog中删掉一些功能还是很困难的。比如always_comb与always @ *等。

在这里插入图片描述

在Verilog-2001标准发布之前,SUPERLOG创建一些方案解决自动生成敏感列表问题,而且比verilog更进一步,SUPERLOG还解决了一些其他问题。如当A和B是常数的情况时,这样输入就没有变化,out也一直没有初始化。SystemVerilog的always_comb语法解决了这一问题,always_comb保证在0时刻会执行一次。SystemVerilog中现在有了这样的两个构造几乎完全相同的东西,可能很多人大概并不知道always_comb。

UVM 的发展

用户一直在努力期望实现“模块化,可扩展和可复用的通用验证环境”, 最终就形成了UVM标准此前基于SystemVerilog的验证方法学主要有两种

  • 一是由Mentor Graphics和Cadence公司共同开发的OVM
  • 另一个是由Synopsys开发的VMM
  • 在开发互用性库2时,为了使OVM和VMM基类库能够同时使用,委员会决定开发UVM。

在用户驱动下,委员会很快达成共识,使用OVM作为UVM的基础,使用SystemVerilog作为HVL来实现UVM基类库。2010年5月发布了UVM 1.0EA的“早期使用者”版本,随后于2011年2月发布了UVM 1.0。从那时起,UVM委员会继续发展,致力于实现UVM1 .2。 在此期间,UVM库在规模和复杂性上继续增长,如表I所示。
表1

1.0p1和1.1之间规模增加的主要原因是,1.1中包括了“phasing”。 这一版本尝试提供一组预定义的方法来细分run_phase,这是在UVM测试平台中所有组件都执行的唯一的基于任务的方法(见图1)。
图1
runtime phasing机制的初衷是为用户安排一组任务,这些任务将以预定义的顺序自动调用,以便用户可以将跨多个组件的类似功能分到同一个phase中。然而,当UVM委员会试图详细定义在每个阶段应该做什么操作时,结果并不很如意,所以最后这部分留出来了,不同的团队或公司可以自行开发,以便在不同阶段执行不同的具体操作。

另一个更长远的想法是允许用户定义自己的phases,或者创建可与原始phases集合并行运行的单独“schedule”的phases,或者在预定义的调度中插入他们自己的phases。但运行阶段(runtime phasing)的可用性的重要要求之一是phase之间向后和向前跳转的能力。但是这个实现起来还是很有难度的。由于phase跳跃可能会导致仿真过早终止,这种情况下,不能对给定phase中的序列和其他可能产生的行为进行有效的控制,UVM委员会建议run-time phase方法仅从test开始sequences时使用,诸如drivers和monitors之类的组件只实现其中run_phase()阶段。不建议在phase之间跳跃,特别是向后跳跃。

有趣的是,从一开始,phase的引入就被认为是UVM的“最高优先级”的功能开发,虽然在几年后,我们仍然没有非常满意的run-time phasing解决方案,但也并不排斥使用它。缺乏这一特定功能似乎并不影响UVM的性能。

UVM1.2复杂度的有有较大跳跃主要是由于UVM的消息和transaction记录能力的增强。

事实上,由于一些复杂的功能打破了向后兼容性,它们实际上可能产生负面影响。因此,重要的是理解何时一个标准才能被视为“完成”。我们将在本文探讨其他UVM改进的变化的影响。

UVM面临的问题

A. UVM Messaging

UVM 通过一组宏来处理UVM消息,这些宏允许用户发出与其相关联的ID消息,以及特定的严重性消息。这些消息被委派给一个名为uvm_report_handler的核心组件,这些组件可以进行配置,进而控制将某些消息打印到输出或日志文件等。报告处理器还允许用户定制消息的外观和布局,并且宏本身允许包括最初创建消息的文件和行号。命令行选项和UVM方法允许在每个组件或每个层级基础上进行详细设置,以抑制某些消息的报告。另外,可以基于消息ID和严重性为消息定义具体动作。UVM已使用这种机制多年,用户也都很熟悉了。

UVM1.2的一个增强的改进是可以在消息中包含多个字段,需要为每个消息使用多个宏:
在这里插入图片描述

它还包括指定“上下文”(即,要打印的消息中的uvm_report_object)的选项。 由于消息可以是INFO,WARNING,ERROR和FATAL类型,这是十六个新宏,另外四个宏用于向消息对象添加字段。这些宏允许用户添加整数、字符串、和uvm_objects作为消息对象的字段。

这种改动只是加入了有限的附加功能,但复杂性明显大大增加了。新添加的功能的价值也有待考察。UVM1.2中向消息添加附加字段,现在可以对消息的不同部分应用不同的操作,因此也可能显示消息的一部分,而另一部分不显示,也可能引入错误条件。这是将功能复杂化的另一个例子,它没有对大批用户进行现场测试,或者没有完全理解可用性的意义。

另外,与1.1d相比,打印消息时,我们的测量结果表明,使用建议的扩展方法来打印消息时,由于需要一些额外处理,所以会产生20%的性能损失,这完全是额外的开销。

B. UVM Transaction Recording

在UVM中,transaction记录可以将特定对象的信息记录到模拟调试数据库中。由于每个模拟器都有自己的格式,因此选择了一个通用的API,每个模拟供应商都可以基于此实现记录。

但transaction 记录API的更改与1.1d不兼容,就要求EDA供应商基于用户使用的版本,提供两种机制来支持transaction 记录。除了对EDA供应商的产生额外负担,我们的性能测试表明相对于1.1d还会导致约65%的减速,我们认为这一功能,并不值得使性能下降。

结束语

所以,本文的立场是,SystemVerilog和UVM都已达到相对完善稳定的情况,而不需要因为小众用户的需要而添加新的特性。这时应进入“冷却阶段”,为工具开发商提供一个较为稳定的版本,并在此基础上进行创新。下篇会谈到对UVM标准未来的发展动向的看法。

Table of Contents Section 1 Introduction to SystemVerilog ...................................................................................................... 1 Section 2 Literal Values.................................................................................................................................. 4 2.1 Introduction (informative) ...............................................................................................................4 2.2 Literal value syntax..........................................................................................................................4 2.3 Integer and logic literals ..................................................................................................................4 2.4 Real literals ......................................................................................................................................5 2.5 Time literals .....................................................................................................................................5 2.6 String literals....................................................................................................................................5 2.7 Array literals ....................................................................................................................................6 2.8 Structure literals ...............................................................................................................................6 Section 3 Data Types....................................................................................................................................... 8 3.1 Introduction (informative) ...............................................................................................................8 3.2 Data type syntax...............................................................................................................................9 3.3 Integer data types ...........................................................................................................................10 3.4 Real and shortreal data types .........................................................................................................11 3.5 Void data type ................................................................................................................................11 3.6 chandle data type ...........................................................................................................................11 3.7 String data type ..............................................................................................................................12 3.8 Event data type...............................................................................................................................16 3.9 User-defined types .........................................................................................................................16 3.10 Enumerations .................................................................................................................................17 3.11 Structures and unions.....................................................................................................................22 3.12 Class...............................................................................................................................................26 3.13 Singular and aggregate types .........................................................................................................27 3.14 Casting ...........................................................................................................................................27 3.15 $cast dynamic casting ....................................................................................................................28 3.16 Bit-stream casting ..........................................................................................................................29 Section 4 Arrays ............................................................................................................................................ 32 4.1 Introduction (informative) .............................................................................................................32 4.2 Packed and unpacked arrays ..........................................................................................................32 4.3 Multiple dimensions ......................................................................................................................33 4.4 Indexing and slicing of arrays........................................................................................................34 4.5 Array querying functions ...............................................................................................................35 4.6 Dynamic arrays ..............................................................................................................................35 4.7 Array assignment ...........................................................................................................................37 4.8 Arrays as arguments.......................................................................................................................38 4.9 Associative arrays ..........................................................................................................................39 4.10 Associative array methods .............................................................................................................41 4.11 Associative array assignment.........................................................................................................44 4.12 Associative array arguments ..........................................................................................................44 4.13 Associative array literals................................................................................................................44 4.14 Queues ...........................................................................................................................................45 4.15 Array manipulation methods .........................................................................................................47 Section 5 Data Declarations ......................................................................................................................... 52 5.1 Introduction (informative) .............................................................................................................52 5.2 Data declaration syntax..................................................................................................................52 5.3 Constants........................................................................................................................................52 Accellera SystemVerilog 3.1a Extensions to Verilog-2001 viii Copyright 2004 Accellera. All rights reserved . 5.4 Variables ........................................................................................................................................53 5.5 Scope and lifetime .........................................................................................................................54 5.6 Nets, regs, and logic.......................................................................................................................55 5.7 Signal aliasing................................................................................................................................56 5.8 Type compatibility .........................................................................................................................58 Section 6 Attributes....................................................................................................................................... 61 6.1 Introduction (informative) .............................................................................................................61 6.2 Default attribute type .....................................................................................................................61 Section 7 Operators and Expressions.......................................................................................................... 62 7.1 Introduction (informative) .............................................................................................................62 7.2 Operator syntax..............................................................................................................................62 7.3 Assignment operators ....................................................................................................................62 7.4 Operations on logic and bit types ..................................................................................................63 7.5 Wild equality and wild inequality..................................................................................................63 7.6 Real operators ................................................................................................................................64 7.7 Size.................................................................................................................................................64 7.8 Sign ................................................................................................................................................64 7.9 Operator precedence and associativity ..........................................................................................64 7.10 Built-in methods ............................................................................................................................65 7.11 Static Prefixes ................................................................................................................................66 7.12 Concatenation ................................................................................................................................67 7.13 Unpacked array expressions ..........................................................................................................67 7.14 Structure expressions .....................................................................................................................68 7.15 Tagged union expressions and member access..............................................................................70 7.16 Aggregate expressions ...................................................................................................................71 7.17 Operator overloading .....................................................................................................................72 7.18 Streaming operators (pack / unpack) .............................................................................................73 7.19 Conditional operator ......................................................................................................................77 7.20 Set membership..............................................................................................................................77 Section 8 Procedural Statements and Control Flow.................................................................................. 79 8.1 Introduction (informative) .............................................................................................................79 8.2 Statements ......................................................................................................................................79 8.3 Blocking and nonblocking assignments ........................................................................................80 8.4 Selection statements.......................................................................................................................81 8.5 Loop statements .............................................................................................................................87 8.6 Jump statements.............................................................................................................................89 8.7 Final blocks....................................................................................................................................89 8.8 Named blocks and statement labels ...............................................................................................90 8.9 Disable ...........................................................................................................................................90 8.10 Event control..................................................................................................................................91 8.11 Level-sensitive sequence controls .................................................................................................93 8.12 Procedural assign and deassign removal .......................................................................................94 Section 9 Processes........................................................................................................................................ 95 9.1 Introduction (informative) .............................................................................................................95 9.2 Combinational logic.......................................................................................................................95 9.3 Latched logic..................................................................................................................................96 9.4 Sequential logic..............................................................................................................................96 9.5 Continuous assignments ................................................................................................................96 9.6 fork...join........................................................................................................................................97 9.7 Process execution threads ..............................................................................................................98 Accellera Extensions to Verilog-2001 SystemVerilog 3.1a Copyright 2004 Accellera. All rights reserved. ix 9.8 Process control ...............................................................................................................................98 9.9 Fine-grain process control ...........................................................................................................100 Section 10 Tasks and Functions................................................................................................................... 102 10.1 Introduction (informative) ...........................................................................................................102 10.2 Tasks ............................................................................................................................................103 10.3 Functions......................................................................................................................................104 10.4 Task and function argument passing ...........................................................................................106 10.5 Import and export functions.........................................................................................................109 Section 11 Classes.......................................................................................................................................... 111 11.1 Introduction (informative) ...........................................................................................................111 11.2 Syntax ..........................................................................................................................................112 11.3 Overview......................................................................................................................................113 11.4 Objects (class instance)................................................................................................................113 11.5 Object properties..........................................................................................................................114 11.6 Object methods ............................................................................................................................114 11.7 Constructors .................................................................................................................................115 11.8 Static class properties...................................................................................................................116 11.9 Static methods..............................................................................................................................116 11.10 This ..............................................................................................................................................116 11.11 Assignment, re-naming and copying ...........................................................................................117 11.12 Inheritance and subclasses ...........................................................................................................118 11.13 Overridden members....................................................................................................................119 11.14 Super ............................................................................................................................................119 11.15 Casting .........................................................................................................................................120 11.16 Chaining constructors ..................................................................................................................120 11.17 Data hiding and encapsulation .....................................................................................................121 11.18 Constant class properties .............................................................................................................121 11.19 Abstract classes and virtual methods ...........................................................................................122 11.20 Polymorphism: dynamic method lookup.....................................................................................123 11.21 Class scope resolution operator :: ................................................................................................123 11.22 Out of block declarations .............................................................................................................124 11.23 Parameterized classes ..................................................................................................................125 11.24 Typedef class ...............................................................................................................................126 11.25 Classes and structures ..................................................................................................................126 11.26 Memory management ..................................................................................................................127 Section 12 Random Constraints .................................................................................................................. 128 12.1 Introduction (informative) ...........................................................................................................128 12.2 Overview......................................................................................................................................128 12.3 Random variables ........................................................................................................................131 12.4 Constraint blocks .........................................................................................................................132 12.5 Randomization methods ..............................................................................................................145 12.6 In-line constraints — randomize() with.......................................................................................147 12.7 Disabling random variables with rand_mode() ...........................................................................148 12.8 Controlling constraints with constraint_mode() ..........................................................................149 12.9 Dynamic constraint modification.................................................................................................150 12.10 In-line random variable control ...................................................................................................150 12.11 Randomization of scope variables — std::randomize()...............................................................151 12.12 Random number system functions and methods .........................................................................153 12.13Random stability ..........................................................................................................................154 12.14 Manually seeding randomize .......................................................................................................156 12.15 Random weighted case — randcase ............................................................................................157 Accellera SystemVerilog 3.1a Extensions to Verilog-2001 x Copyright 2004 Accellera. All rights reserved . 12.16 Random sequence generation — randsequence...........................................................................158 Section 13 Interprocess Synchronization and Communication................................................................ 166 13.1 Introduction (informative) ...........................................................................................................166 13.2 Semaphores ..................................................................................................................................166 13.3 Mailboxes.....................................................................................................................................167 13.4 Parameterized mailboxes .............................................................................................................170 13.5 Event ............................................................................................................................................171 13.6 Event sequencing: wait_order() ...................................................................................................172 13.7 Event variables.............................................................................................................................173 Section 14 Scheduling Semantics................................................................................................................. 176 14.1 Execution of a hardware model and its verification environment ...............................................176 14.2 Event simulation ..........................................................................................................................176 14.3 The stratified event scheduler ......................................................................................................176 14.4 The PLI callback control points...................................................................................................180 Section 15 Clocking Blocks .......................................................................................................................... 181 15.1 Introduction (informative) ...........................................................................................................181 15.2 Clocking block declaration ..........................................................................................................181 15.3 Input and output skews ................................................................................................................183 15.4 Hierarchical expressions ..............................................................................................................184 15.5 Signals in multiple clocking blocks .............................................................................................185 15.6 Clocking block scope and lifetime...............................................................................................185 15.7 Multiple clocking blocks example ...............................................................................................185 15.8 Interfaces and clocking blocks.....................................................................................................186 15.9 Clocking block events..................................................................................................................187 15.10 Cycle delay: ## ............................................................................................................................187 15.11 Default clocking...........................................................................................................................188 15.12 Input sampling .............................................................................................................................189 15.13 Synchronous events .....................................................................................................................189 15.14 Synchronous drives......................................................................................................................190 Section 16 Program Block............................................................................................................................ 193 16.1 Introduction (informative) ...........................................................................................................193 16.2 The program construct .................................................................................................................193 16.3 Multiple programs........................................................................................................................195 16.4 Eliminating testbench races .........................................................................................................195 16.5 Blocking tasks in cycle/event mode.............................................................................................196 16.6 Program control tasks ..................................................................................................................196 Section 17 Assertions ................................................................................................................................... 198 17.1 Introduction (informative) ...........................................................................................................198 17.2 Immediate assertions....................................................................................................................198 17.3 Concurrent assertions overview...................................................................................................200 17.4 Boolean expressions ....................................................................................................................201 17.5 Sequences.....................................................................................................................................203 17.6 Declaring sequences ....................................................................................................................206 17.7 Sequence operations ....................................................................................................................208 17.8 Manipulating data in a sequence..................................................................................................224 17.9 Calling subroutines on match of a sequence................................................................................228 17.10 System functions..........................................................................................................................229 17.11 Declaring properties.....................................................................................................................229 17.12 Multiple clock support .................................................................................................................240 Accellera Extensions to Verilog-2001 SystemVerilog 3.1a Copyright 2004 Accellera. All rights reserved. xi 17.13 Concurrent assertions...................................................................................................................246 17.14 Clock resolution ...........................................................................................................................252 17.15 Binding properties to scopes or instances....................................................................................258 17.16 The expect statement ...................................................................................................................259 Section 18 Hierarchy..................................................................................................................................... 261 18.1 Introduction (informative) ...........................................................................................................261 18.2 Packages.......................................................................................................................................261 18.3 Compilation unit support .............................................................................................................265 18.4 Top-level instance........................................................................................................................266 18.5 Module declarations.....................................................................................................................267 18.6 Nested modules............................................................................................................................267 18.7 Extern modules ............................................................................................................................269 18.8 Port declarations ..........................................................................................................................270 18.9 List of port expressions................................................................................................................271 18.10 Time unit and precision ...............................................................................................................271 18.11 Module instances .........................................................................................................................272 18.12 Port connection rules ...................................................................................................................276 18.13 Name spaces ................................................................................................................................277 18.14 Hierarchical names ......................................................................................................................278 Section 19 Interfaces ..................................................................................................................................... 279 19.1 Introduction (informative) ...........................................................................................................279 19.2 Interface syntax............................................................................................................................280 19.3 Ports in interfaces.........................................................................................................................284 19.4 Modports ......................................................................................................................................285 19.5 Interfaces and specify blocks .......................................................................................................291 19.6 Tasks and functions in interfaces.................................................................................................291 19.7 Parameterized interfaces ..............................................................................................................297 19.8 Virtual interfaces..........................................................................................................................299 19.9 Access to interface objects...........................................................................................................303 Section 20 Coverage...................................................................................................................................... 305 20.1 Introduction (informative) ...........................................................................................................305 20.2 Defining the coverage model: covergroup...................................................................................306 20.3 Using covergroup in classes ........................................................................................................308 20.4 Defining coverage points .............................................................................................................309 20.5 Defining cross coverage...............................................................................................................315 20.6 Specifying coverage options ........................................................................................................319 20.7 Predefined coverage methods ......................................................................................................324 20.8 Predefined coverage system tasks and functions .........................................................................324 20.9 Organization of option and type_option members ......................................................................324 Section 21 Parameters .................................................................................................................................. 326 21.1 Introduction (informative) ...........................................................................................................326 21.2 Parameter declaration syntax .......................................................................................................327 Section 22 Configuration Libraries............................................................................................................. 330 22.1 Introduction (informative) ...........................................................................................................330 22.2 Libraries .......................................................................................................................................330 Section 23 System Tasks and System Functions ........................................................................................ 331 23.1 Introduction (informative) ...........................................................................................................331 23.2 Elaboration-time typeof function.................................................................................................331 Accellera SystemVerilog 3.1a Extensions to Verilog-2001 xii Copyright 2004 Accellera. All rights reserved . 23.3 Typename function ......................................................................................................................331 23.4 Expression size system function ..................................................................................................332 23.5 Range system function.................................................................................................................333 23.6 Shortreal conversions...................................................................................................................333 23.7 Array querying system functions .................................................................................................334 23.8 Assertion severity system tasks ...................................................................................................335 23.9 Assertion control system tasks.....................................................................................................336 23.10 Assertion system functions ..........................................................................................................336 23.11 Random number system functions...............................................................................................337 23.12 Program control ...........................................................................................................................337 23.13 Coverage system functions ..........................................................................................................337 23.14 Enhancements to Verilog-2001 system tasks ..............................................................................337 23.15 $readmemb and $readmemh........................................................................................................338 23.16 $writememb and $writememh .....................................................................................................338 23.17 File format considerations for multi-dimensional unpacked arrays ............................................339 23.18 System task arguments for multi-dimensional unpacked arrays .................................................340 Section 24 VCD Data .................................................................................................................................... 342 Section 25 Compiler Directives.................................................................................................................... 343 25.1 Introduction (informative) ...........................................................................................................343 25.2 ‘define macros..............................................................................................................................343 25.3 `include ........................................................................................................................................344 Section 26 Features under consideration for removal from SystemVerilog ........................................... 345 26.1 Introduction (informative) ...........................................................................................................345 26.2 Defparam statements....................................................................................................................345 26.3 Procedural assign and deassign statements..................................................................................345 Section 27 Direct Programming Interface (DPI) ....................................................................................... 347 27.1 Overview......................................................................................................................................347 27.2 Two layers of the DPI ..................................................................................................................348 27.3 Global name space of imported and exported functions..............................................................349 27.4 Imported tasks and functions .......................................................................................................349 27.5 Calling imported functions ..........................................................................................................355 27.6 Exported functions .......................................................................................................................356 27.7 Exported tasks..............................................................................................................................357 27.8 Disabling DPI tasks and functions...............................................................................................357 Section 28 SystemVerilog Assertion API .................................................................................................... 359 28.1 Requirements ...............................................................................................................................359 28.2 Extensions to VPI enumerations..................................................................................................359 28.3 Static information ........................................................................................................................360 28.4 Dynamic information ...................................................................................................................363 28.5 Control functions .........................................................................................................................366 Section 29 SystemVerilog Coverage API .................................................................................................... 368 29.1 Requirements ...............................................................................................................................368 29.2 SystemVerilog real-time coverage access ...................................................................................369 29.3 FSM recognition ..........................................................................................................................374 29.4 VPI coverage extensions..............................................................................................................377 Section 30 SystemVerilog Data Read API .................................................................................................. 381 30.1 Introduction (informative) ...........................................................................................................381 Accellera Extensions to Verilog-2001 SystemVerilog 3.1a Copyright 2004 Accellera. All rights reserved. xiii 30.2 Requirements ...............................................................................................................................381 30.3 Extensions to VPI enumerations..................................................................................................382 30.4 VPI object type additions.............................................................................................................383 30.5 Object model diagrams ................................................................................................................385 30.6 Usage extensions to VPI routines ................................................................................................387 30.7 VPI routines added in SystemVerilog .........................................................................................388 30.8 Reading data ................................................................................................................................389 30.9 Optionally unloading the data......................................................................................................399 30.10 Reading data from multiple databases and/or different read library providers ...........................399 30.11VPI routines extended in SystemVerilog.....................................................................................402 30.12VPI routines added in SystemVerilog .........................................................................................403 Section 31 SystemVerilog VPI Object Model............................................................................................. 407 31.1 Introduction (informative) ...........................................................................................................407 31.2 Instance .......................................................................................................................................409 31.3 Interface ......................................................................................................................................410 31.4 Program........................................................................................................................................410 31.5 Module (supersedes IEEE 1364-2001 26.6.1) ............................................................................411 31.6 Modport ......................................................................................................................................412 31.7 Interface tf decl ............................................................................................................................412 31.8 Ports (supersedes IEEE 1364-2001 26.6.5) .................................................................................413 31.9 Ref Obj.........................................................................................................................................414 31.10 Variables (supersedes IEEE 1364-2001 section 26.6.8) .............................................................416 31.11 Var Select (supersedes IEEE 1364-2001 26.6.8).........................................................................418 31.12 Typespec ......................................................................................................................................419 31.13 Variable Drivers and Loads (supersedes IEEE 1364-2001 26.6.23) ...........................................421 31.14 Instance Arrays (supersedes IEEE 1364-2001 26.6.2) ................................................................421 31.15 Scope (supersedes IEEE 1364-2001 26.6.3) ...............................................................................422 31.16 IO Declaration (supersedes IEEE 1364-2001 26.6.4) .................................................................423 31.17 Clocking Block ...........................................................................................................................424 31.18 Class Object Definition................................................................................................................425 31.19 Constraint, constraint ordering, distribution, ...............................................................................426 31.20 Constraint expression...................................................................................................................427 31.21 Class Variables ...........................................................................................................................428 31.23 Named Events (supersedes IEEE 1364-2001 26.6.11) ................................................................430 31.24 Task, Function Declaration (supersedes IEEE 1364-2001 26.6.18)............................................431 31.25 Alias Statement ...........................................................................................................................432 31.26 Frames (supersedes IEEE 1364-2001 26.6.20)............................................................................433 31.27 Threads.........................................................................................................................................434 31.28 tf call (supersedes IEEE 1364-2001 26.6.19) ..............................................................................435 31.29 Module path, path term (supersedes IEEE 1364-2001 26.6.15) .................................................436 31.30 Concurrent assertions ..................................................................................................................437 31.31 Property Decl ..............................................................................................................................437 31.32 Property Specification .................................................................................................................438 31.33 Multiclock Sequence Expression ................................................................................................439 31.34 Sequence Declaration .................................................................................................................440 31.35 Sequence Expression ..................................................................................................................441 31.36 Attribute (supersedes IEEE 1364-2001 26.6.42) ........................................................................442 31.37 Atomic Statement (supersedes IEEE 1364-2001 26.6.27) .........................................................443 31.38 If, if else, return, case, do while (supersedes IEEE 1364-2001 26.6.35, 26.6.36).......................444 31.39 waits, disables, expect, foreach (supersedes IEEE 1364 26.6.38) ...............................................445 31.40 Simple expressions (supersedes IEEE 1364-2001 26.6.25) ........................................................446 31.41 Expressions (supersedes IEEE 1364-2001 26.6.26) ....................................................................447 31.42 Event control (supersedes IEEE 1364-2001 26.6.30)..................................................................448 Accellera SystemVerilog 3.1a Extensions to Verilog-2001 xiv Copyright 2004 Accellera. All rights reserved . 31.43 Event stmt (supersedes IEEE 1364-2001 26.6.27) .....................................................................448 31.44 Process (supersedes IEEE 1364-2001 26.6.27) ..........................................................................449 31.45 Assignment (supersedes IEEE 1364-2001 26.6.28) ...................................................................449 Annex A Formal Syntax.............................................................................................................................. 451 Annex B Keywords ...................................................................................................................................... 488 Annex C Std Package ................................................................................................................................. 490 Annex D Linked Lists................................................................................................................................. 492 Annex E DPI C-layer .................................................................................................................................. 498 Annex F Include files .................................................................................................................................. 523 Annex G Inclusion of Foreign Language Code ......................................................................................... 529 Annex H Formal Semantics of Concurrent Assertions ............................................................................ 533 Annex I sv_vpi_user.h................................................................................................................................ 544 Annex J Glossary ........................................................................................................................................ 553 Annex K Bibliography................................................................................................................................. 555 Index 557
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值