OVM Features Summary Prepared by: Amal Khailtash
Introduction <ul><li>What is OVM? </li></ul><ul><ul><li>SystemVerilog OOP and Classes </li></ul></ul><ul><ul><ul><li>Class...
SystemVerilog OOP and Classes <ul><li>Classes </li></ul><ul><ul><li>Parameterized (Similar C++ templates) </li></ul></ul><...
SystemVerilog OOP and Classes (continued…) <ul><li>Syntax </li></ul>Company Confidential. Distribution of this document is...
SystemVerilog OOP and Classes (continued…) <ul><li>Method Overloading </li></ul><ul><ul><li>Overloading is method function...
SystemVerilog OOP and Classes (continued…) <ul><li>Abstract Classes </li></ul><ul><ul><li>Are declared virtual </li></ul><...
SystemVerilog OOP and Classes (continued…) <ul><li>Parameterized Classes </li></ul>Company Confidential. Distribution of t...
SystemVerilog OOP and Classes (continued…) <ul><li>Factory Method Pattern </li></ul><ul><ul><li>An OOP Design pattern </li...
SystemVerilog OOP and Classes (continued…) <ul><li>Interfaces </li></ul><ul><ul><li>Interfaces are like bundle of wires </...
What is OVM? <ul><li>Open Verification Methodology </li></ul><ul><ul><li>v1.0, v1.1, v2.0 </li></ul></ul><ul><li>Library o...
OVM Classes (continued…) <ul><li>Most Classes Inherit Directly or Indirectly from ovm_void </li></ul><ul><ul><li>Allows Po...
OVM Class Hierarchy <ul><li>UML </li></ul><ul><ul><li>Used to represent a system’s model graphically </li></ul></ul><ul><u...
OVM Class Hierarchy (continued…) Company Confidential. Distribution of this document is not permitted without written auth...
OVM Class Hierarchy (continued…) <ul><li>Base </li></ul><ul><ul><li>ovm_void </li></ul></ul><ul><ul><li>ovm_object </li></...
OVM Class Hierarchy (continued…) <ul><li>Component Hierarchy </li></ul><ul><ul><li>ovm_component </li></ul></ul><ul><ul><l...
OVM Class Hierarchy (continued…) <ul><li>Reporting </li></ul><ul><ul><li>ovm_report_object </li></ul></ul><ul><ul><li>ovm_...
OVM Class Hierarchy (continued…) <ul><li>Factory </li></ul><ul><ul><li>ovm_object_wrapper </li></ul></ul><ul><ul><li>ovm_c...
OVM Class Hierarchy (continued…) <ul><li>Synchronization </li></ul><ul><ul><li>ovm_event </li></ul></ul><ul><ul><li>ovm_ev...
OVM Class Hierarchy (continued…) <ul><li>Policies </li></ul><ul><ul><li>ovm_comparer </li></ul></ul><ul><ul><li>ovm_packer...
OVM Class Hierarchy (continued…) <ul><li>TLM Interfaces </li></ul><ul><ul><li>tlm_if_base #( type T1=int, type T2=int ) </...
OVM Class Hierarchy (continued…) <ul><li>TLM Interface </li></ul><ul><li>TLM Ports/Exports </li></ul><ul><li>TLM Built-In ...
OVM Class Hierarchy (continued…) <ul><li>Components </li></ul><ul><ul><li>ovm_component </li></ul></ul><ul><ul><ul><li>ovm...
OVM Class Hierarchy (continued…) <ul><li>Components </li></ul>Company Confidential. Distribution of this document is not p...
OVM Class Hierarchy (continued…) <ul><li>Sequences </li></ul>Company Confidential. Distribution of this document is not pe...
OVM Class Hierarchy (continued…) <ul><li>Comparators </li></ul><ul><ul><li>ovm_in_order_comparator #(T, comp, convert, pai...
OVM Class Hierarchy (continued…) <ul><li>Utility Classes </li></ul><ul><ul><li>ovm_built_in_clone #(T) </li></ul></ul><ul>...
OVM Class Hierarchy (continued…) <ul><li>Macros </li></ul><ul><ul><li>OVM Macros Make Concise Readable Code </li></ul></ul...
OVM Fundamentals <ul><li>OSCI TLM </li></ul><ul><ul><li>TLM Interfaces and Channels </li></ul></ul><ul><ul><ul><li>Ports, ...
OSCI TLM <ul><li>Defines Semantics/Behaviors for Communicating Transactions between Components </li></ul><ul><li>Provides ...
OSCI TLM (continued…) <ul><li>Uni-Directional Interfaces </li></ul><ul><ul><li>put, get, peek, get_peek, analysis </li></u...
OSCI TLM (continued…) <ul><li>Uni-Directional Interfaces </li></ul><ul><ul><li>class ovm_ uni-if _port #( type T = int ) <...
OSCI TLM (continued…) <ul><li>Bi-Directional Interfaces </li></ul><ul><ul><li>class ovm_ bi-if _port #( type T = int ) </l...
Ports, Exports and Implementation <ul><li>Port / Analysis Port </li></ul><ul><ul><li>Inside initiator component to provide...
Ports, Exports and Implementation (continued…) <ul><li>Port / Export / Imp Connection </li></ul><ul><ul><li>Port -> Export...
OVM Building Blocks <ul><li>ovm_transaction </li></ul><ul><ul><li>Encapsulation of data, unit of transaction (bus read/wri...
OVM Building Blocks (continued…) <ul><li>ovm_monitor </li></ul><ul><ul><li>Embeds one (or more) SystemVerilog Interface(s)...
OVM Building Blocks (continued…) <ul><li>ovm_agent </li></ul><ul><ul><li>Encapsulates Sequencer, Driver, and Monitor </li>...
OVM Building Blocks (continued…) <ul><li>ovm_subscriber (scoreboards, coverage collectors) </li></ul><ul><ul><li>Is a temp...
Structure of OVM Test-Benches <ul><li>ovm_test </li></ul><ul><ul><li>Individual test-cases inherit from this class </li></...
OVM Component Phases <ul><li>A set of callback methods available to all components </li></ul><ul><ul><li>Used for synchron...
References and Examples <ul><li>OVMWorld </li></ul><ul><li>OVM v2.0.0 Documentation </li></ul><ul><li>Doulous : Getting St...
References and Examples (continued…) <ul><li>Doulos Getting Started with OVM </li></ul>my_test my_env seq_item_export seq_...
Upcoming SlideShare
Loading in …5
×

SystemVerilog OOP Ovm Features Summary

17,071 views

Published on

Summary of SystemVerilog OOP and Open Verification Methodology (OVM)

Published in: Technology, Business
15 Comments
13 Likes
Statistics
Notes
No Downloads
Views
Total views
17,071
On SlideShare
0
From Embeds
0
Number of Embeds
9,188
Actions
Shares
0
Downloads
0
Comments
15
Likes
13
Embeds 0
No embeds

No notes for slide

SystemVerilog OOP Ovm Features Summary

  1. 1. OVM Features Summary Prepared by: Amal Khailtash
  2. 2. Introduction <ul><li>What is OVM? </li></ul><ul><ul><li>SystemVerilog OOP and Classes </li></ul></ul><ul><ul><ul><li>Classes, Objects </li></ul></ul></ul><ul><ul><ul><li>Syntax </li></ul></ul></ul><ul><ul><ul><li>Method/Operator Overloading </li></ul></ul></ul><ul><ul><ul><li>Abstract Classes and Polymorphism </li></ul></ul></ul><ul><ul><ul><li>Parameterized Classes </li></ul></ul></ul><ul><ul><ul><li>Factory Method Pattern </li></ul></ul></ul><ul><ul><ul><li>Interfaces and Virtual Interfaces </li></ul></ul></ul><ul><ul><li>OVM Classes </li></ul></ul><ul><ul><li>OVM Class Hierarchy </li></ul></ul><ul><ul><ul><li>UML </li></ul></ul></ul><ul><ul><ul><li>Class Inheritance UML Diagrams </li></ul></ul></ul><ul><ul><ul><li>Utility Classes </li></ul></ul></ul><ul><ul><ul><li>Macros </li></ul></ul></ul><ul><li>OVM Fundamentals </li></ul><ul><ul><li>OSCI TLM </li></ul></ul><ul><ul><ul><li>TLM Interfaces and Channels </li></ul></ul></ul><ul><ul><ul><li>Ports, Exports and Implementation </li></ul></ul></ul><ul><ul><ul><li>TLM Connections </li></ul></ul></ul><ul><ul><li>OVM Building Blocks </li></ul></ul><ul><ul><li>Structure of OVM Test-Benches </li></ul></ul><ul><ul><li>OVM Component Phases </li></ul></ul><ul><ul><li>References and Examples </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  3. 3. SystemVerilog OOP and Classes <ul><li>Classes </li></ul><ul><ul><li>Parameterized (Similar C++ templates) </li></ul></ul><ul><ul><li>Single Inheritance (extends) </li></ul></ul><ul><ul><li>Encapsulate Data (Properties) and Behavior (Methods) </li></ul></ul><ul><ul><ul><li>Properties </li></ul></ul></ul><ul><ul><ul><ul><li>Access Restriction (local, protected, static) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Can be Randomized </li></ul></ul></ul></ul><ul><ul><ul><li>Methods </li></ul></ul></ul><ul><ul><ul><ul><li>No Method Overloading in Same Class! </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Single Constructor (function new) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>No Destructor! </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Tasks (timed) or Functions (Untimed) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Access Restrictions (local, protected, static) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Static Methods Cannot be Virtual </li></ul></ul></ul></ul><ul><ul><li>Can be Virtual (no implementation for methods) </li></ul></ul><ul><ul><li>Polymorphism through Object Hierarchy and Virtual Classes/Methods </li></ul></ul><ul><li>Objects </li></ul><ul><ul><li>Classes Instances </li></ul></ul><ul><ul><li>Object Handles are References (similar to Java/C++/C# references, pointers with automatic de-referencing and no delete) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  4. 4. SystemVerilog OOP and Classes (continued…) <ul><li>Syntax </li></ul>Company Confidential. Distribution of this document is not permitted without written authorization. class Complex; real re; real im; function new( real r, real i ); this.re = r; this.im = i; endfunction : new function Complex add( Complex c ); Complex result; result.re = this.re+c.re; result.im = this.im+c.im; return result; endfunction : add function string toString; string s; $sformat( s, &quot;(%0.3f %s %0.3fj)&quot;, this.re, (this.im<0?&quot;-&quot;:&quot;+&quot;), (this.im<0?-this.im:this.im) ); return s; endfunction : toString endclass : Complex program test; initial begin Complex a = new(1.0,-1.0); Complex b = new(2.0,+1.0); $display( “a = %s&quot;, a.toString() ); $display( “b = %s&quot;, b.toString() ); Complex x = new(0.0,0.0); x = a.add( b ); $display( “x = %s&quot;, x.toString() ); end endprogram : test Output: # a = (1.000 - 1.000j) # b = (2.000 + 1.000j) # x = (3.000 + 0.000J) // Inheritance class SpecificComplex extends Complex; int flag; function new( real r, real i, bit f ); super.new( r, i ); this.flag = f; endfunction : new; endclass : SpecificComplex
  5. 5. SystemVerilog OOP and Classes (continued…) <ul><li>Method Overloading </li></ul><ul><ul><li>Overloading is method functions and tasks with the same name, but different arguments and/or return types </li></ul></ul><ul><ul><li>Method overloading is only allowed in subclasses </li></ul></ul><ul><ul><ul><li>Normal function/task overloading is not allowed!!! </li></ul></ul></ul><ul><ul><li>Overloaded methods can be virtual or non-virtual </li></ul></ul><ul><li>Operator Overloading </li></ul><ul><ul><li>Operators could be overloaded </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. // EBNF overload_declaration : ‘bind’ overload_operator ‘function’ data_type function_identifier ‘(‘ overload_proto_formals ‘)’ ‘;’ overload_operator : ‘+’ | ‘++’ | ‘–’ | ‘--’ | ‘*’ | ‘**’ | ‘/‘ | ‘%’ | ‘==‘ | ‘!=‘ | ‘<‘ | ‘<=‘ | ‘>’ | ‘>=‘ | ‘=‘ overload_proto_formals : data_type (‘,’ data_type)* // bind + operator to functions bind + function Complex cadd1(Complex, Complex); bind + function Complex cadd2(Complex, real); bind + function Complex cadd3(Complex, int); … … function Complex cadd1( Complex a, Complex b ); return a.add(b); endfunction cadd function Complex cadd2( Complex a, real r ); Complex b = new Complex( r, 0.0 ); return a.add(b); endfunction cadd function Complex cadd3( Complex a, int i ); Complex b = new Complex( real’(i), 0.0 ); return a.add(b); endfunction cadd
  6. 6. SystemVerilog OOP and Classes (continued…) <ul><li>Abstract Classes </li></ul><ul><ul><li>Are declared virtual </li></ul></ul><ul><ul><li>Instances of abstract (virtual) classes cannot be created </li></ul></ul><ul><ul><li>Are used for common, incomplete base (parent) classes (creating a template for children) </li></ul></ul><ul><ul><li>Can contain method prototypes but no implementation </li></ul></ul><ul><ul><ul><li>Normal classes can have virtual methods </li></ul></ul></ul><ul><li>Polymorphism </li></ul><ul><ul><li>To call the overridden method via a parent class object, the method needs to be declared virtual </li></ul></ul><ul><ul><li>A virtual method overrides a method in all the base classes, whereas a normal method only overrides a method in that class and its descendants. </li></ul></ul><ul><ul><li>If a method is declared virtual, it will be virtual throughout the class hierarchy (same prototype everywhere) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. // Abstract Virtual Virtual class GenericPacket; virtual task Transmit(); // no implementation endclass : GenericPacket; class TCPPacket extends GenericPacket; // Transmit a TCP packet virtual task Transmit(); endtask : Transmit endclass : TCPPacket class UDPPacket extends GenericPacket; // Transmit a UDP Packet virtual task Transmit(); endtask : Transmit Endclass : UDPPacket GenericPacket gp; TCPPacket tp = new; // instance of TCPPacket UDPPakcet up = new; // instance of UDPPacket // ERROR: Cannot create and instance of virtual class! // gp = new; // ERROR: No implementation for Transmit in gp! // gp.Transmit(); // ERROR: Cannot assign base class object to child! // tp = gp; gp = tp; gp.Transmit(); // Sends a TCPPacket gp = up; gp.Transmit(); // Sends a UDPPacket
  7. 7. SystemVerilog OOP and Classes (continued…) <ul><li>Parameterized Classes </li></ul>Company Confidential. Distribution of this document is not permitted without written authorization. class stack #(type T = int); local T items[$]; task push( T a ); items.push_front(a); endtask : push task pop( ref T a ); a = items.pop_front(); endtask : pop endclass : stack program test; initial begin stack #(int) is = new; stack #(real) rs = new; for( int i=0; i<10; i++ ) begin $display( &quot;Pushed -> %0d : %0.3f&quot;, i, i*3.14 ); is.push( i ); rs.push( i*3.14 ); end $display( &quot;--------------------&quot; ); for( int i=0; i<10; i++ ) begin int x; real y; is.pop(x); rs.pop(y); $display( &quot;Popped -> %0d : %0.3f&quot;, x, y ); end end endprogram : test # Pushed -> 0 : 0.000 # Pushed -> 1 : 3.140 # Pushed -> 2 : 6.280 # Pushed -> 3 : 9.420 # Pushed -> 4 : 12.560 # Pushed -> 5 : 15.700 # Pushed -> 6 : 18.840 # Pushed -> 7 : 21.980 # Pushed -> 8 : 25.120 # Pushed -> 9 : 28.260 # -------------------- # Popped -> 9 : 28.260 # Popped -> 8 : 25.120 # Popped -> 7 : 21.980 # Popped -> 6 : 18.840 # Popped -> 5 : 15.700 # Popped -> 4 : 12.560 # Popped -> 3 : 9.420 # Popped -> 2 : 6.280 # Popped -> 1 : 3.140 # Popped -> 0 : 0.000
  8. 8. SystemVerilog OOP and Classes (continued…) <ul><li>Factory Method Pattern </li></ul><ul><ul><li>An OOP Design pattern </li></ul></ul><ul><ul><li>Deals with Creation of Objects (allow subclasses to choose which type of object to create) </li></ul></ul><ul><ul><ul><li>Type Overrides </li></ul></ul></ul><ul><ul><ul><li>Instance Overrides </li></ul></ul></ul>virtual class shape; function new(); $display( “Cannot instantiate shape!” ); endfucntion : new virtual function area(); endfunction : area endclass shape; class square extends shape; real side; function new(real s); this.side=s; endfunction : new virtual function real area(); return side*side; endfucntion : area endclass : square class circle extends shape; real radius; function new(real r); this.radius=r; endfunction : new virtual function real area(); return 3.1415*radius*radius; endfucntion : area endclass : circle class factory; static function create_shape( string shape_name. real param ); case( shape_name ) “ circle” : begin circle sh; sh=new(param); return sh; end “ square” : begin squere sh; sh=new(param); return sh; end endcase endfunction : create_shape endclass : factory program top initial begin shape a = factory::create_shape(“square”, 10.0); shape b = factory::create_shape(“circle”, 10.0); $display( a.area() ); $display( b.area() ); end endprogram : top
  9. 9. SystemVerilog OOP and Classes (continued…) <ul><li>Interfaces </li></ul><ul><ul><li>Interfaces are like bundle of wires </li></ul></ul><ul><ul><li>Individual elements can have directions (modport) </li></ul></ul><ul><ul><li>Can include tasks and functions (BFM style) </li></ul></ul><ul><ul><li>Can include assertions, cover and covergroups </li></ul></ul><ul><li>Virtual Interfaces </li></ul><ul><ul><li>Think of a virtual interface as a handle to a concrete interface (object). Similar to a class handle and the object referenced by that handle. </li></ul></ul><ul><ul><li>One needs to assign an interface to a virtual interface somehow to be able to access that interface signals/tasks/functions, … </li></ul></ul><ul><ul><li>In OVM, virtual interfaces are used inside Drivers/Monitors/… to connect to DUV’s interface </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. <ul><ul><ul><li>interface my_interface; … endinterface </li></ul></ul></ul><ul><ul><ul><li>my_interface if; </li></ul></ul></ul><ul><ul><ul><li>virtual my_interface vif; </li></ul></ul></ul><ul><ul><ul><li>// if.??? works fine, but vif.??? does not work yet, unless you do: </li></ul></ul></ul><ul><ul><ul><li>vif = if; </li></ul></ul></ul><ul><ul><ul><li>// then you can access the members: vif.??? </li></ul></ul></ul>
  10. 10. What is OVM? <ul><li>Open Verification Methodology </li></ul><ul><ul><li>v1.0, v1.1, v2.0 </li></ul></ul><ul><li>Library of SystemVerilog OOP Classes </li></ul><ul><ul><li>Implements OOP Factory methodology </li></ul></ul><ul><ul><li>Provides Base Classes for Various Components </li></ul></ul><ul><ul><li>Components are Polymorphic </li></ul></ul><ul><ul><li>Components Provide Various Interfaces: </li></ul></ul><ul><ul><ul><li>Hierarchy (Creation, Management, and Inspection) </li></ul></ul></ul><ul><ul><ul><li>Configuration of Component Topology and Properties </li></ul></ul></ul><ul><ul><ul><li>Phasing: Phased Build for Components (including the Environment, the Test) </li></ul></ul></ul><ul><ul><ul><li>Factory: Component/Object Warehouse </li></ul></ul></ul><ul><ul><ul><ul><li>Type Overrides </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Instance Overrides </li></ul></ul></ul></ul><ul><ul><ul><li>Reporting: Unified Reporting and Messaging </li></ul></ul></ul><ul><ul><ul><li>Transaction Recording (Transaction Database) </li></ul></ul></ul><ul><li>Includes OSCI (Open System C Initiative) TLM (Transaction Level Modeling) v2.0 </li></ul><ul><ul><li>Uniform Connectivity of Components </li></ul></ul><ul><ul><li>Defines Interfaces, Ports and Channels </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  11. 11. OVM Classes (continued…) <ul><li>Most Classes Inherit Directly or Indirectly from ovm_void </li></ul><ul><ul><li>Allows Polymorphism for Most Objects </li></ul></ul><ul><li>Class Categories </li></ul><ul><ul><li>Base </li></ul></ul><ul><ul><li>Component Hierarchy </li></ul></ul><ul><ul><li>Reporting </li></ul></ul><ul><ul><li>Factory </li></ul></ul><ul><ul><li>Synchronization </li></ul></ul><ul><ul><li>Policies </li></ul></ul><ul><ul><li>Policy Knobs </li></ul></ul><ul><ul><li>TLM Interfaces </li></ul></ul><ul><ul><li>Ports and Exports </li></ul></ul><ul><ul><li>Built-In TLM Channels </li></ul></ul><ul><ul><li>Components </li></ul></ul><ul><ul><li>Sequences </li></ul></ul><ul><ul><li>Comparators </li></ul></ul><ul><ul><li>Macros </li></ul></ul><ul><ul><li>Utility Classes </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  12. 12. OVM Class Hierarchy <ul><li>UML </li></ul><ul><ul><li>Used to represent a system’s model graphically </li></ul></ul><ul><ul><ul><li>Structure Diagram (Class, Component, …) </li></ul></ul></ul><ul><ul><ul><li>Behavior Diagram (Activity, State, Use Case) </li></ul></ul></ul><ul><ul><ul><li>Interaction Diagram (Communication, Sequence, Timing, …) </li></ul></ul></ul><ul><ul><li>Used for representing OOP class relationship/hierarchy </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. Association Composition Aggregation Dependence Generalization (Inheritance) Association
  13. 13. OVM Class Hierarchy (continued…) Company Confidential. Distribution of this document is not permitted without written authorization.
  14. 14. OVM Class Hierarchy (continued…) <ul><li>Base </li></ul><ul><ul><li>ovm_void </li></ul></ul><ul><ul><li>ovm_object </li></ul></ul><ul><ul><li>ovm_transaction </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  15. 15. OVM Class Hierarchy (continued…) <ul><li>Component Hierarchy </li></ul><ul><ul><li>ovm_component </li></ul></ul><ul><ul><li>ovm_phase </li></ul></ul><ul><ul><li>ovm_root </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  16. 16. OVM Class Hierarchy (continued…) <ul><li>Reporting </li></ul><ul><ul><li>ovm_report_object </li></ul></ul><ul><ul><li>ovm_reporter </li></ul></ul><ul><ul><li>ovm_report_handler </li></ul></ul><ul><ul><li>ovm_report_server </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  17. 17. OVM Class Hierarchy (continued…) <ul><li>Factory </li></ul><ul><ul><li>ovm_object_wrapper </li></ul></ul><ul><ul><li>ovm_component_registry </li></ul></ul><ul><ul><li>ovm_object_registry </li></ul></ul><ul><ul><li>ovm_factory </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  18. 18. OVM Class Hierarchy (continued…) <ul><li>Synchronization </li></ul><ul><ul><li>ovm_event </li></ul></ul><ul><ul><li>ovm_event_pool </li></ul></ul><ul><ul><li>ovm_event_callback </li></ul></ul><ul><ul><li>ovm_barrier </li></ul></ul><ul><ul><li>ovm_barrier_pool </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  19. 19. OVM Class Hierarchy (continued…) <ul><li>Policies </li></ul><ul><ul><li>ovm_comparer </li></ul></ul><ul><ul><li>ovm_packer </li></ul></ul><ul><ul><li>ovm_recorder </li></ul></ul><ul><ul><li>ovm_printer </li></ul></ul><ul><li>Policy Knobs </li></ul><ul><ul><li>ovm_printer_knobs </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  20. 20. OVM Class Hierarchy (continued…) <ul><li>TLM Interfaces </li></ul><ul><ul><li>tlm_if_base #( type T1=int, type T2=int ) </li></ul></ul><ul><li>Ports and Exports </li></ul><ul><ul><li>ovm_port_base #( type IF=ovm_object ) </li></ul></ul><ul><ul><ul><li>ovm_ uni-if _port #( type T=int ) </li></ul></ul></ul><ul><ul><ul><li>ovm_ uni-if _export #(type T=int ) </li></ul></ul></ul><ul><ul><ul><li>ovm_ uni-if _imp #(type T=int, type IMP=int ) </li></ul></ul></ul><ul><ul><ul><li>ovm_ bi-if _port #( type REQ=int , type RSP=int ) </li></ul></ul></ul><ul><ul><ul><li>ovm_ bi-if _export #(type REQ=int , type RSP=int) </li></ul></ul></ul><ul><ul><ul><li>ovm_ bi-if _imp #(type REQ=int , type RSP=int, type IMP=int ) </li></ul></ul></ul><ul><ul><li>sqr_if_base #( type REQ=ovm_object, type RSP=REQ ) </li></ul></ul><ul><ul><ul><li>ovm_seq_item_pull_ port_type #( type REQ=int, type RSP=REQ ) </li></ul></ul></ul><ul><ul><ul><li>ovm_seq_item_pull_ export_type #(type REQ=int, type RSP=REQ ) </li></ul></ul></ul><ul><ul><ul><li>ovm_seq_item_pull_ imp_type #(type REQ=int, type RSP=REQ ) </li></ul></ul></ul><ul><li>Built-In TLM Channels </li></ul><ul><ul><li>tlm_fifo #( type T=int ) </li></ul></ul><ul><ul><ul><li>tlm_analysis_fifo #( type T=int ) </li></ul></ul></ul><ul><ul><li>tlm_req_rsp_channel #( type REQ=int , type RSP=int ) </li></ul></ul><ul><ul><ul><li>tlm_transport_channel #( type REQ=int , type RSP=int ) </li></ul></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  21. 21. OVM Class Hierarchy (continued…) <ul><li>TLM Interface </li></ul><ul><li>TLM Ports/Exports </li></ul><ul><li>TLM Built-In Channels </li></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  22. 22. OVM Class Hierarchy (continued…) <ul><li>Components </li></ul><ul><ul><li>ovm_component </li></ul></ul><ul><ul><ul><li>ovm_test </li></ul></ul></ul><ul><ul><ul><li>ovm_env </li></ul></ul></ul><ul><ul><ul><li>ovm_agent (sequencer, driver, monitor) </li></ul></ul></ul><ul><ul><ul><li>ovm_driver / ovm_push_driver </li></ul></ul></ul><ul><ul><ul><li>omv_monitor </li></ul></ul></ul><ul><ul><ul><li>ovm_subscriber </li></ul></ul></ul><ul><ul><ul><li>ovm_scoreboard </li></ul></ul></ul><ul><ul><ul><li>ovm_sequencer / ovm_virtual_sequencer </li></ul></ul></ul><ul><ul><ul><li>ovm_random_stimulus </li></ul></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  23. 23. OVM Class Hierarchy (continued…) <ul><li>Components </li></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  24. 24. OVM Class Hierarchy (continued…) <ul><li>Sequences </li></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  25. 25. OVM Class Hierarchy (continued…) <ul><li>Comparators </li></ul><ul><ul><li>ovm_in_order_comparator #(T, comp, convert, pair_type) </li></ul></ul><ul><ul><ul><li>ovm_in_order_built_in_comparator #(T) </li></ul></ul></ul><ul><ul><ul><li>ovm_in_order_class_comparator #(T) </li></ul></ul></ul><ul><ul><li>ovm_algorithmic_comparator #(BEFORE,AFTER,TRANSFORMER) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  26. 26. OVM Class Hierarchy (continued…) <ul><li>Utility Classes </li></ul><ul><ul><li>ovm_built_in_clone #(T) </li></ul></ul><ul><ul><li>ovm_built_in_comp #(T) </li></ul></ul><ul><ul><li>ovm_built_in_converter #(T) </li></ul></ul><ul><ul><li>ovm_built_in_pair #(T1,T2) </li></ul></ul><ul><ul><li>ovm_class_clone #(T) </li></ul></ul><ul><ul><li>ovm_class_comp #(T) </li></ul></ul><ul><ul><li>ovm_class_converter #(T) </li></ul></ul><ul><ul><li>ovm_class_pair #(T1,T2) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  27. 27. OVM Class Hierarchy (continued…) <ul><li>Macros </li></ul><ul><ul><li>OVM Macros Make Concise Readable Code </li></ul></ul><ul><ul><li>Easy Factory Registration </li></ul></ul><ul><ul><li>Provide Common Methods for Various Elements </li></ul></ul><ul><ul><ul><li>create, get_type, get_type_name, copy , compare , pack , unpack , record , print , sprint, … </li></ul></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  28. 28. OVM Fundamentals <ul><li>OSCI TLM </li></ul><ul><ul><li>TLM Interfaces and Channels </li></ul></ul><ul><ul><ul><li>Ports, Exports and Implementation </li></ul></ul></ul><ul><ul><ul><li>TLM Connections </li></ul></ul></ul><ul><ul><li>OVM Building Blocks </li></ul></ul><ul><ul><li>Structure of OVM Test-Benches </li></ul></ul><ul><ul><li>OVM Component Phases </li></ul></ul><ul><ul><li>Examples </li></ul></ul>
  29. 29. OSCI TLM <ul><li>Defines Semantics/Behaviors for Communicating Transactions between Components </li></ul><ul><li>Provides Transfer of Transactions through Standard Interfaces </li></ul><ul><ul><li>Ports: Specify API </li></ul></ul><ul><ul><li>Exports: Provide Implementation </li></ul></ul><ul><ul><li>Imp: Provides the Implementations of the Methods in tlm_if_base to Ports and Exports that Require It. (Simulates Multiple Inheritance) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  30. 30. OSCI TLM (continued…) <ul><li>Uni-Directional Interfaces </li></ul><ul><ul><li>put, get, peek, get_peek, analysis </li></ul></ul><ul><li>Bi-Directional Interfaces </li></ul><ul><ul><li>master, slave, transport </li></ul></ul><ul><li>Channels </li></ul><ul><ul><li>tlm_fifo, tlm_analysis_fifo </li></ul></ul><ul><ul><li>tlm_req_rsp_channel, tlm_transport_channel </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  31. 31. OSCI TLM (continued…) <ul><li>Uni-Directional Interfaces </li></ul><ul><ul><li>class ovm_ uni-if _port #( type T = int ) </li></ul></ul><ul><ul><li>class ovm_ uni-if _export #( type T = int ) </li></ul></ul><ul><ul><li>class ovm_ uni-if _imp #( type T = int ) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. uni-if blocking_put put(T) nonblocking_put try_put(T), can_put() put put(T), try_put(T), can_put() blocking_get get(T) nonblocking_get try_get(T), can_get() get get(T), try_get(T), can_get() blocking_peek peek(T) nonblocking_peek try_peek(T), can_peek() peek peek(T), try_peek(T), can_peek() blocking_get_peek get(T) peek(T) nonblocking_get_peek try_peek(T), can_peek() try_get(T), can_get() get_peek get(T), try_get(T), can_get() peek(T). try_peek(T), can_peek() analysis write(T)
  32. 32. OSCI TLM (continued…) <ul><li>Bi-Directional Interfaces </li></ul><ul><ul><li>class ovm_ bi-if _port #( type T = int ) </li></ul></ul><ul><ul><li>class ovm_ bi-if _export #( type T = int ) </li></ul></ul><ul><ul><li>class ovm_ bi-if _imp #( type T = int ) </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. bi-if blocking_master put(REQ) get(RSP) peek(RSP) nonblocking_master try_put(REQ), can_put() try_get(RSP), can_get() try_peek(RSP), can_peek() master put(REQ), try_put(REQ), can_put() get(RSP), try_get(RSP), can_get() peek(RSP), try_peek(RSP), can_peek() blocking_slave get(REQ) peek(REQ) put(RSP) nonblocking_slave try_get(REQ), can_get() try_peek(REQ), can_peek() try_put(RSP), can_put() slave get(REQ), try_get(REQ), can_get() peek(REQ), try_peek(REQ), can_peek() put(RSP), try_put(RSP), can_put() blocking_transport transport(REQ,RSP) nonblocking_transport nb_transport(REQ,RSP) transport transport(REQ,RSP) nb_transport(REQ,RSP)
  33. 33. Ports, Exports and Implementation <ul><li>Port / Analysis Port </li></ul><ul><ul><li>Inside initiator component to provide access to predefined method of transaction interface </li></ul></ul><ul><li>Export / Analysis Export </li></ul><ul><ul><li>Route transaction to other layers </li></ul></ul><ul><li>Implementation (IMP) </li></ul><ul><ul><li>Inside target component to provide implementation of predefined method of transaction interface </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. port analysis port port export implementation export
  34. 34. Ports, Exports and Implementation (continued…) <ul><li>Port / Export / Imp Connection </li></ul><ul><ul><li>Port -> Export (Imp) </li></ul></ul><ul><ul><ul><li>c1.port.connect( c2.export ) </li></ul></ul></ul><ul><ul><li>Port -> Port (going up the hierarchy) </li></ul></ul><ul><ul><ul><li>sub_c1.port.connect( port ) </li></ul></ul></ul><ul><ul><li>Export -> Export (going down the hierarchy) </li></ul></ul><ul><ul><ul><li>export.connect( sub_c2.export ) </li></ul></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. put_export get_peek_export port export port imp get_port put_port tlm_fifo export port export put port put export put imp get_peek imp get_peek export get port put port I T T I I T T I a b c X y d e <ul><li>X.build() </li></ul><ul><ul><li>a.put_port.connect( b.put_export ); // p->e </li></ul></ul><ul><ul><li>c.get_port.connect( b.get_peek_export); // p->e </li></ul></ul><ul><ul><li>C.put_port.connect( x.port ); // p->p </li></ul></ul><ul><li>Y.build() </li></ul><ul><ul><li>y.export.connect( d.put_export ); // e->e </li></ul></ul><ul><ul><li>e.get_port.connect( d.get_peek_export ); // p->e </li></ul></ul><ul><li>top.build() </li></ul><ul><ul><li>X.port.connect( y.export ); // p->e </li></ul></ul>tlm_fifo
  35. 35. OVM Building Blocks <ul><li>ovm_transaction </li></ul><ul><ul><li>Encapsulation of data, unit of transaction (bus read/write, packet, block of data, …) </li></ul></ul><ul><ul><li>Can be randomized and constrained </li></ul></ul><ul><ul><li>Used to transfer information at various points in the environment </li></ul></ul><ul><li>ovm_sequence_item </li></ul><ul><ul><li>Inherits from ovm_transaction </li></ul></ul><ul><ul><li>Adds a property (m_sequnce_id) other than the inherited one (m_transaction_id) to route responses to the original sequence </li></ul></ul><ul><ul><li>Sequencers and Drivers use this </li></ul></ul><ul><li>ovm_driver / ovm_push_driver </li></ul><ul><ul><li>Embeds one (or more) SystemVerilog Interface(s) </li></ul></ul><ul><ul><li>Gets transactions from a sequencer or other components </li></ul></ul><ul><ul><li>Drives pins at DUV (using the interface) and based on the transaction received </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  36. 36. OVM Building Blocks (continued…) <ul><li>ovm_monitor </li></ul><ul><ul><li>Embeds one (or more) SystemVerilog Interface(s) </li></ul></ul><ul><ul><li>Monitors pins at DUV (using the interface) </li></ul></ul><ul><ul><li>Checks for timing at pin level </li></ul></ul><ul><ul><li>Creates a transaction based on pin wiggles, and sends it to other components (scoreboard, coverage collectors, …) </li></ul></ul><ul><ul><li>Checks status information and events </li></ul></ul><ul><ul><li>Can include coverage and protocol checkers </li></ul></ul><ul><li>ovm_sequencer </li></ul><ul><ul><li>Provides a sequence (ovm_sequence) of data (ovm_sequence_item) to the driver </li></ul></ul><ul><ul><li>Data items can be randomized and are ordered </li></ul></ul><ul><ul><li>Can be hierarchical and allows synchronization </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  37. 37. OVM Building Blocks (continued…) <ul><li>ovm_agent </li></ul><ul><ul><li>Encapsulates Sequencer, Driver, and Monitor </li></ul></ul><ul><ul><li>Has an active mode and a passive mode (is_active) </li></ul></ul><ul><ul><ul><li>In passive mode, Sequencer and Driver are disabled </li></ul></ul></ul><ul><ul><li>Has configuration data to configure its components </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. agent DUV IF VIF config VIF analysis sequencer driver monitor
  38. 38. OVM Building Blocks (continued…) <ul><li>ovm_subscriber (scoreboards, coverage collectors) </li></ul><ul><ul><li>Is a template for classes that have an analysis export that connect to analysis ports for collecting information (coverage, …) </li></ul></ul><ul><li>ovm_env </li></ul><ul><ul><li>An environment encapsulates a number of Agents, Drivers, Monitors, Scoreboards, … </li></ul></ul><ul><ul><li>Has properties to customize its components’ topology and behavior </li></ul></ul><ul><ul><li>Environments can be hierarchical and contain other environments </li></ul></ul><ul><ul><li>Topmost environment could be considered a the test-bench for a number of interfaces </li></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  39. 39. Structure of OVM Test-Benches <ul><li>ovm_test </li></ul><ul><ul><li>Individual test-cases inherit from this class </li></ul></ul><ul><ul><li>Each test-case instantiates environments and configures them (topological changes or configuration changes) </li></ul></ul><ul><li>Test-Bench </li></ul><ul><ul><li>The top-level test-bench instantiates interfaces that connect to DUV. </li></ul></ul><ul><ul><li>Instantiates DUV </li></ul></ul><ul><ul><li>Calls run_test() (or run_test(“name”)) </li></ul></ul><ul><ul><ul><li>+OVM_TESTNAME=? select which ovm_test class to instantiate and run </li></ul></ul></ul><ul><ul><ul><li>run_test() is a method in ovm_root that is automatically instantiated </li></ul></ul></ul>Company Confidential. Distribution of this document is not permitted without written authorization. Top test2 test1 DUV Clock/Reset IF IF IF VIF env1 VIF VIF env2 agent1 agent2 agent3
  40. 40. OVM Component Phases <ul><li>A set of callback methods available to all components </li></ul><ul><ul><li>Used for synchronization in the environment </li></ul></ul><ul><ul><li>Any subclass of ovm_component can implement any of these callbacks </li></ul></ul><ul><ul><li>Child component instantiations is done in build phase </li></ul></ul><ul><ul><li>Connect is used to connect child components </li></ul></ul><ul><ul><li>Main functionality is placed in run phase </li></ul></ul>Report simulation results. function report Check simulation results. function check Collect information from run phase. function extract This is where the main guts of a component functionality resides. It can consume time and can spawn other processes. Stops when global_stop_request is called. task run Called before start of simulation. Can be used for printing banners, initializing memories, … function start_of_simulation Final configuration, topology, connection and integrity checks function end_of_elaboration Used for connecting ports, exports and implementations function connect Used for creation of components and component hierarchies function build Descripton Type Phase
  41. 41. References and Examples <ul><li>OVMWorld </li></ul><ul><li>OVM v2.0.0 Documentation </li></ul><ul><li>Doulous : Getting Started with OVM </li></ul><ul><ul><li>http://www.doulos.com/knowhow/sysverilog/ovm/ </li></ul></ul><ul><ul><ul><li>Tutorial 0 - OVM Verification Primer </li></ul></ul></ul><ul><ul><ul><li>Tutorial 1 - A First Example </li></ul></ul></ul><ul><ul><ul><li>Tutorial 2 - Configurations and Sequences </li></ul></ul></ul><ul><li>Mentor Graphics </li></ul><ul><ul><li>Mentor Verification Methodology </li></ul></ul><ul><ul><li>Getting Started with the OVM 2.0: AVM Backward Compatibility and Migration </li></ul></ul><ul><ul><li>Overview of Sequence Based Stimulus Generation in OVM 2.0 </li></ul></ul><ul><li>OVM v2.0 Examples </li></ul>Company Confidential. Distribution of this document is not permitted without written authorization.
  42. 42. References and Examples (continued…) <ul><li>Doulos Getting Started with OVM </li></ul>my_test my_env seq_item_export seq_item_port dut_if vif dut my_sequencer my_driver

×