00001 //---------------------------------------------------------------------- 00002 // Copyright 2007-2008 Mentor Graphics Corporation 00003 // Copyright 2007-2008 Cadence Design Systems, Inc. 00004 // All Rights Reserved Worldwide 00005 // 00006 // Licensed under the Apache License, Version 2.0 (the 00007 // "License"); you may not use this file except in 00008 // compliance with the License. You may obtain a copy of 00009 // the License at 00010 // 00011 // http://www.apache.org/licenses/LICENSE-2.0 00012 // 00013 // Unless required by applicable law or agreed to in 00014 // writing, software distributed under the License is 00015 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00016 // CONDITIONS OF ANY KIND, either express or implied. See 00017 // the License for the specific language governing 00018 // permissions and limitations under the License. 00019 //---------------------------------------------------------------------- 00020 00021 // The following macros: ovm_IF_imp_decl all users to create implemenation 00022 // classes which a predefined tlm interface but add a suffix to the 00023 // implementation methods. This allows multiple interfaces of the same type 00024 // to be implemented in the same scope. 00025 // 00026 // For example: 00027 // 00028 // `ovm_blocking_put_imp_decl(_1) 00029 // `ovm_blocking_put_imp_decl(_2) 00030 // class my_put_imp#(type T=int) extends ovm_component; 00031 // ovm_blocking_put_imp_1#(T) export1; 00032 // ovm_blocking_put_imp_2#(T) export2; 00033 // ... 00034 // function void put_1 (input T t); 00035 // //puts comming into export1 00036 // ... 00037 // endfunction 00038 // function void put_2(input T t); 00039 // //puts comming into export2 00040 // ... 00041 // endfunction 00042 // endclass 00043 00044 // Note that the default, unsuffixed, implementations live in the file 00045 // tlm/ovm_imps.sv. 00046 00047 `define ovm_blocking_put_imp_decl(SFX) \ 00048 class ovm_blocking_put_imp``SFX #( type T=int , type IMP=int ) \ 00049 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00050 \ 00051 local IMP m_imp; \ 00052 \ 00053 function new( string name , IMP imp ); \ 00054 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00055 \ 00056 m_if = this; \ 00057 m_imp = imp; \ 00058 m_if_mask = `TLM_BLOCKING_PUT_MASK; \ 00059 m_if_name = "tlm_blocking_put"; \ 00060 assert( this.m_connector.add_if( m_if ) ); \ 00061 endfunction \ 00062 \ 00063 `ovm_get_type_name_func(ovm_blocking_put_imp``SFX # (T, IMP)) \ 00064 `BLOCKING_PUT_IMP_SFX(SFX,m_imp , T , t ) \ 00065 \ 00066 endclass 00067 00068 `define ovm_nonblocking_put_imp_decl(SFX) \ 00069 class ovm_nonblocking_put_imp``SFX #( type T=int , type IMP=int ) \ 00070 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00071 \ 00072 local IMP m_imp; \ 00073 \ 00074 function new( string name , IMP imp ); \ 00075 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00076 \ 00077 m_if = this; \ 00078 m_imp = imp; \ 00079 m_if_mask = `TLM_NONBLOCKING_PUT_MASK; \ 00080 m_if_name = "tlm_nonblocking_put"; \ 00081 assert( this.m_connector.add_if( m_if ) ); \ 00082 endfunction \ 00083 \ 00084 `ovm_get_type_name_func(ovm_nonblocking_put_imp``SFX # (T, IMP)) \ 00085 `NONBLOCKING_PUT_IMP_SFX( SFX,m_imp , T , t ) \ 00086 \ 00087 endclass 00088 00089 `define ovm_put_imp_decl(SFX) \ 00090 class ovm_put_imp #( type T=int , type IMP=int ) \ 00091 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00092 \ 00093 local IMP m_imp; \ 00094 \ 00095 function new( string name , IMP imp ); \ 00096 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00097 \ 00098 m_if = this; \ 00099 m_imp = imp; \ 00100 m_if_mask = `TLM_PUT_MASK; \ 00101 m_if_name = "tlm_put"; \ 00102 assert( this.m_connector.add_if( m_if ) ); \ 00103 endfunction \ 00104 \ 00105 `ovm_get_type_name_func(ovm_put_imp``SFX # (T, IMP)) \ 00106 `BLOCKING_PUT_IMP_SFX(SFX,m_imp , T , t ) \ 00107 `NONBLOCKING_PUT_IMP_SFX(SFX,m_imp , T , t ) \ 00108 \ 00109 endclass 00110 00111 `define ovm_blocking_get_imp_decl(SFX) \ 00112 class ovm_blocking_get_imp``SFX #( type T=int , type IMP=int ) \ 00113 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00114 \ 00115 local IMP m_imp; \ 00116 \ 00117 function new( string name , IMP imp ); \ 00118 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00119 \ 00120 m_if = this; \ 00121 m_imp = imp; \ 00122 m_if_mask = `TLM_BLOCKING_GET_MASK; \ 00123 m_if_name = "tlm_blocking_get"; \ 00124 assert( this.m_connector.add_if( m_if ) ); \ 00125 endfunction \ 00126 \ 00127 `ovm_get_type_name_func(ovm_blocking_get_imp``SFX # (T, IMP)) \ 00128 `BLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00129 \ 00130 endclass 00131 00132 `define ovm_nonblocking_get_imp_decl(SFX) \ 00133 class ovm_nonblocking_get_imp``SFX #( type T=int , type IMP=int ) \ 00134 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00135 \ 00136 local IMP m_imp; \ 00137 \ 00138 function new( string name , IMP imp ); \ 00139 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00140 \ 00141 m_if = this; \ 00142 m_imp = imp; \ 00143 m_if_mask = `TLM_NONBLOCKING_GET_MASK; \ 00144 m_if_name = "tlm_nonblocking_get"; \ 00145 assert( this.m_connector.add_if( m_if ) ); \ 00146 endfunction \ 00147 \ 00148 `ovm_get_type_name_func(ovm_nonblocking_get_imp``SFX # (T, IMP)) \ 00149 `NONBLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00150 \ 00151 endclass 00152 00153 `define ovm_get_imp_decl(SFX) \ 00154 class ovm_get_imp``SFX #( type T=int , type IMP=int ) \ 00155 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00156 \ 00157 local IMP m_imp; \ 00158 \ 00159 function new( string name , IMP imp ); \ 00160 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00161 \ 00162 m_if = this; \ 00163 m_imp = imp; \ 00164 m_if_mask = `TLM_GET_MASK; \ 00165 m_if_name = "tlm_get"; \ 00166 assert( this.m_connector.add_if( m_if ) ); \ 00167 endfunction \ 00168 \ 00169 `ovm_get_type_name_func(ovm_get_imp``SFX # (T, IMP)) \ 00170 `BLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00171 `NONBLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00172 \ 00173 endclass 00174 00175 `define ovm_blocking_peek_imp_decl(SFX) \ 00176 class ovm_blocking_peek_imp``SFX #( type T=int , type IMP=int ) \ 00177 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00178 \ 00179 local IMP m_imp; \ 00180 \ 00181 function new( string name , IMP imp ); \ 00182 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00183 \ 00184 m_if = this; \ 00185 m_imp = imp; \ 00186 m_if_mask = `TLM_BLOCKING_PEEK_MASK; \ 00187 m_if_name = "tlm_blocking_peek"; \ 00188 assert( this.m_connector.add_if( m_if ) ); \ 00189 endfunction \ 00190 \ 00191 `ovm_get_type_name_func(ovm_blocking_peek_imp``SFX # (T, IMP)) \ 00192 `BLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00193 \ 00194 endclass 00195 00196 `define ovm_nonblocking_peek_imp_decl(SFX) \ 00197 class ovm_nonblocking_peek_imp``SFX #( type T=int , type IMP=int ) \ 00198 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00199 \ 00200 local IMP m_imp; \ 00201 \ 00202 function new( string name , IMP imp ); \ 00203 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00204 \ 00205 m_if = this; \ 00206 m_imp = imp; \ 00207 m_if_mask = `TLM_NONBLOCKING_PEEK_MASK; \ 00208 m_if_name = "tlm_nonblocking_peek"; \ 00209 assert( this.m_connector.add_if( m_if ) ); \ 00210 endfunction \ 00211 \ 00212 `ovm_get_type_name_func(ovm_nonblocking_peek_imp``SFX # (T, IMP)) \ 00213 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00214 \ 00215 endclass 00216 00217 `define ovm_peek_imp_decl(SFX) \ 00218 class ovm_peek_imp``SFX #( type T=int , type IMP=int ) \ 00219 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00220 \ 00221 local IMP m_imp; \ 00222 \ 00223 function new( string name , IMP imp ); \ 00224 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00225 \ 00226 m_if = this; \ 00227 m_imp = imp; \ 00228 m_if_mask = `TLM_PEEK_MASK; \ 00229 m_if_name = "tlm_peek"; \ 00230 assert( this.m_connector.add_if( m_if ) ); \ 00231 endfunction \ 00232 \ 00233 `ovm_get_type_name_func(ovm_peek_imp``SFX # (T, IMP)) \ 00234 `BLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00235 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00236 \ 00237 endclass 00238 00239 00240 `define ovm_blocking_get_peek_imp_decl(SFX) \ 00241 class ovm_blocking_get_peek_imp``SFX #( type T=int , type IMP=int ) \ 00242 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00243 \ 00244 local IMP m_imp; \ 00245 \ 00246 function new( string name , IMP imp ); \ 00247 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00248 \ 00249 m_if = this; \ 00250 m_imp = imp; \ 00251 m_if_mask = `TLM_BLOCKING_GET_PEEK_MASK; \ 00252 m_if_name = "tlm_blocking_get_peek"; \ 00253 assert( this.m_connector.add_if( m_if ) ); \ 00254 endfunction \ 00255 \ 00256 `ovm_get_type_name_func(ovm_blocking_get_peek_imp``SFX # (T, IMP)) \ 00257 `BLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00258 `BLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00259 \ 00260 endclass 00261 00262 `define ovm_nonblocking_get_peek_imp_decl(SFX) \ 00263 class ovm_nonblocking_get_peek_imp``SFX #( type T=int , type IMP=int ) \ 00264 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00265 \ 00266 local IMP m_imp; \ 00267 \ 00268 function new( string name , IMP imp ); \ 00269 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00270 \ 00271 m_if = this; \ 00272 m_imp = imp; \ 00273 m_if_mask = `TLM_NONBLOCKING_GET_PEEK_MASK; \ 00274 m_if_name = "tlm_nonblocking_get_peek"; \ 00275 assert( this.m_connector.add_if( m_if ) ); \ 00276 endfunction \ 00277 \ 00278 `ovm_get_type_name_func(ovm_nonblocking_get_peek_imp``SFX # (T, IMP)) \ 00279 `NONBLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00280 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00281 \ 00282 endclass 00283 00284 `define ovm_get_peek_imp_decl(SFX) \ 00285 class ovm_get_peek_imp``SFX #( type T=int , type IMP=int ) \ 00286 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00287 \ 00288 local IMP m_imp; \ 00289 \ 00290 function new( string name , IMP imp ); \ 00291 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00292 \ 00293 m_if = this; \ 00294 m_imp = imp; \ 00295 m_if_mask = `TLM_GET_PEEK_MASK; \ 00296 m_if_name = "tlm_get_peek"; \ 00297 assert( this.m_connector.add_if( m_if ) ); \ 00298 endfunction \ 00299 \ 00300 `ovm_get_type_name_func(ovm_get_peek_imp``SFX # (T, IMP)) \ 00301 `BLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00302 `NONBLOCKING_GET_IMP_SFX(SFX,m_imp , T , t ) \ 00303 \ 00304 `BLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00305 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_imp , T , t ) \ 00306 \ 00307 endclass 00308 00309 `define ovm_blocking_master_imp_decl(SFX) \ 00310 class ovm_blocking_master_imp``SFX #( type REQ=int , type RSP=int , \ 00311 type IMP=int , \ 00312 type REQ_IMP=IMP , \ 00313 type RSP_IMP=IMP ) \ 00314 extends ovm_port_base #( tlm_if_base #(REQ, RSP) ); \ 00315 \ 00316 local REQ_IMP m_req_imp; \ 00317 local RSP_IMP m_rsp_imp; \ 00318 \ 00319 \ 00320 function new( string name , IMP imp , \ 00321 REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp ); \ 00322 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00323 \ 00324 m_if = this; \ 00325 m_req_imp = req_imp; \ 00326 m_rsp_imp = rsp_imp; \ 00327 m_if_mask = `TLM_BLOCKING_MASTER_MASK; \ 00328 m_if_name = "tlm_blocking_master"; \ 00329 assert( this.m_connector.add_if( m_if ) ); \ 00330 endfunction \ 00331 \ 00332 `ovm_get_type_name_func(ovm_blocking_master_imp``SFX # (T, IMP)) \ 00333 `BLOCKING_PUT_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00334 \ 00335 `BLOCKING_GET_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00336 `BLOCKING_PEEK_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00337 \ 00338 endclass 00339 00340 `define ovm_nonblocking_master_imp_decl(SFX) \ 00341 class ovm_nonblocking_master_imp #( type REQ=int , type RSP=int , \ 00342 type IMP=int , \ 00343 type REQ_IMP=IMP , \ 00344 type RSP_IMP=IMP ) \ 00345 \ 00346 extends ovm_port_base #( tlm_if_base #(REQ, RSP) ); \ 00347 \ 00348 local REQ_IMP m_req_imp; \ 00349 local RSP_IMP m_rsp_imp; \ 00350 \ 00351 function new( string name , IMP imp , \ 00352 REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp ); \ 00353 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00354 \ 00355 m_if = this; \ 00356 m_req_imp = req_imp; \ 00357 m_rsp_imp = rsp_imp; \ 00358 \ 00359 m_if_mask = `TLM_NONBLOCKING_MASTER_MASK; \ 00360 m_if_name = "tlm_nonblocking_master"; \ 00361 assert( this.m_connector.add_if( m_if ) ); \ 00362 endfunction \ 00363 \ 00364 `ovm_get_type_name_func(ovm_nonblocking_master_imp``SFX # (T, IMP)) \ 00365 `NONBLOCKING_PUT_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00366 \ 00367 `NONBLOCKING_GET_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00368 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00369 \ 00370 endclass 00371 00372 `define ovm_master_imp_decl(SFX) \ 00373 class ovm_master_imp``SFX #( type REQ=int , type RSP=int , \ 00374 type IMP=int , \ 00375 type REQ_IMP=IMP , type RSP_IMP=IMP ) \ 00376 extends ovm_port_base #( tlm_if_base #(REQ, RSP) ); \ 00377 \ 00378 local REQ_IMP m_req_imp; \ 00379 local RSP_IMP m_rsp_imp; \ 00380 \ 00381 function new( string name , IMP imp , \ 00382 REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp ); \ 00383 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00384 \ 00385 m_if = this; \ 00386 m_req_imp = req_imp; \ 00387 m_rsp_imp = rsp_imp; \ 00388 m_if_mask = `TLM_MASTER_MASK; \ 00389 m_if_name = "tlm_master"; \ 00390 assert( this.m_connector.add_if( m_if ) ); \ 00391 endfunction \ 00392 \ 00393 `ovm_get_type_name_func(ovm_master_imp``SFX # (T, IMP)) \ 00394 `BLOCKING_PUT_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00395 `NONBLOCKING_PUT_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00396 \ 00397 `BLOCKING_GET_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00398 `BLOCKING_PEEK_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00399 `NONBLOCKING_GET_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00400 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00401 \ 00402 endclass 00403 00404 `define ovm_blocking_slave_imp_decl(SFX) \ 00405 class ovm_blocking_slave_imp``SFX #( type REQ=int , type RSP=int , \ 00406 type IMP=int , \ 00407 type REQ_IMP=IMP , \ 00408 type RSP_IMP=IMP ) \ 00409 \ 00410 extends ovm_port_base #( tlm_if_base #(RSP, REQ) ); \ 00411 \ 00412 local REQ_IMP m_req_imp; \ 00413 local RSP_IMP m_rsp_imp; \ 00414 \ 00415 function new( string name , IMP imp , \ 00416 REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp ); \ 00417 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00418 \ 00419 m_if = this; \ 00420 m_req_imp = req_imp; \ 00421 m_rsp_imp = rsp_imp; \ 00422 m_if_mask = `TLM_BLOCKING_SLAVE_MASK; \ 00423 m_if_name = "tlm_blocking_slave"; \ 00424 \ 00425 assert( this.m_connector.add_if( m_if ) ); \ 00426 endfunction \ 00427 \ 00428 `ovm_get_type_name_func(ovm_blocking_slave_imp``SFX # (T, IMP)) \ 00429 `BLOCKING_PUT_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00430 \ 00431 `BLOCKING_GET_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00432 `BLOCKING_PEEK_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00433 \ 00434 endclass 00435 00436 `define ovm_nonblocking_slave_imp_decl(SFX) \ 00437 class ovm_nonblocking_slave_imp``SFX #( type REQ=int , type RSP=int , \ 00438 type IMP=int , \ 00439 type REQ_IMP=IMP , \ 00440 type RSP_IMP=IMP ) \ 00441 \ 00442 extends ovm_port_base #( tlm_if_base #(RSP, REQ) ); \ 00443 \ 00444 local REQ_IMP m_req_imp; \ 00445 local RSP_IMP m_rsp_imp; \ 00446 \ 00447 function new( string name , IMP imp , \ 00448 REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp ); \ 00449 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00450 \ 00451 m_if = this; \ 00452 m_req_imp = req_imp; \ 00453 m_rsp_imp = rsp_imp; \ 00454 m_if_mask = `TLM_NONBLOCKING_SLAVE_MASK; \ 00455 m_if_name = "tlm_nonblocking_slave"; \ 00456 \ 00457 assert( this.m_connector.add_if( m_if ) ); \ 00458 endfunction \ 00459 \ 00460 `ovm_get_type_name_func(ovm_nonblocking_slave_imp``SFX # (T, IMP)) \ 00461 `NONBLOCKING_PUT_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00462 \ 00463 `NONBLOCKING_GET_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00464 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00465 \ 00466 endclass 00467 00468 `define ovm_slave_imp_decl(SFX) \ 00469 class ovm_slave_imp``SFX #( type REQ=int , type RSP=int , \ 00470 type IMP=int , \ 00471 type REQ_IMP=IMP , type RSP_IMP=IMP ) \ 00472 extends ovm_port_base #( tlm_if_base #(RSP, REQ) ); \ 00473 \ 00474 local REQ_IMP m_req_imp; \ 00475 local RSP_IMP m_rsp_imp; \ 00476 \ 00477 function new( string name , IMP imp , \ 00478 REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp ); \ 00479 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00480 \ 00481 m_if = this; \ 00482 m_req_imp = req_imp; \ 00483 m_rsp_imp = rsp_imp; \ 00484 m_if_mask = `TLM_SLAVE_MASK; \ 00485 m_if_name = "tlm_slave"; \ 00486 \ 00487 assert( this.m_connector.add_if( m_if ) ); \ 00488 endfunction \ 00489 \ 00490 `ovm_get_type_name_func(ovm_slave_imp``SFX # (T, IMP)) \ 00491 `BLOCKING_PUT_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00492 `NONBLOCKING_PUT_IMP_SFX(SFX,m_rsp_imp , RSP , t ) // rsp \ 00493 \ 00494 `BLOCKING_GET_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00495 `BLOCKING_PEEK_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00496 `NONBLOCKING_GET_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00497 `NONBLOCKING_PEEK_IMP_SFX(SFX,m_req_imp , REQ , t ) // req \ 00498 \ 00499 endclass 00500 00501 `define ovm_blocking_transport_imp_decl(SFX) \ 00502 class ovm_blocking_transport_imp``SFX #( type REQ=int , \ 00503 type RSP=int , type IMP=int ) \ 00504 extends ovm_port_base #( tlm_if_base #(REQ, RSP) ); \ 00505 \ 00506 local IMP m_imp; \ 00507 \ 00508 function new( string name , IMP imp ); \ 00509 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00510 \ 00511 m_if = this; \ 00512 m_imp = imp; \ 00513 m_if_mask = `TLM_BLOCKING_TRANSPORT_MASK; \ 00514 m_if_name = "tlm_blocking_transport"; \ 00515 assert( this.m_connector.add_if( m_if ) ); \ 00516 endfunction \ 00517 \ 00518 `ovm_get_type_name_func(ovm_blocking_transport_imp``SFX # (T, IMP)) \ 00519 `BLOCKING_TRANSPORT_IMP``SFX(SFX,m_imp, REQ, RSP, req, rsp) \ 00520 \ 00521 endclass 00522 00523 `define ovm_non_blocking_transport_imp_decl(SFX) \ 00524 class ovm_nonblocking_transport_imp``SFX #( type REQ=int , \ 00525 type RSP=int , type IMP=int ) \ 00526 extends ovm_port_base #( tlm_if_base #(REQ, RSP) ); \ 00527 \ 00528 local IMP m_imp; \ 00529 \ 00530 function new( string name , IMP imp ); \ 00531 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00532 \ 00533 m_if = this; \ 00534 m_imp = imp; \ 00535 m_if_mask = `TLM_NONBLOCKING_TRANSPORT_MASK; \ 00536 m_if_name = "tlm_nonblocking_transport"; \ 00537 assert( this.m_connector.add_if( m_if ) ); \ 00538 endfunction \ 00539 \ 00540 `ovm_get_type_name_func(ovm_nonblocking_transport_imp``SFX # (T, IMP)) \ 00541 `NONBLOCKING_TRANSPORT_IMP_SFX(SFX,m_imp, REQ, RSP, req, rsp) \ 00542 \ 00543 endclass 00544 00545 `define ovm_transport_imp_decl(SFX) \ 00546 class ovm_transport_imp`SFX #( type REQ=int , \ 00547 type RSP=int , type IMP=int ) \ 00548 extends ovm_port_base #( tlm_if_base #(REQ, RSP) ); \ 00549 \ 00550 local IMP m_imp; \ 00551 \ 00552 function new( string name , IMP imp ); \ 00553 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00554 \ 00555 m_if = this; \ 00556 m_imp = imp; \ 00557 m_if_mask = `TLM_TRANSPORT_MASK; \ 00558 m_if_name = "tlm_transport"; \ 00559 assert( this.m_connector.add_if( m_if ) ); \ 00560 endfunction \ 00561 \ 00562 `ovm_get_type_name_func(ovm_transport_imp``SFX # (T, IMP)) \ 00563 `BLOCKING_TRANSPORT_IMP_SFX(SFX,m_imp, REQ, RSP, req, rsp) \ 00564 `NONBLOCKING_TRANSPORT_IMP_SFX(SFX,m_imp, REQ, RSP, req, rsp) \ 00565 \ 00566 endclass 00567 00568 `define ovm_analysis_imp_decl(SFX) \ 00569 class ovm_analysis_imp``SFX #( type T=int , type IMP=int ) \ 00570 extends ovm_port_base #( tlm_if_base #(T,T) ); \ 00571 \ 00572 local IMP m_imp; \ 00573 \ 00574 function new( string name , IMP imp ); \ 00575 super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 ); \ 00576 \ 00577 m_if = this; \ 00578 m_imp = imp; \ 00579 m_if_mask = `TLM_ANALYSIS_MASK; \ 00580 m_if_name = "tlm_analysis"; \ 00581 assert( this.m_connector.add_if( m_if ) ); \ 00582 endfunction \ 00583 \ 00584 `ovm_get_type_name_func(ovm_analysis_imp``SFX # (T, IMP)) \ 00585 function void write( input T t ); \ 00586 m_imp.write``SFX( t ); \ 00587 endfunction \ 00588 \ 00589 endclass 00590 00591 00592 // 00593 // These imps are used in ovm_*_port, ovm_*_export and ovm_*_imp, using suffixes 00594 // 00595 00596 `define BLOCKING_PUT_IMP_SFX(SFX,imp , TYPE , arg ) \ 00597 task put( input TYPE arg ); imp.put``SFX( arg ); endtask 00598 00599 `define BLOCKING_GET_IMP_SFX(SFX,imp , TYPE , arg ) \ 00600 task get( output TYPE arg ); imp.get``SFX( arg ); endtask 00601 00602 `define BLOCKING_PEEK_IMP_SFX(SFX,imp , TYPE , arg ) \ 00603 task peek( output TYPE arg );imp.peek``SFX( arg ); endtask 00604 00605 `define NONBLOCKING_PUT_IMP_SFX(SFX,imp , TYPE , arg ) \ 00606 function bit try_put( input TYPE arg ); \ 00607 if( !imp.try_put``SFX( arg ) ) return 0; \ 00608 return 1; \ 00609 endfunction \ 00610 function bit can_put(); return imp.can_put``SFX(); endfunction 00611 00612 `define NONBLOCKING_GET_IMP_SFX(SFX,imp , TYPE , arg ) \ 00613 function bit try_get( output TYPE arg ); \ 00614 if( !imp.try_get``SFX( arg ) ) return 0; \ 00615 return 1; \ 00616 endfunction \ 00617 function bit can_get(); return imp.can_get``SFX(); endfunction 00618 00619 `define NONBLOCKING_PEEK_IMP_SFX(SFX,imp , TYPE , arg ) \ 00620 function bit try_peek( output TYPE arg ); \ 00621 if( !imp.try_peek``SFX( arg ) ) return 0; \ 00622 return 1; \ 00623 endfunction \ 00624 function bit can_peek(); return imp.can_peek``SFX(); endfunction 00625 00626 `define BLOCKING_TRANSPORT_IMP_SFX(SFX,imp, REQ, RSP, req_arg, rsp_arg) \ 00627 task transport( input REQ req_arg, output RSP rsp_arg); \ 00628 imp.transport``SFX(req_arg, rsp_arg); \ 00629 endtask 00630 00631 `define NONBLOCKING_TRANSPORT_IMP_SFX(SFX,imp, REQ, RSP, req_arg, rsp_arg) \ 00632 function void nb_transport( input REQ req_arg, output RSP rsp_arg); \ 00633 if(imp) imp.nb_transport``SFX(req_arg, rsp_arg); \ 00634 endfunction 00635
![]() Intelligent Design Verification Project: OVM, Revision: 1.1.0 |
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.4.6 Mon Sep 29 14:20:12 2008 |