00001 // $Id: ovm__registry_8svh-source.html,v 1.1 2008/10/07 21:54:49 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 OVM_REGISTRY_SVH 00022 `define OVM_REGISTRY_SVH 00023 00024 class ovm_component_registry #(type T = ovm_component, 00025 string Tname = "ovm_component") 00026 extends ovm_object_wrapper; 00027 function ovm_component create_component(string name, ovm_component parent); 00028 T u; 00029 u = new(name, parent); 00030 return u; 00031 endfunction 00032 function string get_type_name(); 00033 return Tname; 00034 endfunction 00035 static function bit register_me(); 00036 ovm_component_registry #(T,Tname) w; w = new; 00037 ovm_factory::auto_register(w); 00038 return 1; 00039 endfunction 00040 static bit is_registered = register_me(); 00041 endclass 00042 00043 class ovm_object_registry #(type T = ovm_object, 00044 string Tname = "ovm_object") 00045 extends ovm_object_wrapper; 00046 function ovm_object create_object(string name); 00047 T u; 00048 u = new(); 00049 u.set_name(name); 00050 return u; 00051 endfunction 00052 function string get_type_name(); 00053 return Tname; 00054 endfunction 00055 static function bit register_me(); 00056 ovm_object_registry #(T,Tname) w; w = new; 00057 ovm_factory::auto_register(w); 00058 return 1; 00059 endfunction 00060 static bit is_registered = register_me(); 00061 endclass 00062 00063 `endif
![]() 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 |