ovm_imps.svh

Go to the documentation of this file.
00001 // $Id: ovm__imps_8svh-source.html,v 1.1 2008/10/07 21:54:51 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 class ovm_blocking_put_imp #( type T = int , type IMP = int )
00023   extends ovm_port_base #( tlm_if_base #(T,T) );
00024 
00025   local IMP m_imp;
00026  
00027   function new( string name , IMP imp );
00028     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00029     
00030     m_if = this;
00031     m_imp = imp;
00032     m_if_mask = `TLM_BLOCKING_PUT_MASK;
00033     m_if_name = "tlm_blocking_put";
00034     assert( this.m_connector.add_if( m_if ) );
00035   endfunction
00036 
00037   `BLOCKING_PUT_IMP( m_imp , T , t )
00038   
00039 endclass
00040 
00041 class ovm_nonblocking_put_imp #( type T = int , type IMP = int )
00042   extends ovm_port_base #( tlm_if_base #(T,T) );
00043 
00044   local IMP m_imp;
00045  
00046   function new( string name , IMP imp );
00047     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00048     
00049     m_if = this;
00050     m_imp = imp;
00051     m_if_mask = `TLM_NONBLOCKING_PUT_MASK;
00052     m_if_name = "tlm_nonblocking_put";
00053     assert( this.m_connector.add_if( m_if ) );
00054   endfunction
00055 
00056   `NONBLOCKING_PUT_IMP( m_imp , T , t )
00057   
00058 endclass
00059 
00060 class ovm_put_imp #( type T = int , type IMP = int )
00061   extends ovm_port_base #( tlm_if_base #(T,T) );
00062 
00063   local IMP m_imp;
00064  
00065   function new( string name , IMP imp );
00066     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00067     
00068     m_if = this;
00069     m_imp = imp;
00070     m_if_mask = `TLM_PUT_MASK;
00071     m_if_name = "tlm_put";
00072     assert( this.m_connector.add_if( m_if ) );
00073 endfunction
00074 
00075   `BLOCKING_PUT_IMP( m_imp , T , t )
00076   `NONBLOCKING_PUT_IMP( m_imp , T , t )
00077   
00078 endclass
00079 
00080 class ovm_blocking_get_imp #( type T = int , type IMP = int )
00081   extends ovm_port_base #( tlm_if_base #(T,T) );
00082 
00083   local IMP m_imp;
00084  
00085   function new( string name , IMP imp );
00086     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00087     
00088     m_if = this;
00089     m_imp = imp;
00090     m_if_mask = `TLM_BLOCKING_GET_MASK;
00091     m_if_name = "tlm_blocking_get";
00092     assert( this.m_connector.add_if( m_if ) );
00093   endfunction
00094 
00095   `BLOCKING_GET_IMP( m_imp , T , t )
00096   
00097 endclass
00098 
00099 class ovm_nonblocking_get_imp #( type T = int , type IMP = int )
00100   extends ovm_port_base #( tlm_if_base #(T,T) );
00101 
00102   local IMP m_imp;
00103  
00104   function new( string name , IMP imp );
00105     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00106     
00107     m_if = this;
00108     m_imp = imp;
00109     m_if_mask = `TLM_NONBLOCKING_GET_MASK;
00110     m_if_name = "tlm_nonblocking_get";
00111     assert( this.m_connector.add_if( m_if ) );
00112   endfunction
00113 
00114   `NONBLOCKING_GET_IMP( m_imp , T , t )
00115   
00116 endclass
00117 
00118 class ovm_get_imp #( type T = int , type IMP = int )
00119   extends ovm_port_base #( tlm_if_base #(T,T) );
00120 
00121   local IMP m_imp;
00122  
00123   function new( string name , IMP imp );
00124     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00125     
00126     m_if = this;
00127     m_imp = imp;
00128     m_if_mask = `TLM_GET_MASK;
00129     m_if_name = "tlm_get";
00130     assert( this.m_connector.add_if( m_if ) );
00131   endfunction
00132 
00133   `BLOCKING_GET_IMP( m_imp , T , t )
00134   `NONBLOCKING_GET_IMP( m_imp , T , t )
00135   
00136 endclass
00137 
00138 class ovm_blocking_peek_imp #( type T = int , type IMP = int )
00139   extends ovm_port_base #( tlm_if_base #(T,T) );
00140 
00141   local IMP m_imp;
00142  
00143   function new( string name , IMP imp );
00144     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00145     
00146     m_if = this;
00147     m_imp = imp;
00148     m_if_mask = `TLM_BLOCKING_PEEK_MASK;
00149     m_if_name = "tlm_blocking_peek";
00150     assert( this.m_connector.add_if( m_if ) );
00151   endfunction
00152 
00153   `BLOCKING_PEEK_IMP( m_imp , T , t )
00154   
00155 endclass
00156 
00157 class ovm_nonblocking_peek_imp #( type T = int , type IMP = int )
00158   extends ovm_port_base #( tlm_if_base #(T,T) );
00159 
00160   local IMP m_imp;
00161  
00162   function new( string name , IMP imp );
00163     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00164     
00165     m_if = this;
00166     m_imp = imp;
00167     m_if_mask = `TLM_NONBLOCKING_PEEK_MASK;
00168     m_if_name = "tlm_nonblocking_peek";
00169     assert( this.m_connector.add_if( m_if ) );
00170   endfunction
00171 
00172   `NONBLOCKING_PEEK_IMP( m_imp , T , t )
00173   
00174 endclass
00175 
00176 class ovm_peek_imp #( 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_PEEK_MASK;
00187     m_if_name = "tlm_peek";
00188     assert( this.m_connector.add_if( m_if ) );
00189   endfunction
00190 
00191   `BLOCKING_PEEK_IMP( m_imp , T , t )
00192   `NONBLOCKING_PEEK_IMP( m_imp , T , t )
00193   
00194 endclass
00195 
00196 
00197 class ovm_blocking_get_peek_imp #( 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_BLOCKING_GET_PEEK_MASK;
00208     m_if_name = "tlm_blocking_get_peek";
00209     assert( this.m_connector.add_if( m_if ) );
00210   endfunction
00211 
00212   `BLOCKING_GET_IMP( m_imp , T , t )
00213   `BLOCKING_PEEK_IMP( m_imp , T , t )
00214   
00215 endclass
00216 
00217 class ovm_nonblocking_get_peek_imp #( type T = int , type IMP = int )
00218   extends ovm_port_base #( tlm_if_base #(T,T) );
00219 
00220   local IMP m_imp;
00221  
00222   function new( string name , IMP imp );
00223     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00224     
00225     m_if = this;
00226     m_imp = imp;
00227     m_if_mask = `TLM_NONBLOCKING_GET_PEEK_MASK;
00228     m_if_name = "tlm_nonblocking_get_peek";
00229     assert( this.m_connector.add_if( m_if ) );
00230   endfunction
00231 
00232   `NONBLOCKING_GET_IMP( m_imp , T , t )
00233   `NONBLOCKING_PEEK_IMP( m_imp , T , t )
00234   
00235 endclass
00236 
00237 class ovm_get_peek_imp #( type T = int , type IMP = int )
00238   extends ovm_port_base #( tlm_if_base #(T,T) );
00239 
00240   local IMP m_imp;
00241  
00242   function new( string name , IMP imp );
00243     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00244     
00245     m_if = this;
00246     m_imp = imp;
00247     m_if_mask = `TLM_GET_PEEK_MASK;
00248     m_if_name = "tlm_get_peek";
00249     assert( this.m_connector.add_if( m_if ) );
00250   endfunction
00251 
00252   `BLOCKING_GET_IMP( m_imp , T , t )
00253   `NONBLOCKING_GET_IMP( m_imp , T , t )
00254     
00255    `BLOCKING_PEEK_IMP( m_imp , T , t )
00256   `NONBLOCKING_PEEK_IMP( m_imp , T , t )
00257   
00258 endclass
00259 
00260 //
00261 // All the master and slave imps have two modes of operation.
00262 //
00263 // The first could be described as normal but unusual. In other words
00264 // it fits the pattern of the other imps but in practise is unusual.
00265 //
00266 // This is when there is a single class ( type IMP ) that implements the
00267 // entire interface, and imp -= req_imp == rsp_imp.
00268 //
00269 // The reason this is unusual is that we do not have C++ style name
00270 // mangling in SV, so such a channel will not be able to implement both
00271 // a master and a slave interface, even if REQ != RSP
00272 //
00273 // The abnormal but more usual pattern is where two siblings implement
00274 // the request and response methods. In this case req_imp and rsp_imp
00275 // are children of imp, as is the implementation itself.
00276 //
00277 // This second pattern is used in tlm_req_rsp_channel etc.
00278 //
00279 
00280 
00281 class ovm_blocking_master_imp #( type REQ = int , type RSP = int ,
00282              type IMP = int ,
00283              type REQ_IMP = IMP ,
00284              type RSP_IMP = IMP )
00285   extends ovm_port_base #( tlm_if_base #(REQ, RSP) );
00286 
00287   local REQ_IMP m_req_imp;
00288   local RSP_IMP m_rsp_imp;
00289 
00290 
00291    function new( string name , IMP imp ,
00292        REQ_IMP req_imp = null , RSP_IMP rsp_imp = null );
00293      super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00294      if(req_imp==null) $cast(req_imp, imp);
00295      if(rsp_imp==null) $cast(rsp_imp, imp);
00296      
00297      m_if = this;
00298      m_req_imp = req_imp;
00299      m_rsp_imp = rsp_imp;
00300     m_if_mask = `TLM_BLOCKING_MASTER_MASK;
00301     m_if_name = "tlm_blocking_master";
00302     assert( this.m_connector.add_if( m_if ) );
00303   endfunction 
00304 
00305   `BLOCKING_PUT_IMP( m_req_imp , REQ , t ) // req
00306 
00307   `BLOCKING_GET_IMP( m_rsp_imp , RSP , t ) // rsp
00308   `BLOCKING_PEEK_IMP( m_rsp_imp , RSP , t ) // rsp
00309   
00310 endclass
00311 
00312 class ovm_nonblocking_master_imp #( type REQ = int , type RSP = int ,
00313                 type IMP = int ,
00314                 type REQ_IMP = IMP ,
00315                 type RSP_IMP = IMP )
00316   
00317   extends ovm_port_base #( tlm_if_base #(REQ, RSP) );
00318 
00319   local REQ_IMP m_req_imp;
00320   local RSP_IMP m_rsp_imp;
00321 
00322    function new( string name , IMP imp ,
00323        REQ_IMP req_imp = null , RSP_IMP rsp_imp = null );
00324      super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00325      if(req_imp==null) $cast(req_imp, imp);
00326      if(rsp_imp==null) $cast(rsp_imp, imp);
00327      
00328      m_if = this;
00329      m_req_imp = req_imp;
00330      m_rsp_imp = rsp_imp;
00331      
00332     m_if_mask = `TLM_NONBLOCKING_MASTER_MASK;
00333     m_if_name = "tlm_nonblocking_master";
00334     assert( this.m_connector.add_if( m_if ) );
00335   endfunction 
00336 
00337   `NONBLOCKING_PUT_IMP( m_req_imp , REQ , t ) // req
00338 
00339   `NONBLOCKING_GET_IMP( m_rsp_imp , RSP , t ) // rsp
00340   `NONBLOCKING_PEEK_IMP( m_rsp_imp , RSP , t ) // rsp
00341   
00342 endclass
00343 
00344 class ovm_master_imp #( type REQ = int , type RSP = int ,
00345          type IMP = int ,
00346          type REQ_IMP = IMP , type RSP_IMP = IMP )
00347   extends ovm_port_base #( tlm_if_base #(REQ, RSP) );
00348 
00349   local REQ_IMP m_req_imp;
00350   local RSP_IMP m_rsp_imp;
00351 
00352    function new( string name , IMP imp ,
00353        REQ_IMP req_imp = null , RSP_IMP rsp_imp = null );
00354      super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00355      if(req_imp==null) $cast(req_imp, imp);
00356      if(rsp_imp==null) $cast(rsp_imp, imp);
00357      
00358      m_if = this;
00359      m_req_imp = req_imp;
00360      m_rsp_imp = rsp_imp;
00361     m_if_mask = `TLM_MASTER_MASK;
00362     m_if_name = "tlm_master";
00363     assert( this.m_connector.add_if( m_if ) );
00364   endfunction 
00365 
00366   `BLOCKING_PUT_IMP( m_req_imp , REQ , t ) // req
00367   `NONBLOCKING_PUT_IMP( m_req_imp , REQ , t ) // req
00368 
00369   `BLOCKING_GET_IMP( m_rsp_imp , RSP , t ) // rsp
00370   `BLOCKING_PEEK_IMP( m_rsp_imp , RSP , t ) // rsp
00371   `NONBLOCKING_GET_IMP( m_rsp_imp , RSP , t ) // rsp
00372   `NONBLOCKING_PEEK_IMP( m_rsp_imp , RSP , t ) // rsp
00373    
00374 endclass
00375 
00376 class ovm_blocking_slave_imp #( type REQ = int , type RSP = int ,
00377             type IMP = int ,
00378             type REQ_IMP = IMP ,
00379             type RSP_IMP = IMP )
00380   
00381   extends ovm_port_base #( tlm_if_base #(RSP, REQ) );
00382 
00383   local REQ_IMP m_req_imp;
00384   local RSP_IMP m_rsp_imp;
00385 
00386    function new( string name , IMP imp ,
00387        REQ_IMP req_imp = null , RSP_IMP rsp_imp = null );
00388      super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00389      if(req_imp==null) $cast(req_imp, imp);
00390      if(rsp_imp==null) $cast(rsp_imp, imp);
00391      
00392      m_if = this;
00393      m_req_imp = req_imp;
00394      m_rsp_imp = rsp_imp;
00395     m_if_mask = `TLM_BLOCKING_SLAVE_MASK;
00396     m_if_name = "tlm_blocking_slave";
00397      
00398     assert( this.m_connector.add_if( m_if ) );
00399   endfunction 
00400 
00401   `BLOCKING_PUT_IMP( m_rsp_imp , RSP , t ) // rsp
00402 
00403   `BLOCKING_GET_IMP( m_req_imp , REQ , t ) // req
00404   `BLOCKING_PEEK_IMP( m_req_imp , REQ , t ) // req
00405   
00406 endclass
00407 
00408 class ovm_nonblocking_slave_imp #( type REQ = int , type RSP = int ,
00409                type IMP = int ,
00410                type REQ_IMP = IMP ,
00411                type RSP_IMP = IMP )
00412   
00413   extends ovm_port_base #( tlm_if_base #(RSP, REQ) );
00414 
00415   local REQ_IMP m_req_imp;
00416   local RSP_IMP m_rsp_imp;
00417 
00418    function new( string name , IMP imp ,
00419        REQ_IMP req_imp = null , RSP_IMP rsp_imp = null );
00420      super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00421      if(req_imp==null) $cast(req_imp, imp);
00422      if(rsp_imp==null) $cast(rsp_imp, imp);
00423      
00424      m_if = this;
00425      m_req_imp = req_imp;
00426      m_rsp_imp = rsp_imp;
00427     m_if_mask = `TLM_NONBLOCKING_SLAVE_MASK;
00428     m_if_name = "tlm_nonblocking_slave";
00429      
00430     assert( this.m_connector.add_if( m_if ) );
00431   endfunction 
00432 
00433   `NONBLOCKING_PUT_IMP( m_rsp_imp , RSP , t ) // rsp
00434 
00435   `NONBLOCKING_GET_IMP( m_req_imp , REQ , t ) // req
00436   `NONBLOCKING_PEEK_IMP( m_req_imp , REQ , t ) // req
00437   
00438 endclass
00439 
00440 class ovm_slave_imp #( type REQ = int , type RSP = int ,
00441              type IMP = int ,
00442              type REQ_IMP = IMP , type RSP_IMP = IMP )
00443   extends ovm_port_base #( tlm_if_base #(RSP, REQ) );
00444 
00445   local REQ_IMP m_req_imp;
00446   local RSP_IMP m_rsp_imp;
00447 
00448    function new( string name , IMP imp ,
00449        REQ_IMP req_imp = null , RSP_IMP rsp_imp = null );
00450      super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00451      if(req_imp==null) $cast(req_imp, imp);
00452      if(rsp_imp==null) $cast(rsp_imp, imp);
00453      
00454      m_if = this;
00455      m_req_imp = req_imp;
00456      m_rsp_imp = rsp_imp;
00457     m_if_mask = `TLM_SLAVE_MASK;
00458     m_if_name = "tlm_slave";
00459      
00460     assert( this.m_connector.add_if( m_if ) );
00461   endfunction 
00462 
00463   `BLOCKING_PUT_IMP( m_rsp_imp , RSP , t ) // rsp
00464   `NONBLOCKING_PUT_IMP( m_rsp_imp , RSP , t ) // rsp
00465 
00466   `BLOCKING_GET_IMP( m_req_imp , REQ , t ) // req
00467   `BLOCKING_PEEK_IMP( m_req_imp , REQ , t ) // req
00468   `NONBLOCKING_GET_IMP( m_req_imp , REQ , t ) // req
00469   `NONBLOCKING_PEEK_IMP( m_req_imp , REQ , t ) // req
00470    
00471 endclass
00472 
00473 class ovm_blocking_transport_imp #( type REQ = int ,
00474                                     type RSP = int , type IMP = int )
00475   extends ovm_port_base #( tlm_if_base #(REQ, RSP) );
00476 
00477   local IMP m_imp;
00478  
00479   function new( string name , IMP imp );
00480     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00481     
00482     m_if = this;
00483     m_imp = imp;
00484     m_if_mask = `TLM_BLOCKING_TRANSPORT_MASK;
00485     m_if_name = "tlm_blocking_transport";
00486     assert( this.m_connector.add_if( m_if ) );
00487   endfunction
00488 
00489   `BLOCKING_TRANSPORT_IMP( m_imp, REQ, RSP, req, rsp)
00490   
00491 endclass
00492 
00493 class ovm_nonblocking_transport_imp #( type REQ = int ,
00494                                        type RSP = int , type IMP = int )
00495   extends ovm_port_base #( tlm_if_base #(REQ, RSP) );
00496 
00497   local IMP m_imp;
00498  
00499   function new( string name , IMP imp );
00500     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00501     
00502     m_if = this;
00503     m_imp = imp;
00504     m_if_mask = `TLM_NONBLOCKING_TRANSPORT_MASK;
00505     m_if_name = "tlm_nonblocking_transport";
00506     assert( this.m_connector.add_if( m_if ) );
00507   endfunction
00508 
00509   `NONBLOCKING_TRANSPORT_IMP( m_imp, REQ, RSP, req, rsp)
00510   
00511 endclass
00512 
00513 class ovm_transport_imp #( type REQ = int ,
00514                            type RSP = int , type IMP = int )
00515   extends ovm_port_base #( tlm_if_base #(REQ, RSP) );
00516 
00517   local IMP m_imp;
00518  
00519   function new( string name , IMP imp );
00520     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00521     
00522     m_if = this;
00523     m_imp = imp;
00524     m_if_mask = `TLM_TRANSPORT_MASK;
00525     m_if_name = "tlm_transport";
00526     assert( this.m_connector.add_if( m_if ) );
00527   endfunction
00528 
00529   `BLOCKING_TRANSPORT_IMP( m_imp, REQ, RSP, req, rsp)
00530   `NONBLOCKING_TRANSPORT_IMP( m_imp, REQ, RSP, req, rsp)
00531   
00532 endclass
00533 
00534 class ovm_analysis_imp #( type T = int , type IMP = int )
00535   extends ovm_port_base #( tlm_if_base #(T,T) );
00536 
00537   local IMP m_imp;
00538  
00539   function new( string name , IMP imp );
00540     super.new( name , imp , OVM_IMPLEMENTATION , 1 , 1 );
00541     
00542     m_if = this;
00543     m_imp = imp;
00544     m_if_mask = `TLM_ANALYSIS_MASK;
00545     m_if_name = "tlm_analysis";
00546     assert( this.m_connector.add_if( m_if ) );
00547   endfunction
00548 
00549   function void write( input T t );
00550     m_imp.write( t );
00551   endfunction
00552   
00553 endclass

Intelligent Design Verification
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
Doxygen Version: 1.4.6
Mon Sep 29 14:20:12 2008
Find a documentation bug? Report bugs to: bugs.intelligentdv.com Project: DoxygenFilterSV