实例介绍
【实例截图】
【核心代码】
Contents Part One: Design and Verification Constructs 1. Overview.............................................................................................................................................. 2 1.1 Scope........................................................................................................................................ 2 1.2 Purpose..................................................................................................................................... 2 1.3 Content summary..................................................................................................................... 2 1.4 Special terms............................................................................................................................ 3 1.5 Conventions used in this standard ........................................................................................... 3 1.6 Syntactic description................................................................................................................ 4 1.7 Use of color in this standard .................................................................................................... 5 1.8 Contents of this standard.......................................................................................................... 5 1.9 Deprecated clauses................................................................................................................... 8 1.10 Examples.................................................................................................................................. 8 1.11 Prerequisites............................................................................................................................. 8 2. Normative references........................................................................................................................... 9 3. Design and verification building blocks ............................................................................................ 11 3.1 General................................................................................................................................... 11 3.2 Design elements..................................................................................................................... 11 3.3 Modules ................................................................................................................................. 11 3.4 Programs ................................................................................................................................ 12 3.5 Interfaces................................................................................................................................ 13 3.6 Checkers................................................................................................................................. 14 3.7 Primitives ............................................................................................................................... 14 3.8 Subroutines ............................................................................................................................ 14 3.9 Packages................................................................................................................................. 14 3.10 Configurations ....................................................................................................................... 15 3.11 Overview of hierarchy ........................................................................................................... 15 3.12 Compilation and elaboration.................................................................................................. 16 3.13 Name spaces .......................................................................................................................... 18 3.14 Simulation time units and precision....................................................................................... 19 4. Scheduling semantics......................................................................................................................... 23 4.1 General................................................................................................................................... 23 4.2 Execution of a hardware model and its verification environment ......................................... 23 4.3 Event simulation .................................................................................................................... 23 4.4 Stratified event scheduler....................................................................................................... 24 4.5 SystemVerilog simulation reference algorithm ..................................................................... 29 4.6 Determinism........................................................................................................................... 29 4.7 Nondeterminism..................................................................................................................... 30 4.8 Race conditions...................................................................................................................... 30 4.9 Scheduling implication of assignments ................................................................................. 30 4.10 PLI callback control points .................................................................................................... 32 5. Lexical conventions ........................................................................................................................... 33 5.1 General................................................................................................................................... 33 5.2 Lexical tokens ........................................................................................................................ 33 5.3 White space............................................................................................................................ 33 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xii Copyright © 2013 IEEE. All rights reserved. 5.4 Comments .............................................................................................................................. 33 5.5 Operators................................................................................................................................ 33 5.6 Identifiers, keywords, and system names .............................................................................. 34 5.7 Numbers................................................................................................................................. 35 5.8 Time literals ........................................................................................................................... 40 5.9 String literals.......................................................................................................................... 40 5.10 Structure literals..................................................................................................................... 42 5.11 Array literals .......................................................................................................................... 43 5.12 Attributes ............................................................................................................................... 43 5.13 Built-in methods .................................................................................................................... 45 6. Data types .......................................................................................................................................... 47 6.1 General................................................................................................................................... 47 6.2 Data types and data objects.................................................................................................... 47 6.3 Value set ................................................................................................................................ 47 6.4 Singular and aggregate types ................................................................................................. 48 6.5 Nets and variables.................................................................................................................. 49 6.6 Net types ................................................................................................................................ 50 6.7 Net declarations ..................................................................................................................... 61 6.8 Variable declarations ............................................................................................................. 64 6.9 Vector declarations ................................................................................................................ 66 6.10 Implicit declarations .............................................................................................................. 67 6.11 Integer data types ................................................................................................................... 68 6.12 Real, shortreal, and realtime data types ................................................................................. 69 6.13 Void data type........................................................................................................................ 69 6.14 Chandle data type................................................................................................................... 69 6.15 Class....................................................................................................................................... 70 6.16 String data type ...................................................................................................................... 70 6.17 Event data type....................................................................................................................... 75 6.18 User-defined types ................................................................................................................. 76 6.19 Enumerations ......................................................................................................................... 77 6.20 Constants................................................................................................................................ 83 6.21 Scope and lifetime ................................................................................................................. 90 6.22 Type compatibility................................................................................................................. 92 6.23 Type operator......................................................................................................................... 95 6.24 Casting ................................................................................................................................... 96 6.25 Parameterized data types ..................................................................................................... 101 7. Aggregate data types........................................................................................................................ 103 7.1 General................................................................................................................................. 103 7.2 Structures ............................................................................................................................. 103 7.3 Unions.................................................................................................................................. 105 7.4 Packed and unpacked arrays ................................................................................................ 109 7.5 Dynamic arrays .................................................................................................................... 113 7.6 Array assignments................................................................................................................ 116 7.7 Arrays as arguments to subroutines ..................................................................................... 117 7.8 Associative arrays ................................................................................................................ 118 7.9 Associative array methods ................................................................................................... 121 7.10 Queues ................................................................................................................................. 124 7.11 Array querying functions ..................................................................................................... 129 7.12 Array manipulation methods ............................................................................................... 129 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xiii Copyright © 2013 IEEE. All rights reserved. 8. Classes ............................................................................................................................................. 134 8.1 General................................................................................................................................. 134 8.2 Overview.............................................................................................................................. 134 8.3 Syntax .................................................................................................................................. 135 8.4 Objects (class instance)........................................................................................................ 136 8.5 Object properties and object parameter data........................................................................ 137 8.6 Object methods .................................................................................................................... 138 8.7 Constructors ......................................................................................................................... 138 8.8 Typed constructor calls........................................................................................................ 140 8.9 Static class properties........................................................................................................... 141 8.10 Static methods...................................................................................................................... 141 8.11 This ...................................................................................................................................... 141 8.12 Assignment, renaming, and copying.................................................................................... 142 8.13 Inheritance and subclasses ................................................................................................... 144 8.14 Overridden members............................................................................................................ 144 8.15 Super .................................................................................................................................... 145 8.16 Casting ................................................................................................................................. 146 8.17 Chaining constructors .......................................................................................................... 146 8.18 Data hiding and encapsulation............................................................................................. 147 8.19 Constant class properties ..................................................................................................... 147 8.20 Virtual methods.................................................................................................................... 148 8.21 Abstract classes and pure virtual methods........................................................................... 150 8.22 Polymorphism: dynamic method lookup............................................................................. 150 8.23 Class scope resolution operator :: ........................................................................................ 151 8.24 Out-of-block declarations .................................................................................................... 153 8.25 Parameterized classes .......................................................................................................... 154 8.26 Interface classes ................................................................................................................... 157 8.27 Typedef class ....................................................................................................................... 167 8.28 Classes and structures .......................................................................................................... 167 8.29 Memory management .......................................................................................................... 168 9. Processes.......................................................................................................................................... 169 9.1 General................................................................................................................................. 169 9.2 Structured procedures .......................................................................................................... 169 9.3 Block statements .................................................................................................................. 173 9.4 Procedural timing controls................................................................................................... 179 9.5 Process execution threads .................................................................................................... 189 9.6 Process control..................................................................................................................... 189 9.7 Fine-grain process control ................................................................................................... 193 10. Assignment statements .................................................................................................................... 196 10.1 General................................................................................................................................. 196 10.2 Overview.............................................................................................................................. 196 10.3 Continuous assignments ...................................................................................................... 197 10.4 Procedural assignments........................................................................................................ 200 10.5 Variable declaration assignment (variable initialization) .................................................... 205 10.6 Procedural continuous assignments..................................................................................... 205 10.7 Assignment extension and truncation .................................................................................. 207 10.8 Assignment-like contexts..................................................................................................... 208 10.9 Assignment patterns............................................................................................................. 209 10.10 Unpacked array concatenation............................................................................................. 213 10.11 Net aliasing .......................................................................................................................... 216 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xiv Copyright © 2013 IEEE. All rights reserved. 11. Operators and expressions ............................................................................................................... 218 11.1 General................................................................................................................................. 218 11.2 Overview.............................................................................................................................. 218 11.3 Operators.............................................................................................................................. 219 11.4 Operator descriptions........................................................................................................... 223 11.5 Operands .............................................................................................................................. 243 11.6 Expression bit lengths.......................................................................................................... 247 11.7 Signed expressions............................................................................................................... 249 11.8 Expression evaluation rules ................................................................................................. 250 11.9 Tagged union expressions and member access.................................................................... 251 11.10 String literal expressions...................................................................................................... 253 11.11 Operator overloading ........................................................................................................... 254 11.12 Minimum, typical, and maximum delay expressions .......................................................... 256 11.13 Let construct ........................................................................................................................ 258 12. Procedural programming statements ............................................................................................... 264 12.1 General................................................................................................................................. 264 12.2 Overview.............................................................................................................................. 264 12.3 Syntax .................................................................................................................................. 264 12.4 Conditional if–else statement............................................................................................... 265 12.5 Case statement ..................................................................................................................... 270 12.6 Pattern matching conditional statements ............................................................................. 275 12.7 Loop statements ................................................................................................................... 279 12.8 Jump statements................................................................................................................... 283 13. Tasks and functions (subroutines) ................................................................................................... 285 13.1 General................................................................................................................................. 285 13.2 Overview.............................................................................................................................. 285 13.3 Tasks .................................................................................................................................... 285 13.4 Functions.............................................................................................................................. 289 13.5 Subroutine calls and argument passing................................................................................ 295 13.6 Import and export functions................................................................................................. 300 13.7 Task and function names ..................................................................................................... 300 13.8 Parameterized tasks and functions....................................................................................... 300 14. Clocking blocks ............................................................................................................................... 302 14.1 General................................................................................................................................. 302 14.2 Overview.............................................................................................................................. 302 14.3 Clocking block declaration .................................................................................................. 302 14.4 Input and output skews ........................................................................................................ 304 14.5 Hierarchical expressions ...................................................................................................... 305 14.6 Signals in multiple clocking blocks ..................................................................................... 306 14.7 Clocking block scope and lifetime....................................................................................... 306 14.8 Multiple clocking blocks example....................................................................................... 306 14.9 Interfaces and clocking blocks............................................................................................. 307 14.10 Clocking block events.......................................................................................................... 308 14.11 Cycle delay: ## .................................................................................................................... 308 14.12 Default clocking................................................................................................................... 309 14.13 Input sampling ..................................................................................................................... 310 14.14 Global clocking.................................................................................................................... 311 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xv Copyright © 2013 IEEE. All rights reserved. 14.15 Synchronous events ............................................................................................................. 315 14.16 Synchronous drives.............................................................................................................. 315 15. Interprocess synchronization and communication........................................................................... 320 15.1 General................................................................................................................................. 320 15.2 Overview.............................................................................................................................. 320 15.3 Semaphores.......................................................................................................................... 320 15.4 Mailboxes............................................................................................................................. 322 15.5 Named events....................................................................................................................... 325 16. Assertions......................................................................................................................................... 330 16.1 General................................................................................................................................. 330 16.2 Overview.............................................................................................................................. 330 16.3 Immediate assertions............................................................................................................ 330 16.4 Deferred assertions .............................................................................................................. 333 16.5 Concurrent assertions overview........................................................................................... 340 16.6 Boolean expressions ............................................................................................................ 343 16.7 Sequences............................................................................................................................. 344 16.8 Declaring sequences ............................................................................................................ 348 16.9 Sequence operations ............................................................................................................ 356 16.10 Local variables..................................................................................................................... 378 16.11 Calling subroutines on match of a sequence........................................................................ 384 16.12 Declaring properties............................................................................................................. 385 16.13 Multiclock support............................................................................................................... 411 16.14 Concurrent assertions........................................................................................................... 421 16.15 Disable iff resolution ........................................................................................................... 438 16.16 Clock resolution................................................................................................................... 440 16.17 Expect statement .................................................................................................................. 445 16.18 Clocking blocks and concurrent assertions.......................................................................... 446 17. Checkers........................................................................................................................................... 448 17.1 Overview.............................................................................................................................. 448 17.2 Checker declaration ............................................................................................................. 448 17.3 Checker instantiation ........................................................................................................... 451 17.4 Context inference................................................................................................................. 454 17.5 Checker procedures.............................................................................................................. 455 17.6 Covergroups in checkers...................................................................................................... 457 17.7 Checker variables................................................................................................................. 458 17.8 Functions in checkers........................................................................................................... 464 17.9 Complex checker example................................................................................................... 464 18. Constrained random value generation ............................................................................................. 467 18.1 General................................................................................................................................. 467 18.2 Overview.............................................................................................................................. 467 18.3 Concepts and usage.............................................................................................................. 467 18.4 Random variables ................................................................................................................ 470 18.5 Constraint blocks ................................................................................................................. 472 18.6 Randomization methods ...................................................................................................... 492 18.7 In-line constraints—randomize() with................................................................................. 493 18.8 Disabling random variables with rand_mode() ................................................................... 496 18.9 Controlling constraints with constraint_mode() .................................................................. 497 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xvi Copyright © 2013 IEEE. All rights reserved. 18.10 Dynamic constraint modification......................................................................................... 498 18.11 In-line random variable control ........................................................................................... 499 18.12 Randomization of scope variables—std::randomize()......................................................... 500 18.13 Random number system functions and methods ................................................................. 501 18.14 Random stability .................................................................................................................. 503 18.15 Manually seeding randomize ............................................................................................... 505 18.16 Random weighted case—randcase ...................................................................................... 506 18.17 Random sequence generation—randsequence..................................................................... 507 19. Functional coverage......................................................................................................................... 517 19.1 General................................................................................................................................. 517 19.2 Overview.............................................................................................................................. 517 19.3 Defining the coverage model: covergroup........................................................................... 518 19.4 Using covergroup in classes ................................................................................................ 520 19.5 Defining coverage points ..................................................................................................... 522 19.6 Defining cross coverage....................................................................................................... 533 19.7 Specifying coverage options................................................................................................ 542 19.8 Predefined coverage methods .............................................................................................. 547 19.9 Predefined coverage system tasks and system functions..................................................... 549 19.10 Organization of option and type_option members .............................................................. 549 19.11 Coverage computation ......................................................................................................... 550 20. Utility system tasks and system functions ....................................................................................... 555 20.1 General................................................................................................................................. 555 20.2 Simulation control system tasks .......................................................................................... 556 20.3 Simulation time system functions........................................................................................ 556 20.4 Timescale system tasks........................................................................................................ 558 20.5 Conversion functions ........................................................................................................... 561 20.6 Data query functions............................................................................................................ 562 20.7 Array querying functions ..................................................................................................... 564 20.8 Math functions ..................................................................................................................... 566 20.9 Bit vector system functions.................................................................................................. 568 20.10 Severity tasks ....................................................................................................................... 569 20.11 Elaboration system tasks...................................................................................................... 570 20.12 Assertion control system tasks............................................................................................. 571 20.13 Sampled value system functions.......................................................................................... 578 20.14 Coverage system functions .................................................................................................. 579 20.15 Probabilistic distribution functions...................................................................................... 579 20.16 Stochastic analysis tasks and functions ............................................................................... 581 20.17 Programmable logic array modeling system tasks .............................................................. 583 20.18 Miscellaneous tasks and functions....................................................................................... 586 21. Input/output system tasks and system functions.............................................................................. 588 21.1 General................................................................................................................................. 588 21.2 Display system tasks............................................................................................................ 588 21.3 File input/output system tasks and system functions........................................................... 599 21.4 Loading memory array data from a file ............................................................................... 609 21.5 Writing memory array data to a file..................................................................................... 613 21.6 Command line input............................................................................................................. 614 21.7 Value change dump (VCD) files ......................................................................................... 617 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xvii Copyright © 2013 IEEE. All rights reserved. 22. Compiler directives.......................................................................................................................... 638 22.1 General................................................................................................................................. 638 22.2 Overview ............................................................................................................................. 638 22.3 `resetall................................................................................................................................. 638 22.4 `include ................................................................................................................................ 639 22.5 `define, `undef, and `undefineall ......................................................................................... 639 22.6 `ifdef, `else, `elsif, `endif, `ifndef ........................................................................................ 645 22.7 `timescale ............................................................................................................................. 648 22.8 `default_nettype ................................................................................................................... 649 22.9 `unconnected_drive and `nounconnected_drive .................................................................. 650 22.10 `celldefine and `endcelldefine.............................................................................................. 650 22.11 `pragma ................................................................................................................................ 650 22.12 `line ...................................................................................................................................... 651 22.13 `__FILE__ and `__LINE__ ................................................................................................. 652 22.14 `begin_keywords, `end_keywords ....................................................................................... 653 Part Two: Hierarchy Constructs 23. Modules and hierarchy..................................................................................................................... 660 23.1 General................................................................................................................................. 660 23.2 Module definitions............................................................................................................... 660 23.3 Module instances (hierarchy)............................................................................................... 672 23.4 Nested modules.................................................................................................................... 683 23.5 Extern modules .................................................................................................................... 684 23.6 Hierarchical names .............................................................................................................. 685 23.7 Member selects and hierarchical names .............................................................................. 688 23.8 Upwards name referencing .................................................................................................. 689 23.9 Scope rules .......................................................................................................................... 692 23.10 Overriding module parameters ............................................................................................ 694 23.11 Binding auxiliary code to scopes or instances ..................................................................... 701 24. Programs .......................................................................................................................................... 705 24.1 General................................................................................................................................. 705 24.2 Overview.............................................................................................................................. 705 24.3 The program construct ......................................................................................................... 705 24.4 Eliminating testbench races ................................................................................................. 709 24.5 Blocking tasks in cycle/event mode..................................................................................... 709 24.6 Programwide space and anonymous programs.................................................................... 710 24.7 Program control tasks .......................................................................................................... 710 25. Interfaces.......................................................................................................................................... 711 25.1 General................................................................................................................................. 711 25.2 Overview.............................................................................................................................. 711 25.3 Interface syntax.................................................................................................................... 712 25.4 Ports in interfaces................................................................................................................. 716 25.5 Modports.............................................................................................................................. 717 25.6 Interfaces and specify blocks............................................................................................... 723 25.7 Tasks and functions in interfaces......................................................................................... 724 25.8 Parameterized interfaces ...................................................................................................... 730 25.9 Virtual interfaces.................................................................................................................. 732 25.10 Access to interface objects................................................................................................... 737 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xviii Copyright © 2013 IEEE. All rights reserved. 26. Packages........................................................................................................................................... 738 26.1 General................................................................................................................................. 738 26.2 Package declarations............................................................................................................ 738 26.3 Referencing data in packages .............................................................................................. 739 26.4 Using packages in module headers...................................................................................... 743 26.5 Search order rules ................................................................................................................ 744 26.6 Exporting imported names from packages .......................................................................... 746 26.7 The std built-in package....................................................................................................... 747 27. Generate constructs.......................................................................................................................... 749 27.1 General................................................................................................................................. 749 27.2 Overview.............................................................................................................................. 749 27.3 Generate construct syntax.................................................................................................... 749 27.4 Loop generate constructs ..................................................................................................... 751 27.5 Conditional generate constructs........................................................................................... 755 27.6 External names for unnamed generate blocks ..................................................................... 758 28. Gate-level and switch-level modeling ............................................................................................. 760 28.1 General................................................................................................................................. 760 28.2 Overview.............................................................................................................................. 760 28.3 Gate and switch declaration syntax ..................................................................................... 760 28.4 and, nand, nor, or, xor, and xnor gates................................................................................. 766 28.5 buf and not gates .................................................................................................................. 767 28.6 bufif1, bufif0, notif1, and notif0 gates................................................................................. 768 28.7 MOS switches ...................................................................................................................... 769 28.8 Bidirectional pass switches.................................................................................................. 770 28.9 CMOS switches ................................................................................................................... 771 28.10 pullup and pulldown sources ............................................................................................... 772 28.11 Logic strength modeling ...................................................................................................... 772 28.12 Strengths and values of combined signals ........................................................................... 774 28.13 Strength reduction by nonresistive devices ......................................................................... 786 28.14 Strength reduction by resistive devices ............................................................................... 786 28.15 Strengths of net types........................................................................................................... 786 28.16 Gate and net delays .............................................................................................................. 787 29. User-defined primitives ................................................................................................................... 791 29.1 General................................................................................................................................. 791 29.2 Overview.............................................................................................................................. 791 29.3 UDP definition..................................................................................................................... 791 29.4 Combinational UDPs ........................................................................................................... 795 29.5 Level-sensitive sequential UDPs ......................................................................................... 796 29.6 Edge-sensitive sequential UDPs .......................................................................................... 796 29.7 Sequential UDP initialization .............................................................................................. 797 29.8 UDP instances...................................................................................................................... 799 29.9 Mixing level-sensitive and edge-sensitive descriptions....................................................... 800 29.10 Level-sensitive dominance .................................................................................................. 801 30. Specify blocks.................................................................................................................................. 802 30.1 General................................................................................................................................. 802 30.2 Overview.............................................................................................................................. 802 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xix Copyright © 2013 IEEE. All rights reserved. 30.3 Specify block declaration..................................................................................................... 802 30.4 Module path declarations..................................................................................................... 803 30.5 Assigning delays to module paths ....................................................................................... 812 30.6 Mixing module path delays and distributed delays ............................................................. 816 30.7 Detailed control of pulse filtering behavior......................................................................... 817 31. Timing checks.................................................................................................................................. 826 31.1 General................................................................................................................................. 826 31.2 Overview.............................................................................................................................. 826 31.3 Timing checks using a stability window.............................................................................. 829 31.4 Timing checks for clock and control signals ....................................................................... 836 31.5 Edge-control specifiers ........................................................................................................ 845 31.6 Notifiers: user-defined responses to timing violations ........................................................ 846 31.7 Enabling timing checks with conditioned events ................................................................ 848 31.8 Vector signals in timing checks ........................................................................................... 849 31.9 Negative timing checks........................................................................................................ 850 32. Backannotation using the standard delay format............................................................................. 855 32.1 General................................................................................................................................. 855 32.2 Overview.............................................................................................................................. 855 32.3 The SDF annotator............................................................................................................... 855 32.4 Mapping of SDF constructs to SystemVerilog .................................................................... 855 32.5 Multiple annotations ............................................................................................................ 860 32.6 Multiple SDF files ............................................................................................................... 861 32.7 Pulse limit annotation .......................................................................................................... 861 32.8 SDF to SystemVerilog delay value mapping....................................................................... 862 32.9 Loading timing data from an SDF file................................................................................. 863 33. Configuring the contents of a design ............................................................................................... 865 33.1 General................................................................................................................................. 865 33.2 Overview.............................................................................................................................. 865 33.3 Libraries ............................................................................................................................... 866 33.4 Configurations ..................................................................................................................... 868 33.5 Using libraries and configs .................................................................................................. 874 33.6 Configuration examples....................................................................................................... 875 33.7 Displaying library binding information ............................................................................... 877 33.8 Library mapping examples .................................................................................................. 877 34. Protected envelopes ......................................................................................................................... 880 34.1 General................................................................................................................................. 880 34.2 Overview.............................................................................................................................. 880 34.3 Processing protected envelopes ........................................................................................... 880 34.4 Protect pragma directives..................................................................................................... 882 34.5 Protect pragma keywords..................................................................................................... 884 Part Three: Application Programming Interfaces 35. Direct programming interface.......................................................................................................... 901 35.1 General................................................................................................................................. 901 35.2 Overview.............................................................................................................................. 901 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xx Copyright © 2013 IEEE. All rights reserved. 35.3 Two layers of DPI................................................................................................................ 902 35.4 Global name space of imported and exported functions...................................................... 903 35.5 Imported tasks and functions ............................................................................................... 904 35.6 Calling imported functions .................................................................................................. 911 35.7 Exported functions............................................................................................................... 913 35.8 Exported tasks...................................................................................................................... 914 35.9 Disabling DPI tasks and functions....................................................................................... 914 36. Programming language interface (PLI/VPI) overview.................................................................... 916 36.1 General................................................................................................................................. 916 36.2 PLI purpose and history....................................................................................................... 916 36.3 User-defined system task and system function names......................................................... 917 36.4 User-defined system task and system function arguments .................................................. 918 36.5 User-defined system task and system function types .......................................................... 918 36.6 User-supplied PLI applications............................................................................................ 918 36.7 PLI include files................................................................................................................... 918 36.8 VPI sizetf, compiletf, and calltf routines ............................................................................. 918 36.9 PLI mechanism .................................................................................................................... 919 36.10 VPI access to SystemVerilog objects and simulation objects ............................................. 921 36.11 List of VPI routines by functional category......................................................................... 922 36.12 VPI backwards compatibility features and limitations ........................................................ 924 37. VPI object model diagrams.............................................................................................................. 929 37.1 General................................................................................................................................. 929 37.2 VPI Handles......................................................................................................................... 929 37.3 VPI object classifications..................................................................................................... 930 37.4 Key to data model diagrams ................................................................................................ 936 37.5 Module ............................................................................................................................... 939 37.6 Interface ............................................................................................................................ 940 37.7 Modport .............................................................................................................................. 940 37.8 Interface task or function declaration ................................................................................. 940 37.9 Program ............................................................................................................................. 941 37.10 Instance ............................................................................................................................... 942 37.11 Instance arrays .................................................................................................................... 944 37.12 Scope ................................................................................................................................... 945 37.13 IO declaration ..................................................................................................................... 946 37.14 Ports .................................................................................................................................... 947 37.15 Reference objects ................................................................................................................ 948 37.16 Nets ...................................................................................................................................... 950 37.17 Variables ............................................................................................................................ 954 37.18 Packed array variables ........................................................................................................ 957 37.19 Variable select ..................................................................................................................... 958 37.20 Memory................................................................................................................................ 959 37.21 Variable drivers and loads .................................................................................................. 959 37.22 Object Range........................................................................................................................ 960 37.23 Typespec ............................................................................................................................ 961 37.24 Structures and unions........................................................................................................... 963 37.25 Named events ...................................................................................................................... 964 37.26 Parameter, spec param, def param, param assign .............................................................. 965 37.27 Virtual interface ................................................................................................................... 966 37.28 Interface typespec ................................................................................................................ 968 37.29 Class definition ................................................................................................................... 969 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xxi Copyright © 2013 IEEE. All rights reserved. 37.30 Class typespec ..................................................................................................................... 970 37.31 Class variables and class objects ......................................................................................... 972 37.32 Constraint, constraint ordering, distribution ....................................................................... 974 37.33 Primitive, prim term............................................................................................................. 975 37.34 UDP ..................................................................................................................................... 976 37.35 Intermodule path .................................................................................................................. 976 37.36 Constraint expression .......................................................................................................... 977 37.37 Module path, path term ....................................................................................................... 978 37.38 Timing check ....................................................................................................................... 979 37.39 Task and function declaration ............................................................................................. 980 37.40 Task and function call ......................................................................................................... 981 37.41 Frames ................................................................................................................................. 983 37.42 Threads ................................................................................................................................ 984 37.43 Delay terminals .................................................................................................................... 984 37.44 Net drivers and loads ........................................................................................................... 985 37.45 Continuous assignment ........................................................................................................ 986 37.46 Clocking block .................................................................................................................... 987 37.47 Assertion ............................................................................................................................. 988 37.48 Concurrent assertions ........................................................................................................ 989 37.49 Property declaration ............................................................................................................ 990 37.50 Property specification ....................................................................................................... 991 37.51 Sequence declaration .......................................................................................................... 992 37.52 Sequence expression ........................................................................................................... 993 37.53 Immediate assertions ........................................................................................................... 994 37.54 Multiclock sequence expression ....................................................................................... 995 37.55 Let ....................................................................................................................................... 995 37.56 Simple expressions ............................................................................................................. 996 37.57 Expressions ....................................................................................................................... 997 37.58 Atomic statement .............................................................................................................. 1000 37.59 Dynamic prefixing ............................................................................................................. 1001 37.60 Event statement ................................................................................................................. 1002 37.61 Process .............................................................................................................................. 1002 37.62 Assignment ....................................................................................................................... 1003 37.63 Event control ..................................................................................................................... 1003 37.64 While, repeat...................................................................................................................... 1004 37.65 Waits ................................................................................................................................. 1004 37.66 Delay control...................................................................................................................... 1004 37.67 Repeat control .................................................................................................................... 1005 37.68 Forever ............................................................................................................................... 1005 37.69 If, if–else ............................................................................................................................ 1005 37.70 Case, pattern ...................................................................................................................... 1006 37.71 Expect ............................................................................................................................... 1007 37.72 For ..................................................................................................................................... 1007 37.73 Do-while, foreach .............................................................................................................. 1007 37.74 Alias statement .................................................................................................................. 1008 37.75 Disables.............................................................................................................................. 1008 37.76 Return statement ............................................................................................................... 1008 37.77 Assign statement, deassign, force, release......................................................................... 1009 37.78 Callback ............................................................................................................................. 1009 37.79 Time queue ........................................................................................................................ 1010 37.80 Active time format ............................................................................................................. 1010 37.81 Attribute ............................................................................................................................ 1011 37.82 Iterator................................................................................................................................ 1012 37.83 Generates .......................................................................................................................... 1013 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xxii Copyright © 2013 IEEE. All rights reserved. 38. VPI routine definitions................................................................................................................... 1015 38.1 General............................................................................................................................... 1015 38.2 vpi_chk_error() .................................................................................................................. 1015 38.3 vpi_compare_objects()....................................................................................................... 1016 38.4 vpi_control() ...................................................................................................................... 1018 38.5 vpi_flush().......................................................................................................................... 1019 38.6 vpi_get()............................................................................................................................. 1019 38.7 vpi_get64()......................................................................................................................... 1020 38.8 vpi_get_cb_info()............................................................................................................... 1020 38.9 vpi_get_data() .................................................................................................................... 1021 38.10 vpi_get_delays()................................................................................................................. 1022 38.11 vpi_get_str()....................................................................................................................... 1024 38.12 vpi_get_systf_info()........................................................................................................... 1025 38.13 vpi_get_time().................................................................................................................... 1026 38.14 vpi_get_userdata() ............................................................................................................. 1027 38.15 vpi_get_value() .................................................................................................................. 1027 38.16 vpi_get_value_array() ....................................................................................................... 1033 38.17 vpi_get_vlog_info() ........................................................................................................... 1037 38.18 vpi_handle() ....................................................................................................................... 1038 38.19 vpi_handle_by_index() ...................................................................................................... 1039 38.20 vpi_handle_by_multi_index()............................................................................................ 1039 38.21 vpi_handle_by_name() ...................................................................................................... 1040 38.22 vpi_handle_multi()............................................................................................................. 1041 38.23 vpi_iterate()........................................................................................................................ 1041 38.24 vpi_mcd_close()................................................................................................................. 1042 38.25 vpi_mcd_flush()................................................................................................................. 1043 38.26 vpi_mcd_name() ................................................................................................................ 1043 38.27 vpi_mcd_open() ................................................................................................................. 1044 38.28 vpi_mcd_printf()................................................................................................................ 1045 38.29 vpi_mcd_vprintf().............................................................................................................. 1046 38.30 vpi_printf()......................................................................................................................... 1046 38.31 vpi_put_data().................................................................................................................... 1047 38.32 vpi_put_delays() ................................................................................................................ 1049 38.33 vpi_put_userdata() ............................................................................................................. 1052 38.34 vpi_put_value().................................................................................................................. 1052 38.35 vpi_put_value_array() ...................................................................................................... 1055 38.36 vpi_register_cb()................................................................................................................ 1059 38.37 vpi_register_systf() ............................................................................................................ 1067 38.38 vpi_release_handle().......................................................................................................... 1071 38.39 vpi_remove_cb()................................................................................................................ 1071 38.40 vpi_scan()........................................................................................................................... 1072 38.41 vpi_vprintf()....................................................................................................................... 1073 39. Assertion API................................................................................................................................. 1074 39.1 General............................................................................................................................... 1074 39.2 Overview............................................................................................................................ 1074 39.3 Static information .............................................................................................................. 1074 39.4 Dynamic information......................................................................................................... 1075 39.5 Control functions ............................................................................................................... 1079 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xxiii Copyright © 2013 IEEE. All rights reserved. 40. Code coverage control and API ..................................................................................................... 1083 40.1 General............................................................................................................................... 1083 40.2 Overview............................................................................................................................ 1083 40.3 SystemVerilog real-time coverage access ......................................................................... 1084 40.4 FSM recognition ................................................................................................................ 1089 40.5 VPI coverage extensions.................................................................................................... 1092 41. Data read API................................................................................................................................. 1097 Part Four: Annexes Annex A (normative) Formal syntax ......................................................................................................... 1099 A.1 Source text ......................................................................................................................... 1099 A.2 Declarations ....................................................................................................................... 1108 A.3 Primitive instances............................................................................................................. 1119 A.4 Instantiations...................................................................................................................... 1120 A.5 UDP declaration and instantiation ..................................................................................... 1122 A.6 Behavioral statements ........................................................................................................ 1123 A.7 Specify section................................................................................................................... 1130 A.8 Expressions ........................................................................................................................ 1134 A.9 General............................................................................................................................... 1139 A.10 Footnotes (normative)........................................................................................................ 1142 Annex B (normative) Keywords................................................................................................................ 1145 Annex C (normative) Deprecation............................................................................................................. 1147 C.1 General............................................................................................................................... 1147 C.2 Constructs that have been deprecated................................................................................ 1147 C.3 Accellera SystemVerilog 3.1a-compatible access to packed data..................................... 1148 C.4 Constructs identified for deprecation................................................................................. 1148 Annex D (informative) Optional system tasks and system functions........................................................ 1151 D.1 General............................................................................................................................... 1151 D.2 $countdrivers ..................................................................................................................... 1151 D.3 $getpattern ......................................................................................................................... 1152 D.4 $input ................................................................................................................................. 1153 D.5 $key and $nokey ................................................................................................................ 1153 D.6 $list..................................................................................................................................... 1153 D.7 $log and $nolog ................................................................................................................. 1153 D.8 $reset, $reset_count, and $reset_value .............................................................................. 1154 D.9 $save, $restart, and $incsave.............................................................................................. 1155 D.10 $scale ................................................................................................................................. 1156 D.11 $scope ................................................................................................................................ 1156 D.12 $showscopes ...................................................................................................................... 1156 D.13 $showvars .......................................................................................................................... 1156 D.14 $sreadmemb and $sreadmemh........................................................................................... 1156 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xxiv Copyright © 2013 IEEE. All rights reserved. Annex E (informative) Optional compiler directives ................................................................................ 1158 E.1 General............................................................................................................................... 1158 E.2 `default_decay_time........................................................................................................... 1158 E.3 `default_trireg_strength ..................................................................................................... 1158 E.4 `delay_mode_distributed ................................................................................................... 1159 E.5 `delay_mode_path.............................................................................................................. 1159 E.6 `delay_mode_unit .............................................................................................................. 1159 E.7 `delay_mode_zero.............................................................................................................. 1159 Annex F (normative) Formal semantics of concurrent assertions ............................................................. 1160 F.1 General............................................................................................................................... 1160 F.2 Overview............................................................................................................................ 1160 F.3 Abstract syntax .................................................................................................................. 1161 F.4 Rewriting algorithms ......................................................................................................... 1167 F.5 Semantics ........................................................................................................................... 1171 F.6 Extended expressions......................................................................................................... 1180 F.7 Recursive properties .......................................................................................................... 1180 Annex G (normative) Std package............................................................................................................. 1182 G.1 General............................................................................................................................... 1182 G.2 Overview............................................................................................................................ 1182 G.3 Semaphore ......................................................................................................................... 1182 G.4 Mailbox.............................................................................................................................. 1182 G.5 Randomize ......................................................................................................................... 1183 G.6 Process ............................................................................................................................... 1183 Annex H (normative) DPI C layer............................................................................................................. 1184 H.1 General............................................................................................................................... 1184 H.2 Overview............................................................................................................................ 1184 H.3 Naming conventions .......................................................................................................... 1185 H.4 Portability........................................................................................................................... 1185 H.5 svdpi.h include file............................................................................................................. 1185 H.6 Semantic constraints .......................................................................................................... 1186 H.7 Data types .......................................................................................................................... 1188 H.8 Argument passing modes................................................................................................... 1192 H.9 Context tasks and functions ............................................................................................... 1195 H.10 Include files........................................................................................................................ 1199 H.11 Arrays................................................................................................................................. 1202 H.12 Open arrays ........................................................................................................................ 1205 H.13 SV3.1a-compatible access to packed data (deprecated functionality)............................... 1211 Annex I (normative) svdpi.h...................................................................................................................... 1217 I.1 General............................................................................................................................... 1217 I.2 Overview............................................................................................................................ 1217 I.3 Source code........................................................................................................................ 1217 Authorized licensed use limited to: Intel Corporation via the Intel Library. Downloaded on January 21,2014 at 03:07:55 UTC from IEEE Xplore. Restrictions apply. xxv Copyright © 2013 IEEE. All rights reserved. Annex J (normative) Inclusion of foreign language code.......................................................................... 1226 J.1 General............................................................................................................................... 1226 J.2 Overview............................................................................................................................ 1226 J.3 Location independence ...................................................................................................... 1227 J.4 Object code inclusion......................................................................................................... 1227 Annex K (normative) vpi_user.h ............................................................................................................... 1230 K.1 General............................................................................................................................... 1230 K.2 Source code........................................................................................................................ 1230 Annex L (normative) vpi_compatibility.h ................................................................................................. 1247 L.1 General............................................................................................................................... 1247 L.2 Source code........................................................................................................................ 1247 Annex M (normative) sv_vpi_user.h ......................................................................................................... 1250 M.1 General............................................................................................................................... 1250 M.2 Source code........................................................................................................................ 1250 Annex N (normative) Algorithm for probabilistic distribution functions ................................................. 1260 N.1 General............................................................................................................................... 1260 N.2 Source code........................................................................................................................ 1260 Annex O (informative) Encryption/decryption flow ................................................................................. 1268 O.1 General............................................................................................................................... 1268 O.2 Overview............................................................................................................................ 1268 O.3 Tool vendor secret key encryption system ........................................................................ 1268 O.4 IP author secret key encryption system ............................................................................. 1269 O.5 Digital envelopes ............................................................................................................... 1270 Annex P (informative) Glossary ................................................................................................................ 1272 Annex Q (informative) Bibliography ........................................................................................................ 1275
标签: SystemVerilog IEEE
相关软件
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论