00001 // $Id: a00229.html,v 1.1 2009/01/07 19:29:50 alex.marin Exp $ 00002 //---------------------------------------------------------------------- 00003 // Copyright 2007-2008 Mentor Graphics Corporation 00004 // Copyright 2007-2008 Cadence Design Systems, Inc. 00005 // All Rights Reserved Worldwide 00006 // 00007 // Licensed under the Apache License, Version 2.0 (the 00008 // "License"); you may not use this file except in 00009 // compliance with the License. You may obtain a copy of 00010 // the License at 00011 // 00012 // http://www.apache.org/licenses/LICENSE-2.0 00013 // 00014 // Unless required by applicable law or agreed to in 00015 // writing, software distributed under the License is 00016 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00017 // CONDITIONS OF ANY KIND, either express or implied. See 00018 // the License for the specific language governing 00019 // permissions and limitations under the License. 00020 //---------------------------------------------------------------------- 00021 00022 `ifndef OVM_EVENT_SVH 00023 `define OVM_EVENT_SVH 00024 00025 typedef class ovm_object; 00026 typedef class ovm_event; 00027 00028 //------------------------------------------------------------------------------ 00029 // 00030 // CLASS: ovm_event_callback 00031 // 00032 // callbacks for ovm_event objects- users should inherit and override one or 00033 // more of the methods 00034 // 00035 //------------------------------------------------------------------------------ 00036 00037 virtual class ovm_event_callback extends ovm_object; 00038 extern function new (string name=""); 00039 extern virtual function ovm_object create (string name=""); 00040 extern virtual function bit pre_trigger (ovm_event e, ovm_object data=null); 00041 extern virtual function void post_trigger (ovm_event e, ovm_object data=null); 00042 endclass 00043 00044 00045 //------------------------------------------------------------------------------ 00046 // 00047 // CLASS: ovm_event 00048 // 00049 //------------------------------------------------------------------------------ 00050 00051 class ovm_event extends ovm_object; 00052 00053 const static string type_name = "ovm_event"; 00054 00055 extern function new (string name=""); 00056 extern virtual function ovm_object create (string name=""); 00057 extern virtual function string get_type_name (); 00058 00059 // waiting 00060 extern virtual task wait_on (bit delta=0); 00061 extern virtual task wait_off (bit delta=0); 00062 extern virtual task wait_trigger (); 00063 extern virtual task wait_ptrigger (); 00064 extern virtual task wait_trigger_data (output ovm_object data); 00065 extern virtual task wait_ptrigger_data(output ovm_object data); 00066 00067 // triggering 00068 extern virtual function void trigger (ovm_object data=null); 00069 extern virtual function ovm_object get_trigger_data (); 00070 extern virtual function time get_trigger_time (); 00071 00072 // state 00073 extern virtual function bit is_on (); 00074 extern virtual function bit is_off (); 00075 extern virtual function void reset (bit wakeup=0); 00076 00077 // callbacks 00078 extern virtual function void add_callback (ovm_event_callback cb, 00079 bit append=1); 00080 extern virtual function void delete_callback (ovm_event_callback cb); 00081 00082 // waiters list 00083 extern virtual function void cancel (); 00084 extern virtual function int get_num_waiters (); 00085 00086 00087 local event m_event; 00088 local int num_waiters; 00089 local bit on; 00090 local time trigger_time=0; 00091 local ovm_object trigger_data; 00092 local ovm_event_callback callbacks[$]; 00093 00094 extern virtual function void do_print (ovm_printer printer); 00095 extern virtual function void do_copy (ovm_object rhs); 00096 00097 endclass 00098 00099 00100 00101 //------------------------------------------------------------------------------ 00102 // 00103 // CLASS: ovm_event_pool 00104 // 00105 //------------------------------------------------------------------------------ 00106 00107 class ovm_event_pool extends ovm_object; 00108 00109 const static string type_name = "ovm_event_pool"; 00110 00111 extern function new (string name=""); 00112 extern virtual function ovm_object create (string name=""); 00113 extern virtual function string get_type_name (); 00114 00115 extern static function ovm_event_pool get_global_pool (); 00116 00117 extern virtual function ovm_event get (string name); 00118 00119 extern virtual function int num (); 00120 extern virtual function void delete (string name); 00121 extern virtual function int exists (string name); 00122 extern virtual function int first (ref string name); 00123 extern virtual function int last (ref string name); 00124 extern virtual function int next (ref string name); 00125 extern virtual function int prev (ref string name); 00126 00127 static local ovm_event_pool m_global_pool; 00128 local ovm_event pool[string]; 00129 00130 extern virtual function void do_print (ovm_printer printer); 00131 extern virtual function void do_copy (ovm_object rhs); 00132 00133 endclass 00134 00135 00136 00137 //----------------------------------------------------------------------------- 00138 // 00139 // CLASS: ovm_barrier 00140 // 00141 //----------------------------------------------------------------------------- 00142 00143 class ovm_barrier extends ovm_object; 00144 00145 const static string type_name = "ovm_barrier"; 00146 00147 extern function new (string name="", 00148 int threshold=0); 00149 extern virtual function ovm_object create (string name=""); 00150 extern virtual function string get_type_name (); 00151 00152 extern virtual task wait_for (); 00153 extern virtual function void reset (bit wakeup=1); 00154 extern virtual function void set_auto_reset (bit value=1); 00155 extern virtual function void set_threshold (int threshold); 00156 extern virtual function int get_threshold (); 00157 extern virtual function int get_num_waiters (); 00158 extern virtual function void cancel (); 00159 00160 // private 00161 extern local function bit reached_threshold (); 00162 00163 local int threshold; 00164 local int num_waiters; 00165 local bit at_threshold; 00166 local bit auto_reset; 00167 local ovm_event m_event; 00168 00169 extern local task m_trigger(); 00170 00171 extern virtual function void do_print (ovm_printer printer); 00172 extern virtual function void do_copy (ovm_object rhs); 00173 00174 endclass 00175 00176 00177 00178 //------------------------------------------------------------------------------ 00179 // 00180 // CLASS: ovm_barrier_pool 00181 // 00182 //------------------------------------------------------------------------------ 00183 00184 class ovm_barrier_pool extends ovm_object; 00185 00186 const static string type_name = "ovm_barrier_pool"; 00187 00188 extern function new (string name=""); 00189 extern virtual function ovm_object create (string name=""); 00190 extern virtual function string get_type_name (); 00191 00192 extern static function ovm_barrier_pool get_global_pool (); 00193 00194 extern virtual function ovm_barrier get (string name); 00195 extern virtual function int num (); 00196 extern virtual function void delete (string name); 00197 extern virtual function int exists (string name); 00198 extern virtual function int first (ref string name); 00199 extern virtual function int last (ref string name); 00200 extern virtual function int next (ref string name); 00201 extern virtual function int prev (ref string name); 00202 00203 static local ovm_barrier_pool m_global_pool; 00204 local ovm_barrier pool[string]; 00205 00206 extern virtual function void do_print (ovm_printer printer); 00207 extern virtual function void do_copy (ovm_object rhs); 00208 00209 endclass 00210 00211 00212 `endif // OVM_EVENT_SVH 00213
![]() Intelligent Design Verification Project: OVM, Revision: 2.0.1 |
Copyright (c) 2008 Intelligent Design Verification. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included here: http://www.intelligentdv.com/licenses/fdl.txt |
![]() Doxygen Version: 1.5.5 Wed Jan 7 19:27:17 2009 |