没有合适的资源?快使用搜索试试~ 我知道了~
首页Verilog HDL权威指南:IEEE Std 1364-2001详解
Verilog HDL权威指南:IEEE Std 1364-2001详解
需积分: 9 2 下载量 145 浏览量
更新于2024-07-22
收藏 4.31MB PDF 举报
"IEEE Std 1364-2001是Verilog硬件描述语言的权威标准,由IEEE(美国电气和电子工程师协会)发布,是设计自动化标准委员会赞助的项目。该标准对1995年的版本进行了修订,旨在为电子设计自动化领域的工程师们提供一个通用的、形式化的语言,用于描述数字系统的结构和行为。"
**Verilog硬件描述语言** 是一种广泛使用的系统级设计语言,它允许工程师用类似于计算机程序的方式来描述数字逻辑系统。这个标准,即IEEE Std 1364-2001,定义了Verilog语言的语法、语义以及使用方法,涵盖了模块定义、操作符、进程控制、时序控制、数据类型、接口定义等多个方面。
**关键概念与特性:**
1. **模块化设计**:Verilog支持模块化设计,每个模块代表电路的一部分,可以包含输入、输出、内部信号等。模块可以通过实例化进行复用,实现复杂的系统级设计。
2. **数据类型**:Verilog提供了多种数据类型,如位(bit)、字节(byte)、整型(integer)、实型(real)等,以适应不同精度的需求。
3. **操作符**:包括算术操作符、逻辑操作符、比较操作符、位操作符等,用于表达电路的操作逻辑。
4. **过程与时间控制**:`always`块用于描述事件驱动的行为,例如组合逻辑和时序逻辑;`initial`块用于定义初始化行为;`#delay`和`@event`用于时间控制,模拟信号的变化。
5. **结构描述**:Verilog可以描述门级电路,如AND、OR、NOT、DFF(D触发器)等基本逻辑单元,以及更复杂的组件如多路选择器、加法器等。
6. **行为描述**:除了结构描述,Verilog还支持高级行为描述,如任务(task)和函数(function),以及过程赋值(non-blocking assignment)和立即赋值(blocking assignment)。
7. **仿真与综合**:Verilog代码可以被编译和仿真,验证设计的功能正确性;通过综合工具,Verilog代码可以转换为实际的门级电路,实现硬件实现。
**应用领域**:Verilog广泛应用于集成电路设计、FPGA(现场可编程门阵列)开发、ASIC(专用集成电路)设计、系统级验证等。通过使用Verilog,工程师可以实现从高层次的算法描述到低层次的门级实现的无缝过渡。
**版本更新**:从1995年到2001年的修订,IEEE Std 1364-2001可能包含了对语言的改进、错误修复、新特性的添加,以适应不断发展的电子设计技术。
IEEE Std 1364-2001是理解和使用Verilog语言的重要参考资料,对于电子设计工程师来说,它是进行数字系统设计和验证不可或缺的标准文档。
Copyright © 2001 IEEE. All rights reserved. xv
15.3.4 $width ....................................................................................................................... 255
15.3.5 $period ...................................................................................................................... 256
15.3.6 $nochange ................................................................................................................. 257
15.4 Edge-control specifiers .......................................................................................................... 258
15.5 Notifiers: user-defined responses to timing violations .......................................................... 260
15.5.1 Requirements for accurate simulation ...................................................................... 262
15.5.2 Conditions in negative timing checks....................................................................... 264
15.5.3 Notifiers in negative timing checks .......................................................................... 266
15.5.4 Option behavior ........................................................................................................ 266
15.6 Enabling timing checks with conditioned events................................................................... 266
15.7 Vector signals in timing checks............................................................................................. 267
15.8 Negative timing checks.......................................................................................................... 268
16. Backannotation using the Standard Delay Format (SDF)................................................................ 270
16.1 The SDF annotator................................................................................................................. 270
16.2 Mapping of SDF constructs to Verilog.................................................................................. 270
16.2.1 Mapping of SDF delay constructs to Verilog declarations....................................... 270
16.2.2 Mapping of SDF timing check constructs to Verilog............................................... 272
16.2.3 SDF annotation of specparams ................................................................................. 273
16.2.4 SDF annotation of interconnect delays..................................................................... 274
16.3 Multiple annotations .............................................................................................................. 275
16.4 Multiple SDF files ................................................................................................................. 276
16.5 Pulse limit annotation ............................................................................................................ 276
16.6 SDF to Verilog delay value mapping..................................................................................... 277
17. System tasks and functions.............................................................................................................. 278
17.1 Display system tasks.............................................................................................................. 278
17.1.1 The display and write tasks....................................................................................... 279
17.1.2 Strobed monitoring ................................................................................................... 286
17.1.3 Continuous monitoring ............................................................................................. 287
17.2 File input-output system tasks and functions......................................................................... 287
17.2.1 Opening and closing files.......................................................................................... 287
17.2.2 File output system tasks............................................................................................ 289
17.2.3 Formatting data to a string........................................................................................ 290
17.2.4 Reading data from a file............................................................................................ 291
17.2.5 File positioning ......................................................................................................... 295
17.2.6 Flushing output ......................................................................................................... 295
17.2.7 I/O error status .......................................................................................................... 295
17.2.8 Loading memory data from a file ............................................................................. 296
17.2.9 Loading timing data from an SDF file...................................................................... 297
17.3 Timescale system tasks.......................................................................................................... 298
17.3.1 $printtimescale.......................................................................................................... 298
17.3.2 $timeformat............................................................................................................... 299
17.4 Simulation control system tasks ............................................................................................ 302
17.4.1 $finish ....................................................................................................................... 302
17.4.2 $stop.......................................................................................................................... 302
17.5 PLA modeling system tasks................................................................................................... 303
17.5.1 Array types................................................................................................................ 303
17.5.2 Array logic types....................................................................................................... 304
17.5.3 Logic array personality declaration and loading....................................................... 304
17.5.4 Logic array personality formats................................................................................ 304
xvi Copyright © 2001 IEEE. All rights reserved.
17.6 Stochastic analysis tasks ........................................................................................................ 307
17.6.1 $q_initialize............................................................................................................... 307
17.6.2 $q_add....................................................................................................................... 308
17.6.3 $q_remove................................................................................................................. 308
17.6.4 $q_full....................................................................................................................... 308
17.6.5 $q_exam.................................................................................................................... 308
17.6.6 Status codes............................................................................................................... 309
17.7 Simulation time system functions.......................................................................................... 309
17.7.1 $time ......................................................................................................................... 309
17.7.2 $stime........................................................................................................................ 310
17.7.3 $realtime ................................................................................................................... 310
17.8 Conversion functions ............................................................................................................. 311
17.9 Probabilistic distribution functions........................................................................................ 312
17.9.1 $random function...................................................................................................... 312
17.9.2 $dist_ functions......................................................................................................... 313
17.9.3 Algorithm for probabilistic distribution functions.................................................... 314
17.10 Command line input............................................................................................................... 321
17.10.1 $test$plusargs (string)............................................................................................... 322
17.10.2 $value$plusargs (user_string, variable) .................................................................... 322
18. Value change dump (VCD) files...................................................................................................... 325
18.1 Creating the four state value change dump file ..................................................................... 325
18.1.1 Specifying the name of the dump file ($dumpfile)................................................... 325
18.1.2 Specifying the variables to be dumped ($dumpvars)................................................ 326
18.1.3 Stopping and resuming the dump ($dumpoff/$dumpon).......................................... 327
18.1.4 Generating a checkpoint ($dumpall)......................................................................... 328
18.1.5 Limiting the size of the dump file ($dumplimit) ...................................................... 328
18.1.6 Reading the dump file during simulation ($dumpflush)........................................... 329
18.2 Format of the four state VCD file.......................................................................................... 330
18.2.1 Syntax of the four state VCD file ............................................................................. 330
18.2.2 Formats of variable values........................................................................................ 332
18.2.3 Description of keyword commands .......................................................................... 333
18.2.4 Four state VCD file format example......................................................................... 339
18.3 Creating the extended value change dump file...................................................................... 340
18.3.1 Specifying the dumpfile name and the ports to be dumped ($dumpports)............... 340
18.3.2 Stopping and resuming the dump ($dumpportsoff/$dumpportson).......................... 341
18.3.3 Generating a checkpoint ($dumpportsall)................................................................. 342
18.3.4 Limiting the size of the dump file ($dumpportslimit) .............................................. 342
18.3.5 Reading the dump file during simulation ($dumpportsflush)................................... 343
18.3.6 Description of keyword commands .......................................................................... 343
18.3.7 General rules for extended VCD system tasks ......................................................... 344
18.4 Format of the extended VCD file........................................................................................... 344
18.4.1 Syntax of the extended VCD file.............................................................................. 344
18.4.2 Extended VCD node information ............................................................................. 346
18.4.3 Value changes........................................................................................................... 348
18.4.4 Extended VCD file format example ......................................................................... 349
19. Compiler directives.......................................................................................................................... 351
19.1 `celldefine and `endcelldefine................................................................................................ 351
19.2 `default_nettype ..................................................................................................................... 351
Copyright © 2001 IEEE. All rights reserved. xvii
19.3 `define and `undef.................................................................................................................. 352
19.3.1 `define ....................................................................................................................... 352
19.3.2 `undef........................................................................................................................ 354
19.4 `ifdef, `else, `elsif, `endif, `ifndef .......................................................................................... 354
19.5 `include .................................................................................................................................. 358
19.6 `resetall................................................................................................................................... 358
19.7 `line ........................................................................................................................................ 358
19.8 `timescale............................................................................................................................... 359
19.9 `unconnected_drive and `nounconnected_drive .................................................................... 361
20. PLI overview.................................................................................................................................... 362
20.1 PLI purpose and history (informative)................................................................................... 362
20.2 User-defined system task or function names ......................................................................... 362
20.3 User-defined system task or function types........................................................................... 363
20.4 Overriding built-in system task and function names ............................................................. 363
20.5 User-supplied PLI applications.............................................................................................. 363
20.6 PLI interface mechanism ....................................................................................................... 363
20.7 User-defined system task and function arguments ................................................................ 364
20.8 PLI include files..................................................................................................................... 364
20.9 PLI Memory Restrictions....................................................................................................... 364
21. PLI TF and ACC interface mechanism............................................................................................ 365
21.1 User-supplied PLI applications.............................................................................................. 365
21.1.1 The sizetf class of PLI applications .......................................................................... 365
21.1.2 The checktf class of PLI applications....................................................................... 365
21.1.3 The calltf class of PLI applications........................................................................... 366
21.1.4 The misctf class of PLI applications......................................................................... 366
21.1.5 The consumer class of PLI applications ................................................................... 366
21.2 Associating PLI applications to a class and system task/function name ............................... 366
21.3 PLI application arguments..................................................................................................... 367
21.3.1 The data C argument................................................................................................. 367
21.3.2 The reason C argument............................................................................................. 367
21.3.3 The paramvc C argument.......................................................................................... 368
22. Using ACC routines......................................................................................................................... 369
22.1 ACC routine definition .......................................................................................................... 369
22.2 The handle data type.............................................................................................................. 369
22.3 Using ACC routines............................................................................................................... 370
22.3.1 Header files............................................................................................................... 370
22.3.2 Initializing ACC routines.......................................................................................... 370
22.3.3 Exiting ACC routines................................................................................................ 370
22.4 List of ACC routines by major category................................................................................ 370
22.4.1 Fetch routines............................................................................................................ 371
22.4.2 Handle routines......................................................................................................... 372
22.4.3 Next routines............................................................................................................. 373
22.4.4 Modify routines......................................................................................................... 375
22.4.5 Miscellaneous routines.............................................................................................. 375
22.4.6 VCL routines............................................................................................................. 376
22.5 Accessible objects.................................................................................................................. 376
22.5.1 ACC routines that operate on module instances ...................................................... 378
22.5.2 ACC routines that operate on module ports ............................................................. 378
xviii Copyright © 2001 IEEE. All rights reserved.
22.5.3 ACC routines that operate on bits of a port ............................................................. 379
22.5.4 ACC routines that operate on module paths or data paths ....................................... 379
22.5.5 ACC routines that operate on intermodule paths ..................................................... 380
22.5.6 ACC routines that operate on top-level modules...................................................... 380
22.5.7 ACC routines that operate on primitive instances .................................................... 380
22.5.8 ACC routines that operate on primitive terminals.................................................... 381
22.5.9 ACC routines that operate on nets ............................................................................ 381
22.5.10 ACC routines that operate on reg types.................................................................... 382
22.5.11 ACC routines that operate on integer, real, and time variables ................................ 382
22.5.12 ACC routines that operate on named events............................................................. 382
22.5.13 ACC routines that operate on parameters and specparams....................................... 383
22.5.14 ACC routines that operate on timing checks ............................................................ 383
22.5.15 ACC routines that operate on timing check terminals.............................................. 383
22.5.16 ACC routines that operate on user-defined system task/function arguments........... 384
22.6 ACC routine types and fulltypes............................................................................................ 384
22.7 Error handling........................................................................................................................ 387
22.7.1 Suppressing error messages...................................................................................... 388
22.7.2 Enabling warnings .................................................................................................... 388
22.7.3 Testing for errors....................................................................................................... 388
22.7.4 Example .................................................................................................................... 388
22.7.5 Exception values....................................................................................................... 389
22.8 Reading and writing delay values.......................................................................................... 389
22.8.1 Number of delays for Verilog HDL objects ............................................................. 390
22.8.2 ACC routine configuration ....................................................................................... 390
22.8.3 Determining the number of arguments for ACC delay routines............................... 391
22.9 String handling....................................................................................................................... 395
22.9.1 ACC routines share an internal string buffer............................................................ 395
22.9.2 String buffer reset ..................................................................................................... 396
22.9.3 Preserving string values............................................................................................ 397
22.9.4 Example of preserving string values......................................................................... 397
22.10 Using VCL ACC routines...................................................................................................... 397
22.10.1 VCL objects .............................................................................................................. 398
22.10.2 The VCL record definition........................................................................................ 398
22.10.3 Effects of acc_initialize() and acc_close() on VCL consumer routines ................... 401
22.10.4 An example of using VCL ACC routines................................................................. 401
23. ACC routine definitions................................................................................................................... 404
24. Using TF routines ............................................................................................................................ 579
24.1 TF routine definition.............................................................................................................. 579
24.2 TF routine system task/function arguments........................................................................... 579
24.3 Reading and writing system task/function argument values.................................................. 579
24.3.1 Reading and writing 2-state parameter argument values.......................................... 579
24.3.2 Reading and writing 4-state values........................................................................... 579
24.3.3 Reading and writing strength values......................................................................... 580
24.3.4 Reading and writing to memories............................................................................. 580
24.3.5 Reading and writing string values............................................................................. 580
24.3.6 Writing return values of user-defined functions....................................................... 580
24.3.7 Writing the correct C data types ............................................................................... 580
24.4 Value change detection.......................................................................................................... 581
24.5 Simulation time...................................................................................................................... 581
24.6 Simulation synchronization ................................................................................................... 581
24.7 Instances of user-defined tasks or functions.......................................................................... 582
Copyright © 2001 IEEE. All rights reserved. xix
24.8 Module and scope instance names......................................................................................... 582
24.9 Saving information from one system TF call to the next....................................................... 582
24.10 Displaying output messages................................................................................................... 582
24.11 Stopping and finishing........................................................................................................... 582
25. TF routine definitions ...................................................................................................................... 583
26. Using VPI routines........................................................................................................................... 659
26.1 VPI system tasks and functions ............................................................................................. 659
26.2 The VPI interface................................................................................................................... 659
26.2.1 VPI callbacks ............................................................................................................ 659
26.2.2 VPI access to Verilog HDL objects and simulation objects..................................... 660
26.2.3 Error handling........................................................................................................... 660
26.2.4 Function availability ................................................................................................. 660
26.2.5 Traversing expressions.............................................................................................. 660
26.3 VPI object classifications....................................................................................................... 661
26.3.1 Accessing object relationships and properties.......................................................... 662
26.3.2 Object type properties............................................................................................... 663
26.3.3 Object file and line properties................................................................................... 663
26.3.4 Delays and values ..................................................................................................... 664
26.4 List of VPI routines by functional category........................................................................... 664
26.5 Key to data model diagrams .................................................................................................. 666
26.5.1 Diagram key for objects and classes ........................................................................ 667
26.5.2 Diagram key for accessing properties....................................................................... 667
26.5.3 Diagram key for traversing relationships ................................................................. 668
26.6 Object data model diagrams................................................................................................... 669
27. VPI routine definitions..................................................................................................................... 700
Annex A (normative) Formal syntax definition........................................................................................... 761
A.1 Source text ............................................................................................................................... 761
A.1.1 Library source text ........................................................................................................ 761
A.1.2 Configuration source text.............................................................................................. 761
A.1.3 Module and primitive source text ................................................................................. 762
A.1.4 Module parameters and ports........................................................................................ 762
A.1.5 Module items................................................................................................................. 762
A.2 Declarations ............................................................................................................................. 763
A.2.1 Declaration types........................................................................................................... 763
A.2.2 Declaration data types................................................................................................... 765
A.2.3 Declaration lists............................................................................................................. 765
A.2.4 Declaration assignments ............................................................................................... 766
A.2.5 Declaration ranges......................................................................................................... 766
A.2.6 Function declarations .................................................................................................... 766
A.2.7 Task declarations........................................................................................................... 766
A.2.8 Block item declarations................................................................................................. 767
A.3 Primitive instances................................................................................................................... 768
A.3.1 Primitive instantiation and instances............................................................................. 768
A.3.2 Primitive strengths ........................................................................................................ 768
A.3.3 Primitive terminals........................................................................................................ 769
A.3.4 Primitive gate and switch types .................................................................................... 769
剩余878页未读,继续阅读
2009-11-26 上传
2019-12-02 上传
2022-06-14 上传
点击了解资源详情
点击了解资源详情
168 浏览量
2020-04-26 上传
2022-09-21 上传
Badcode_V
- 粉丝: 2
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 探索AVL树算法:以Faculdade Senac Porto Alegre实践为例
- 小学语文教学新工具:创新黑板设计解析
- Minecraft服务器管理新插件ServerForms发布
- MATLAB基因网络模型代码实现及开源分享
- 全方位技术项目源码合集:***报名系统
- Phalcon框架实战案例分析
- MATLAB与Python结合实现短期电力负荷预测的DAT300项目解析
- 市场营销教学专用查询装置设计方案
- 随身WiFi高通210 MS8909设备的Root引导文件破解攻略
- 实现服务器端级联:modella与leveldb适配器的应用
- Oracle Linux安装必备依赖包清单与步骤
- Shyer项目:寻找喜欢的聊天伙伴
- MEAN堆栈入门项目: postings-app
- 在线WPS办公功能全接触及应用示例
- 新型带储订盒订书机设计文档
- VB多媒体教学演示系统源代码及技术项目资源大全
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功