Example: confidence

UVM Transactions - Definitions, Methods and Usage

SNUG 2014 1 UVM Transactions - Definitions, Rev Methods and Usage World Class Verilog, SystemVerilog & OVM/UVM Training UVM Transactions - Definitions, Methods and Usage Clifford E. Cummings Sunburst Design, Inc. ABSTRACT Fundamental questions most novice UVM users have include: Why uses classes instead of structs to define Transactions for verification environments? What are advantages of using classes to represent Transactions in a verification environment? What Methods should be defined in a UVM transaction class and why are there both field macros and do_methods() for creating the transaction Methods ? This paper will detail advantages related to using class-based Transactions and answer questions about why there is so much confusion surrounding transaction method definitions and Usage .

SNUG 2014 1 UVM Transactions - Definitions, Rev 1.1 Methods and Usage World Class Verilog, SystemVerilog & OVM/UVM Training UVM Transactions - Definitions, Methods and Usage

Tags:

  Definition, Methods, Transactions, Usage, Uvm transactions definitions, Methods and usage

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of UVM Transactions - Definitions, Methods and Usage

1 SNUG 2014 1 UVM Transactions - Definitions, Rev Methods and Usage World Class Verilog, SystemVerilog & OVM/UVM Training UVM Transactions - Definitions, Methods and Usage Clifford E. Cummings Sunburst Design, Inc. ABSTRACT Fundamental questions most novice UVM users have include: Why uses classes instead of structs to define Transactions for verification environments? What are advantages of using classes to represent Transactions in a verification environment? What Methods should be defined in a UVM transaction class and why are there both field macros and do_methods() for creating the transaction Methods ? This paper will detail advantages related to using class-based Transactions and answer questions about why there is so much confusion surrounding transaction method definitions and Usage .

2 This paper will also detail transaction method Usage and field definition guidelines and tradeoffs. SNUG-2014 Silicon Valley, CA Voted Best TechnicalPaper - 3rd Place SNUG 2014 2 UVM Transactions - Definitions, Rev Methods and Usage Table of Contents 1. Introduction .. 7 2. Classes -vs- structs .. 7 3. Transaction class types .. 8 Class parameter types: uvm_sequence_item & int .. 8 UVM Transactions .. 8 Unnecessary Output Randomization .. 10 4. UVM transaction types .. 10 Standard class formatting .. 10 5. Transaction class Methods .. 11 6. Introduction to standard transaction Methods .. 12 Factory registration of Transactions .. 12 `uvm_object_utils() -vs- `uvm_object_utils_begin()/_end .. 12 __m_uvm_field_automation() method .. 15 Proposed Future UVM Macro 15 7.

3 Inherited standard transaction Methods .. 16 Should I override the standard transaction Methods ? .. 18 Inherited transaction utility Methods .. 20 create() method .. 20 clone() method .. 21 convert2string() .. 21 Plan for extended convert2string() Methods .. 22 Transaction printAll() method?? .. 23 8. Do_methods() .. 24 Virtual method rules and virtual do_method() prototypes .. 25 base-class casting to extended class handle .. 25 rhs & rhs_ do_method() arguments .. 26 uvm_object default do_methods() .. 27 copy() and do_copy() .. 27 Using the copy() method: (from_tr) .. 29 print(), sprint() and do_print() .. 30 record() and do_record() .. 32 pack() and do_pack() .. 32 unpack() and do_unpack() .. 32 compare() and do_compare() .. 33 SNUG 2014 3 UVM Transactions - Definitions, Rev Methods and Usage uvm_comparer policy class Methods .

4 35 do_methods & () .. 37 Templates with do_methods() .. 38 9. Field macros .. 40 Field macro types .. 42 Field macro flags .. 44 Combining Field Macros with do_methods() .. 50 10. 51 Benchmarking methodology .. 51 Benchmarking do_methods() with nonrand-outputs and rand-outputs .. 53 Benchmarking field macros with nonrand-outputs and rand-outputs .. 54 11. Summary & Conclusions .. 56 12. Acknowledgements .. 57 13. References: .. 57 14. AUTHOR & CONTACT INFORMATION .. 58 15. Appendix A .. 59 UVM classes parameterized to uvm_sequence_item .. 59 UVM classes parameterized to int .. 59 16. Appendix B .. 62 Benchmark files to test simulation efficiency .. 62 Benchmark vcs_benchmark_times file .. 65 Benchmark test1 file with 66 trans1f - randomized outputs - uses field macros - no UVM_ALL_ON flags.

