没有合适的资源?快使用搜索试试~ 我知道了~
首页IEEE Verilog硬件描述语言标准2005版
IEEE Verilog硬件描述语言标准2005版
需积分: 9 12 下载量 102 浏览量
更新于2024-07-14
收藏 6.1MB PDF 举报
"这是一本关于IEEE Std 1364-2005标准的Verilog硬件描述语言的专业书籍,由IEEE Computer Society出版,并由Design Automation Standards Committee赞助。该文档详细介绍了Verilog语言的规范,是电子和计算机工程领域的权威参考。文件下载自IEEE Xplore,适用于大连理工大学的授权用户,但可能受到使用限制。"
正文:
Verilog是一种广泛使用的硬件描述语言(HDL),被用于数字系统的建模、设计和验证。IEEE Std 1364-2005是Verilog语言的官方标准,是对2001年版本的修订,提供了更加完善的语法和功能,以满足不断发展的集成电路设计需求。
此标准详细定义了Verilog的语法和语义,包括模块、实例化、信号声明、运算符、过程(如always块)以及仿真和综合等关键概念。Verilog支持结构化和行为级建模,允许工程师以不同抽象层次对电路进行描述,从简单的逻辑门到复杂的微处理器系统。
1. **模块与实例化**:
- Verilog中的基本构建块是模块,它代表了一个独立的硬件单元。模块包含输入、输出、内部信号声明以及逻辑操作。
- 实例化允许将一个模块嵌入到另一个模块中,实现模块的复用,对应于实际电路中的芯片或子系统连接。
2. **信号声明**:
- Verilog支持各种数据类型,如wire(无源线)、reg(存储元件)和integer(整数)等,用于声明信号。
- 信号可以是并行的(同时更新)或串行的(顺序更新),取决于其在设计中的角色。
3. **运算符**:
- Verilog提供了丰富的算术、逻辑、位操作和比较运算符,使设计师能够表达复杂的数字逻辑。
- 例如,`&`表示逻辑与,`|`表示逻辑或,`~`表示逻辑非,`^`表示异或,`<<`和`>>`表示位移操作等。
4. **过程**:
- always块是Verilog中实现时序逻辑的关键,可以基于边沿触发(如`posedge clk`)或非阻塞赋值(`<=`)来指定时序行为。
- assign语句用于实现组合逻辑,其结果立即更新。
5. **仿真与综合**:
- Verilog代码可被仿真器用来验证设计的功能是否正确,模拟真实环境下的行为。
- 综合工具将Verilog代码转换成适合特定工艺的门级网表,以便进一步制造成实际的集成电路。
6. **设计层次**:
- Verilog支持从行为级(功能描述)到门级(逻辑门的组合)再到布局布线级(物理实现)的设计层次,使得设计过程更高效。
7. **约束和参数化**:
- 参数化允许创建可重用的模块,参数可以控制模块的大小、特性等。
- 设计约束用于指导综合工具,确保满足时序、功耗和面积等设计目标。
通过学习和应用IEEE Std 1364-2005标准,工程师能够更好地理解和利用Verilog进行硬件设计,提高设计效率和质量,从而在电子和计算机工程领域取得成功。该文档是Verilog学习者和专业开发者的必备参考资料,涵盖了语言的所有核心概念和技术细节。
xiv Copyright © 2006 IEEE. All rights reserved.
17.7.3 $realtime ...................................................................................................................... 310
17.8 Conversion functions ................................................................................................................. 310
17.9 Probabilistic distribution functions............................................................................................ 311
17.9.1 $random function......................................................................................................... 311
17.9.2 $dist_ functions............................................................................................................ 312
17.9.3 Algorithm for probabilistic distribution functions....................................................... 313
17.10 Command line input................................................................................................................... 320
17.10.1 $test$plusargs (string)..................................................................................................320
17.10.2 $value$plusargs (user_string, variable) ....................................................................... 321
17.11 Math functions ........................................................................................................................... 323
17.11.1 Integer math functions ................................................................................................. 323
17.11.2 Real math functions ..................................................................................................... 323
18. Value change dump (VCD) files ......................................................................................................... 325
18.1 Creating four-state VCD file...................................................................................................... 325
18.1.1 Specifying name of dump file ($dumpfile).................................................................. 325
18.1.2 Specifying 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 size of dump file ($dumplimit) ..................................................................... 328
18.1.6 Reading dump file during simulation ($dumpflush).................................................... 328
18.2 Format of four-state VCD file ................................................................................................... 329
18.2.1 Syntax of four-state VCD file...................................................................................... 330
18.2.2 Formats of variable values........................................................................................... 331
18.2.3 Description of keyword commands ............................................................................. 332
18.2.4 Four-state VCD file format example ........................................................................... 337
18.3 Creating extended VCD file ...................................................................................................... 338
18.3.1 Specifying dump file name and ports to be dumped ($dumpports)............................. 338
18.3.2 Stopping and resuming the dump ($dumpportsoff/$dumpportson)............................. 339
18.3.3 Generating a checkpoint ($dumpportsall).................................................................... 340
18.3.4 Limiting size of dump file ($dumpportslimit) ............................................................. 340
18.3.5 Reading dump file during simulation ($dumpportsflush)............................................ 341
18.3.6 Description of keyword commands ............................................................................. 341
18.3.7 General rules for extended VCD system tasks ............................................................ 341
18.4 Format of extended VCD file .................................................................................................... 342
18.4.1 Syntax of extended VCD file....................................................................................... 342
18.4.2 Extended VCD node information ................................................................................ 344
18.4.3 Value changes .............................................................................................................. 346
18.4.4 Extended VCD file format example ............................................................................ 347
19. Compiler directives.............................................................................................................................. 349
19.1 `celldefine and `endcelldefine.................................................................................................... 349
19.2 `default_nettype ......................................................................................................................... 349
19.3 `define and `undef...................................................................................................................... 350
19.3.1 `define .......................................................................................................................... 350
19.3.2 `undef ........................................................................................................................... 352
19.4 `ifdef, `else, `elsif, `endif, `ifndef .............................................................................................. 352
19.5 `include ...................................................................................................................................... 356
19.6 `resetall....................................................................................................................................... 356
19.7 `line ............................................................................................................................................ 357
19.8 `timescale ................................................................................................................................... 358
19.9 `unconnected_drive and `nounconnected_drive ........................................................................ 360
19.10 `pragma ...................................................................................................................................... 360
19.10.1 Standard pragmas.........................................................................................................361
Authorized licensed use limited to: Dalian University of Technology. Downloaded on March 25,2021 at 15:10:45 UTC from IEEE Xplore. Restrictions apply.
Copyright © 2006 IEEE. All rights reserved. xv
19.11 `begin_keywords, `end_keywords.............................................................................................361
20. Programming language interface (PLI) overview ............................................................................... 366
20.1 PLI purpose and history............................................................................................................. 366
20.2 User-defined system task/function names ................................................................................. 367
20.3 User-defined system task/function types ................................................................................... 367
20.4 Overriding built-in system task/function names ........................................................................ 367
20.5 User-supplied PLI applications.................................................................................................. 367
20.6 PLI mechanism .......................................................................................................................... 368
20.7 User-defined system task/function arguments ........................................................................... 368
20.8 PLI include files......................................................................................................................... 368
21. PLI TF and ACC interface mechanism (deprecated)........................................................................... 369
22. Using ACC routines (deprecated)........................................................................................................ 370
23. ACC routine definitions (deprecated).................................................................................................. 371
24. Using TF routines (deprecated) ........................................................................................................... 372
25. TF routine definitions (deprecated) ..................................................................................................... 373
26. Using Verilog procedural interface (VPI) routines.............................................................................. 374
26.1 VPI system tasks and functions ................................................................................................. 374
26.1.1 sizetf VPI application routine ...................................................................................... 374
26.1.2 compiletf VPI application routine................................................................................ 374
26.1.3 calltf VPI application routine....................................................................................... 375
26.1.4 Arguments to sizetf, compiletf, and calltf application routines................................... 375
26.2 VPI mechanism.......................................................................................................................... 375
26.2.1 VPI callbacks ............................................................................................................... 375
26.2.2 VPI access to Verilog HDL objects and simulation objects........................................ 376
26.2.3 Error handling .............................................................................................................. 376
26.2.4 Function availability .................................................................................................... 376
26.2.5 Traversing expressions ................................................................................................ 377
26.3 VPI object classifications........................................................................................................... 377
26.3.1 Accessing object relationships and properties ............................................................. 378
26.3.2 Object type properties.................................................................................................. 379
26.3.3 Object file and line properties...................................................................................... 380
26.3.4 Delays and values ........................................................................................................ 380
26.3.5 Object protection properties......................................................................................... 381
26.4 List of VPI routines by functional category............................................................................... 381
26.5 Key to data model diagrams ...................................................................................................... 383
26.5.1 Diagram key for objects and classes ........................................................................... 384
26.5.2 Diagram key for accessing properties.......................................................................... 384
26.5.3 Diagram key for traversing relationships .................................................................... 385
26.6 Object data model diagrams ...................................................................................................... 386
26.6.1 Module ......................................................................................................................... 387
26.6.2 Instance arrays ............................................................................................................. 388
26.6.3 Scope............................................................................................................................ 389
26.6.4 IO declaration .............................................................................................................. 389
26.6.5 Ports ............................................................................................................................. 390
26.6.6 Nets and net arrays.......................................................................................................391
26.6.7 Regs and reg arrays...................................................................................................... 393
26.6.8 Variables ...................................................................................................................... 395
Authorized licensed use limited to: Dalian University of Technology. Downloaded on March 25,2021 at 15:10:45 UTC from IEEE Xplore. Restrictions apply.
xvi Copyright © 2006 IEEE. All rights reserved.
26.6.9 Memory........................................................................................................................ 396
26.6.10 Object range................................................................................................................. 396
26.6.11 Named event ................................................................................................................ 397
26.6.12 Parameter, specparam .................................................................................................. 398
26.6.13 Primitive, prim term.....................................................................................................399
26.6.14 UDP ............................................................................................................................. 400
26.6.15 Module path, path term................................................................................................ 401
26.6.16 Intermodule path .......................................................................................................... 401
26.6.17 Timing check ............................................................................................................... 402
26.6.18 Task, function declaration............................................................................................ 402
26.6.19 Task/function call ........................................................................................................ 403
26.6.20 Frames.......................................................................................................................... 404
26.6.21 Delay terminals ............................................................................................................ 405
26.6.22 Net drivers and loads ................................................................................................... 405
26.6.23 Reg drivers and loads................................................................................................... 406
26.6.24 Continuous assignment ................................................................................................ 406
26.6.25 Simple expressions ...................................................................................................... 407
26.6.26 Expressions .................................................................................................................. 408
26.6.27 Process, block, statement, event statement ................................................................. 409
26.6.28 Assignment .................................................................................................................. 410
26.6.29 Delay control................................................................................................................ 410
26.6.30 Event control................................................................................................................ 410
26.6.31 Repeat control .............................................................................................................. 411
26.6.32 While, repeat, wait ....................................................................................................... 411
26.6.33 For................................................................................................................................ 411
26.6.34 Forever ......................................................................................................................... 411
26.6.35 If, if-else....................................................................................................................... 412
26.6.36 Case.............................................................................................................................. 412
26.6.37 Assign statement, deassign, force, release .................................................................. 413
26.6.38 Disable ......................................................................................................................... 413
26.6.39 Callback ....................................................................................................................... 414
26.6.40 Time queue .................................................................................................................. 414
26.6.41 Active time format .......................................................................................................414
26.6.42 Attributes ..................................................................................................................... 415
26.6.43 Iterator.......................................................................................................................... 416
26.6.44 Generates ..................................................................................................................... 417
27. VPI routine definitions......................................................................................................................... 418
27.1 vpi_chk_error() .......................................................................................................................... 418
27.2 vpi_compare_objects()............................................................................................................... 420
27.3 vpi_control() .............................................................................................................................. 420
27.4 vpi_flush().................................................................................................................................. 421
27.5 vpi_free_object()........................................................................................................................ 421
27.6 vpi_get()..................................................................................................................................... 422
27.7 vpi_get_cb_info()....................................................................................................................... 422
27.8 vpi_get_data() .............................................................................................................
............... 423
27.9 vpi_get_delays()......................................................................................................................... 424
27.10 vpi_get_str()............................................................................................................................... 426
27.11 vpi_get_systf_info()................................................................................................................... 427
27.12 vpi_get_time()............................................................................................................................ 428
27.13 vpi_get_userdata() ..................................................................................................................... 429
27.14 vpi_get_value() .......................................................................................................................... 429
27.15 vpi_get_vlog_info() ................................................................................................................... 435
27.16 vpi_handle() ............................................................................................................................... 436
Authorized licensed use limited to: Dalian University of Technology. Downloaded on March 25,2021 at 15:10:45 UTC from IEEE Xplore. Restrictions apply.
Copyright © 2006 IEEE. All rights reserved. xvii
27.17 vpi_handle_by_index() .............................................................................................................. 437
27.18 vpi_handle_by_multi_index().................................................................................................... 438
27.19 vpi_handle_by_name() .............................................................................................................. 438
27.20 vpi_handle_multi()..................................................................................................................... 439
27.21 vpi_iterate()................................................................................................................................ 439
27.22 vpi_mcd_close()......................................................................................................................... 440
27.23 vpi_mcd_flush()......................................................................................................................... 441
27.24 vpi_mcd_name() ........................................................................................................................ 441
27.25 vpi_mcd_open() ......................................................................................................................... 442
27.26 vpi_mcd_printf()........................................................................................................................ 443
27.27 vpi_mcd_vprintf()...................................................................................................................... 444
27.28 vpi_printf()................................................................................................................................. 444
27.29 vpi_put_data()............................................................................................................................ 445
27.30 vpi_put_delays() ........................................................................................................................ 447
27.31 vpi_put_userdata() ..................................................................................................................... 450
27.32 vpi_put_value().......................................................................................................................... 450
27.33 vpi_register_cb()........................................................................................................................ 453
27.33.1 Simulation event callbacks .......................................................................................... 454
27.33.2 Simulation time callbacks............................................................................................ 458
27.33.3 Simulator action or feature callbacks........................................................................... 460
27.34 vpi_register_systf() .................................................................................................................... 461
27.34.1 System task/function callbacks.................................................................................... 462
27.34.2 Initializing VPI system task/function callbacks........................................................... 463
27.34.3 Registering multiple system tasks and functions......................................................... 464
27.35 vpi_remove_cb()........................................................................................................................ 465
27.36 vpi_scan()................................................................................................................................... 465
27.37 vpi_vprintf()............................................................................................................................... 466
28. Protected envelopes ............................................................................................................................. 467
28.1 General....................................................................................................................................... 467
28.2 Processing protected envelopes ................................................................................................. 467
28.2.1 Encryption.................................................................................................................... 468
28.2.2 Decryption ................................................................................................................... 469
28.3 Protect pragma directives........................................................................................................... 469
28.4 Protect pragma keywords........................................................................................................... 471
28.4.1 begin............................................................................................................................. 471
28.4.2 end................................................................................................................................ 471
28.4.3 begin_protected............................................................................................................ 471
28.4.4 end_protected............................................................................................................... 472
28.4.5 author ........................................................................................................................... 472
28.4.6 author_info................................................................................................................... 473
28.4.7 encrypt_agent............................................................................................................... 473
28.4.8 encrypt_agent_info ...................................................................................................... 473
28.4.9 encoding....................................................................................................................... 474
28.4.10 data_keyowner ............................................................................................................. 475
28.4.11 data_method................................................................................................................. 475
28.4.12 data_keyname .............................................................................................................. 476
28.4.13 data_public_key ........................................................................................................... 477
28.4.14 data_decrypt_key .........................................................................................................477
28.4.15 data_block.................................................................................................................... 478
28.4.16 digest_keyowner ..........................................................................................................478
28.4.17 digest_key_method ...................................................................................................... 478
28.4.18 digest_keyname ...........................................................................................................479
28.4.19 digest_public_key ........................................................................................................479
Authorized licensed use limited to: Dalian University of Technology. Downloaded on March 25,2021 at 15:10:45 UTC from IEEE Xplore. Restrictions apply.
xviii Copyright © 2006 IEEE. All rights reserved.
28.4.20 digest_decrypt_key ...................................................................................................... 480
28.4.21 digest_method.............................................................................................................. 480
28.4.22 digest_block ................................................................................................................. 481
28.4.23 key_keyowner.............................................................................................................. 482
28.4.24 key_method.................................................................................................................. 482
28.4.25 key_keyname ............................................................................................................... 482
28.4.26 key_public_key............................................................................................................ 483
28.4.27 key_block..................................................................................................................... 483
28.4.28 decrypt_license ............................................................................................................ 484
28.4.29 runtime_license............................................................................................................ 484
28.4.30 comment....................................................................................................................... 485
28.4.31 reset.............................................................................................................................. 485
28.4.32 viewport ....................................................................................................................... 486
Annex A (normative) Formal syntax definition .......................................................................................... 487
A.1 Source text ....................................................................................................................... 487
A.1.1 Library source text ............................................................................................. 487
A.1.2 Verilog source text ............................................................................................. 487
A.1.3 Module parameters and ports ............................................................................. 487
A.1.4 Module items...................................................................................................... 488
A.1.5 Configuration source text ................................................................................... 489
A.2 Declarations ..................................................................................................................... 489
A.2.1 Declaration types................................................................................................ 489
A.2.2 Declaration data types ........................................................................................ 490
A.2.3 Declaration lists.................................................................................................. 491
A.2.4 Declaration assignments..................................................................................... 491
A.2.5 Declaration ranges.............................................................................................. 492
A.2.6 Function declarations ......................................................................................... 492
A.2.7 Task declarations................................................................................................ 492
A.2.8 Block item declarations...................................................................................... 493
A.3 Primitive instances........................................................................................................... 493
A.3.1 Primitive instantiation and instances.................................................................. 493
A.3.2 Primitive strengths.............................................................................................. 494
A.3.3 Primitive terminals ............................................................................................. 494
A.3.4 Primitive gate and switch types.......................................................................... 494
A.4 Module instantiation and generate construct ................................................................... 495
A.4.1 Module instantiation........................................................................................... 495
A.4.2 Generate construct.............................................................................................. 495
A.5 UDP declaration and instantiation ................................................................................... 496
A.5.1 UDP declaration ................................................................................................. 496
A.5.2 UDP ports........................................................................................................... 496
A.5.3 UDP body........................................................................................................... 496
A.5.4 UDP instantiation ............................................................................................... 497
A.6 Behavioral statements ...................................................................................................... 497
A.6.1 Continuous assignment statements..................................................................... 497
A.6.2 Procedural blocks and assignments.................................................................... 497
A.6.3 Parallel and sequential blocks ............................................................................ 497
A.6.4 Statements .......................................................................................................... 498
A.6.5 Timing control statements .................................................................................. 498
A.6.6 Conditional statements ....................................................................................... 499
A.6.7 Case statements .................................................................................................. 499
A.6.8 Looping statements ............................................................................................ 499
A.6.9 Task enable statements....................................................................................... 499
A.7 Specify section................................................................................................................. 500
Authorized licensed use limited to: Dalian University of Technology. Downloaded on March 25,2021 at 15:10:45 UTC from IEEE Xplore. Restrictions apply.
剩余589页未读,继续阅读
点击了解资源详情
点击了解资源详情
点击了解资源详情
2021-05-27 上传
2021-02-01 上传
2020-09-20 上传
2020-04-26 上传
2019-11-16 上传
2020-04-26 上传
ICCJJ
- 粉丝: 288
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 深入浅出:自定义 Grunt 任务的实践指南
- 网络物理突变工具的多点路径规划实现与分析
- multifeed: 实现多作者间的超核心共享与同步技术
- C++商品交易系统实习项目详细要求
- macOS系统Python模块whl包安装教程
- 掌握fullstackJS:构建React框架与快速开发应用
- React-Purify: 实现React组件纯净方法的工具介绍
- deck.js:构建现代HTML演示的JavaScript库
- nunn:现代C++17实现的机器学习库开源项目
- Python安装包 Acquisition-4.12-cp35-cp35m-win_amd64.whl.zip 使用说明
- Amaranthus-tuberculatus基因组分析脚本集
- Ubuntu 12.04下Realtek RTL8821AE驱动的向后移植指南
- 掌握Jest环境下的最新jsdom功能
- CAGI Toolkit:开源Asterisk PBX的AGI应用开发
- MyDropDemo: 体验QGraphicsView的拖放功能
- 远程FPGA平台上的Quartus II17.1 LCD色块闪烁现象解析
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功