00001 // $Id: a00252.html,v 1.1 2009/01/07 19:29:44 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 SVPP 00023 `ifndef INCA 00024 `define ovm_phase_type_name_decl(NAME) \ 00025 virtual function string get_type_name (); \ 00026 return `"NAME``_phase #(PARENT)`"; \ 00027 endfunction 00028 `else 00029 `define ovm_phase_type_name_decl(NAME) \ 00030 virtual function string get_type_name (); \ 00031 return `"NAME``_phase`"; \ 00032 endfunction 00033 `endif 00034 `endif 00035 00036 `define ovm_phase_func_decl(NAME,TOP_DOWN) \ 00037 class NAME``_phase #(type PARENT=int) extends ovm_phase; \ 00038 function new(); \ 00039 super.new(`"NAME`",TOP_DOWN,0); \ 00040 endfunction \ 00041 `ovm_phase_type_name_decl(NAME) \ 00042 virtual function void call_func(ovm_component parent); \ 00043 PARENT m_parent; \ 00044 super.call_func(parent); \ 00045 if($cast(m_parent,parent)) begin \ 00046 if(has_executed(parent)) begin \ 00047 parent.ovm_report_warning("PHSEXEC", { "The phase ", get_name(), \ 00048 " has already executed. Either the phase was not reset, or there", \ 00049 " there is an invalid phase alias for this phase."}); \ 00050 return; \ 00051 end \ 00052 set_executed(parent); \ 00053 m_parent.NAME(); \ 00054 end \ 00055 endfunction \ 00056 endclass 00057 00058 00059 `define ovm_phase_task_decl(NAME,TOP_DOWN) \ 00060 class NAME``_phase #(type PARENT=int) extends ovm_phase; \ 00061 function new(); \ 00062 super.new(`"NAME`",TOP_DOWN,1); \ 00063 endfunction \ 00064 `ovm_phase_type_name_decl(NAME) \ 00065 virtual task call_task(ovm_component parent); \ 00066 PARENT m_parent; \ 00067 super.call_task(parent); \ 00068 if($cast(m_parent,parent)) begin \ 00069 if(has_executed(parent)) begin \ 00070 parent.ovm_report_warning("PHSEXEC", { "The phase ", get_name(), \ 00071 " has already executed. Either the phase was not reset, or there", \ 00072 " there is an invalid phase alias for this phase."}); \ 00073 return; \ 00074 end \ 00075 set_executed(parent); \ 00076 m_parent.NAME(); \ 00077 end \ 00078 endtask \ 00079 endclass 00080 00081 00082 `define ovm_phase_func_topdown_decl(NAME) `ovm_phase_func_decl(NAME,1) 00083 `define ovm_phase_func_bottomup_decl(NAME) `ovm_phase_func_decl(NAME,0) 00084 `define ovm_phase_task_topdown_decl(NAME) `ovm_phase_task_decl(NAME,1) 00085 `define ovm_phase_task_bottomup_decl(NAME) `ovm_phase_task_decl(NAME,0) 00086
![]() 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:18 2009 |