5 72 Table of Tables Table 1 - uvm_comparer Methods .. 37 Table 2 - Field macros defined in UVM .. 43 Table 3 - UVM field macro flag parameters defined in .. 45 Table 4 - UVM field macro onehot flag settings in .. 46 SNUG 2014 4 UVM Transactions - Definitions, Rev Methods and Usage Table of Figures Figure 1 - Transaction passing .. 9 Figure 2 - Standard class formatting .. 10 Figure 3 - Transaction formatting w/ field macros .. 11 Figure 4 - Transaction formatting w/ do_methods() .. 11 Figure 5 - Actual `define uvm_object_utils macro definition .. 13 Figure 6 - Actual `define uvm_object_utils_begin macro definition .. 13 Figure 7 - Actual `define uvm_object_utils_end macro definition .. 13 Figure 8 - Illegal Syntax - Calling both `uvm_object_utils() and `uvm_field_utils_begin().

6 14 Figure 9 - Proposed UVM Change - new definition for `uvm_object_utils(T) .. 16 Figure 10 - Important, inherited utility non-virtual Methods .. 16 Figure 11 - Standard transaction Methods - two ways to create them .. 17 Figure 12 - Important utility non-virtual method prototypes .. 17 Figure 13 - UVM - src/ - compare() method implementation .. 19 Figure 14 - Important, inherited utility virtual Methods .. 20 Figure 15 - Important utility virtual method prototypes .. 20 Figure 16 - uvm_object create() method - manual definition .. 21 Figure 17 - uvm_object source code for convert2string() .. 21 Figure 18 - Extended transaction function calls to () & () 23 Figure 19 - Creating the standard transaction Methods by overriding the built-in do_methods() 24 Figure 20 - Inherited do_method() hooks to define standard transaction Methods .

7 25 Figure 21 - Overriding the do_copy() and do_compare() Methods with uvm_object inputs .. 26 Figure 22 - Common do_copy() coding example with trans1 declared using rhs_ handle name . 27 Figure 23 - Preferred do_copy() coding example with trans1 declared using tr handle name .. 27 Figure 24 - Transaction copy() and compare() Methods - common Usage block diagram .. 28 Figure 25 - Example - collecting Transactions using the () method .. 29 Figure 26 - do_copy() inherited virtual method prototype and source code .. 29 Figure 27 - trans1 example with do_copy() and do_compare() Methods defined .. 30 Figure 28 - NULL do_print() method .. 31 Figure 29 - do_print() inherited virtual method prototype and source code .. 31 Figure 30 - do_record() inherited virtual method prototype and source code.

8 32 Figure 31 - do_pack() inherited virtual method prototype and source code .. 32 SNUG 2014 5 UVM Transactions - Definitions, Rev Methods and Usage Figure 32 - do_unpack() inherited virtual method prototype and source code .. 33 Figure 33 - do_compare() inherited virtual method prototype and source code .. 33 Figure 34 - Example - comparing Transactions using (exp_tr) 35 Figure 35 - do_compare() method that does not use the uvm_comparer .. 36 Figure 36 - do_compare() method that DOES use the uvm_comparer Methods .. 36 Figure 37 - Non-comparer output -vs- uvm_comparer reported messages .. 37 Figure 38 - Example template file with do_copy() & do_compare() templates .. 39 Figure 39 - Creating the standard transaction Methods by using the UVM field macros .. 40 Figure 40 - Creating the standard transaction Methods by using the field macros.

9 41 Figure 41 - ERROR - combining variables into a single field macro - VCS error shown .. 42 Figure 42 - ERROR - concatenating variables into a single field macro - VCS error shown .. 42 Figure 43- UVM field macro onehot flag settings diagram .. 46 Figure 44 - Field macro flags implicitly enable UVM_ALL_ON .. 47 Figure 45 - trans2 legally defined using multiple +-separated field macro flags .. 48 Figure 46 - test2: copies and compares trans2 objects .. 48 Figure 47 - test2 simulation output - b-variable comparison fails as expected .. 49 Figure 48 - UVM_NOCOPY flag accidentally |-specified twice - nocopy remains active .. 49 Figure 49 - UVM_NOCOPY flag accidentally +-specified twice - removing the nocopy setting 49 Figure 50 - trans8b base with field macros extended in trans8 with do_methods().

10 50 Figure 51 - Benchmark run_phase() with randomize(), copy() and compare() loop .. 52 Figure 52 - Common benchmark trans1 code .. 52 Figure 53 - Benchmark script to run the first Transactions five times .. 53 Figure 54 - First benchmark trans1 with non-rand outputs and do_methods().. 54 Figure 55 - Third benchmark trans1 with non-rand outputs and field macros .. 55 Figure 56 - UVM classes parameterized to the uvm_sequence_item type .. 59 Figure 57 - UVM classes parameterized to the int type .. 61 Figure 58 - vcs_benchmark_times report file for a loop CNT=10,000,000 .. 65 SNUG 2014 6 UVM Transactions - Definitions, Rev Methods and Usage Table of Examples Example 1 - File: .. 62 Example 2 - File: .. 62 Example 3 - File: .. 62 Example 4 - File: .. 62 Example 5 - File.


Related search queries