avm_compatibility.svh

Go to the documentation of this file.
00001 // $Id: a00211.html,v 1.1 2009/01/07 19:29:46 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 `ifndef AVM_compatibility_SVH
00022 `define AVM_compatibility_SVH
00023 
00024 typedef ovm_object          avm_transaction;
00025 typedef ovm_env                avm_env;
00026 typedef ovm_component          avm_threaded_component;
00027 typedef ovm_component          avm_named_component;
00028 typedef ovm_report_object      avm_report_client;
00029 typedef ovm_report_handler     avm_report_handler;
00030 typedef ovm_report_server      avm_report_server;
00031 typedef ovm_reporter           avm_reporter;
00032 
00033 
00034 
00035 typedef enum
00036 {
00037   MESSAGE,
00038   WARNING,
00039   ERROR,
00040   FATAL
00041 } severity;
00042 
00043 typedef bit [4:0] action;
00044 
00045 typedef enum action
00046 {
00047   NO_ACTION = 5'b00000,
00048   DISPLAY   = 5'b00001,
00049   LOG       = 5'b00010,
00050   COUNT     = 5'b00100,
00051   EXIT      = 5'b01000,
00052   CALL_HOOK = 5'b10000
00053 } action_type;
00054 
00055 
00056 // So that you can just change Avm_ to Ovm_
00057 typedef ovm_component          ovm_named_component;
00058 typedef ovm_report_object      ovm_report_client;
00059 
00060 `ifndef INCA
00061 `ifndef SVPP
00062 
00063 `define avm_to_ovm_uni(kind) \
00064 class avm_``kind``_port #(type T=int) extends ovm_``kind``_port #(T); \
00065 function new( string name, ovm_component parent, int min_size = 1, int max_size = 1 ); \
00066       super.new( name, parent, min_size, max_size ); \
00067 endfunction : new \
00068 endclass \
00069 class avm_``kind``_export #(type T=int) extends ovm_``kind``_export #(T); \
00070 function new( string name, ovm_component parent, int min_size = 1, int max_size = 1 ); \
00071       super.new( name, parent, min_size, max_size ); \
00072 endfunction : new \
00073 endclass \
00074 class avm_``kind``_imp #(type T=int,IMP=int) extends ovm_``kind``_imp #(T,IMP); \
00075 function new( string name, IMP imp); \
00076       super.new( name, imp ); \
00077 endfunction : new \
00078 endclass \
00079 
00080 `define avm_to_ovm_bidi(kind) \
00081 class avm_``kind``_port #(type REQ=int,RSP=int) extends ovm_``kind``_port #(REQ,RSP); \
00082 function new( string name, ovm_component parent, int min_size = 1, int max_size = 1 ); \
00083       super.new( name, parent, min_size, max_size ); \
00084 endfunction : new \
00085 endclass \
00086 class avm_``kind``_export #(type REQ=int,RSP=int) extends ovm_``kind``_export #(REQ,RSP); \
00087 function new( string name, ovm_component parent, int min_size = 1, int max_size = 1 ); \
00088       super.new( name, parent, min_size, max_size ); \
00089 endfunction : new \
00090 endclass \
00091 class avm_``kind``_imp #( type REQ = int , type RSP = int ,\
00092             type IMP = int ,\
00093             type REQ_IMP = IMP ,\
00094             type RSP_IMP = IMP )\
00095   extends ovm_``kind``_imp #( REQ, RSP, IMP, REQ_IMP, RSP_IMP);\
00096    function new( string name , IMP imp ,\
00097        REQ_IMP req_imp = imp , RSP_IMP rsp_imp = imp );\
00098      super.new( name , imp , req_imp, rsp_imp);\
00099   endfunction \
00100 endclass
00101 
00102 `avm_to_ovm_uni(blocking_put)
00103 `avm_to_ovm_uni(nonblocking_put)
00104 `avm_to_ovm_uni(put)
00105 
00106 `avm_to_ovm_uni(blocking_get)
00107 `avm_to_ovm_uni(nonblocking_get)
00108 `avm_to_ovm_uni(get)
00109 
00110 `avm_to_ovm_uni(blocking_peek)
00111 `avm_to_ovm_uni(nonblocking_peek)
00112 `avm_to_ovm_uni(peek)
00113 
00114 `avm_to_ovm_uni(blocking_get_peek)
00115 `avm_to_ovm_uni(nonblocking_get_peek)
00116 `avm_to_ovm_uni(get_peek)
00117 
00118 `avm_to_ovm_bidi(blocking_master)
00119 `avm_to_ovm_bidi(nonblocking_master)
00120 `avm_to_ovm_bidi(master)
00121 
00122 `avm_to_ovm_bidi(blocking_slave)
00123 `avm_to_ovm_bidi(nonblocking_slave)
00124 `avm_to_ovm_bidi(slave)
00125 
00126 // Here we don't use the avm_to_ovm macro because we inherit
00127 // avm_transport_* from ovm_blocking_transport_*.  AVM doesn't support
00128 // nonblocking ad combined transport interface, only a blocking
00129 // transport interface which is simply called "transport"
00130 
00131 class avm_transport_port #(type REQ=int,RSP=int)
00132   extends ovm_blocking_transport_port #(REQ,RSP); 
00133   function new( string name, ovm_component parent,
00134                 int min_size = 1, int max_size = 1 );
00135       super.new( name, parent, min_size, max_size );
00136   endfunction : new
00137 endclass
00138 
00139 class avm_transport_export #(type REQ=int,RSP=int)
00140   extends ovm_blocking_transport_export #(REQ,RSP);
00141   function new( string name, ovm_component parent,
00142                 int min_size = 1, int max_size = 1 );
00143       super.new( name, parent, min_size, max_size );
00144   endfunction : new
00145 endclass
00146 
00147 `endif
00148 `endif
00149 
00150 `define avm_to_ovm_component(name) \
00151 class avm_``name #(type T=int) extends ovm_``name#(T); \
00152 function new(string name , ovm_component parent = null ); \
00153       super.new( name, parent ); \
00154 endfunction : new \
00155 endclass 
00156 
00157 `define abstract_avm_to_ovm_component(name) \
00158 virtual class avm_``name #(type T=int) extends ovm_``name#(T); \
00159 function new(string name , ovm_component parent = null ); \
00160       super.new( name, parent ); \
00161 endfunction : new \
00162 endclass 
00163 
00164 
00165 // TLM channels
00166 `avm_to_ovm_component(analysis_port)
00167 `avm_to_ovm_component(analysis_export)
00168 `avm_to_ovm_component(random_stimulus)
00169 `abstract_avm_to_ovm_component(subscriber)
00170 //`avm_to_ovm_component(in_order_class_comparator)
00171 
00172 // Policies
00173 `define avm_to_ovm_policy(name) \
00174 class avm_``name #(type T=int) extends ovm_``name#(T); \
00175 endclass 
00176 
00177 `avm_to_ovm_policy(built_in_comp)
00178 `avm_to_ovm_policy(built_in_converter)
00179 `avm_to_ovm_policy(built_in_clone)
00180 `avm_to_ovm_policy(class_comp)
00181 `avm_to_ovm_policy(class_converter)
00182 `avm_to_ovm_policy(class_clone)
00183 
00184 class avm_built_in_pair #( type T1 = int, type T2 = T1 )
00185   extends ovm_built_in_pair#(T1, T2);
00186   
00187   function new( input T1 f = null , input T2 s = null );
00188     super.new(f,s);
00189   endfunction  
00190 endclass
00191 
00192 class avm_class_pair #( type T1 = int, type T2 = T1 )
00193   extends ovm_class_pair#(T1,T2);
00194 
00195   function new( input T1 f = null , input T2 s = null );
00196    super.new(f,s);
00197   endfunction
00198 endclass
00199 
00200 class avm_in_order_comparator 
00201   #( type T = int ,
00202      type comp_type = avm_built_in_comp #( T ) ,
00203      type convert = avm_built_in_converter #( T ) , 
00204      type pair_type = avm_built_in_pair #( T ) )
00205   extends ovm_in_order_comparator#(T);
00206 
00207   function new(string name, avm_named_component parent);
00208     super.new(name, parent);
00209   endfunction
00210 endclass
00211 
00212 class avm_in_order_class_comparator #( type T = int )
00213   extends ovm_in_order_comparator #( T , 
00214                                      avm_class_comp #( T ) , 
00215                                      avm_class_converter #( T ) , 
00216                                      avm_class_pair #( T, T ) );
00217   function new( string name, avm_named_component parent);
00218     super.new( name, parent );
00219   endfunction
00220   
00221 endclass : avm_in_order_class_comparator
00222 
00223 class avm_in_order_built_in_comparator #( type T = int )
00224   extends ovm_in_order_comparator #( T );
00225 
00226   function new( string name ,
00227                 ovm_component parent );
00228     super.new( name, parent );
00229   endfunction
00230 
00231 endclass : avm_in_order_built_in_comparator
00232 
00233 class avm_algorithmic_comparator #( type BEFORE = int ,
00234                                     type AFTER = int  ,
00235                                     type TRANSFORMER = int )
00236   extends ovm_algorithmic_comparator #(BEFORE,
00237                                        AFTER,
00238                                        TRANSFORMER);
00239    function new ( TRANSFORMER transformer ,
00240                 string name ,
00241                 ovm_component parent );
00242       super.new(transformer,name,parent);
00243    endfunction :  new
00244 endclass : avm_algorithmic_comparator
00245 
00246 
00247 
00248 // Provides a global reporter and a set of global reporting
00249 // functions.  These can be use in modules or in any class
00250 // not derived from avm_report_client.
00251 
00252 //ovm_reporter _global_reporter = new();
00253 
00254 function void avm_report_message(string id,
00255              string message,
00256                                  int verbosity = 300,
00257              string filename = "",
00258              int line = 0);
00259   _global_reporter.ovm_report_info(id, message, verbosity, filename, line);
00260 endfunction
00261 
00262 function void avm_report_warning(string id,
00263                                  string message,
00264                                  int verbosity = 200,
00265              string filename = "",
00266              int line = 0);
00267   _global_reporter.ovm_report_warning(id, message, verbosity, filename, line);
00268 endfunction
00269 
00270 function void avm_report_error(string id,
00271                                string message,
00272                                int verbosity = 100,
00273                 string filename = "",
00274                 int line = 0);
00275   _global_reporter.ovm_report_error(id, message, verbosity, filename, line);
00276 endfunction
00277 
00278 function void avm_report_fatal(string id,
00279                           string message,
00280                                int verbosity = 0,
00281                 string filename = "",
00282                 int line = 0);
00283   _global_reporter.ovm_report_fatal(id, message, verbosity, filename, line);
00284 endfunction
00285 
00286 class analysis_fifo #(type T = int)
00287   extends tlm_analysis_fifo #(T);
00288   function new (string name, ovm_component parent=null);
00289     super.new(name, parent);
00290   endfunction
00291 endclass
00292 
00293 class avm_transport_imp #(type REQ = int, type RSP = int, type IMP = int)
00294   extends ovm_blocking_transport_imp #(REQ, RSP, IMP);
00295   function new (string name, IMP imp);
00296     super.new(name, imp);
00297   endfunction
00298 endclass // avm_transport_imp
00299 
00300 class avm_analysis_imp #( type T = int , type IMP = int )
00301   extends ovm_analysis_imp #(T, IMP);
00302   function new( string name, IMP imp );
00303     super.new(name, imp);
00304   endfunction
00305 endclass
00306 
00307 virtual class avm_port_base #(type IF = ovm_object)
00308   extends ovm_port_base #(IF);
00309 
00310   function new( string name , ovm_component parent ,
00311         ovm_port_type_e port_type ,
00312         int min_size = 0 , int max_size = 1 );
00313     super.new(name, parent, port_type, min_size, max_size);
00314   endfunction
00315 endclass
00316 
00317 
00318 `endif
00319 

Intelligent Design Verification
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
Doxygen Version: 1.5.5
Wed Jan 7 19:27:17 2009
Find a documentation bug? Report bugs to: bugs.intelligentdv.com Project: DoxygenFilterSV