00001 // $Id: ovm__extern__report__server_8svh-source.html,v 1.1 2008/10/07 21:54:27 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 OVM_EXTERN_REPORT_SERVER_SVH 00023 `define OVM_EXTERN_REPORT_SERVER_SVH 00024 00025 00026 //-------------------------------------------------------------------- 00027 // report 00028 // 00029 // add line and file info later ... 00030 // 00031 // this is the public access report function. It is not 00032 // visible to the user but is accessed via 00033 // ovm_report_info, ovm_report_warning, 00034 // ovm_report_error and ovm_report_fatal. 00035 //-------------------------------------------------------------------- 00036 function void ovm_report_server::report( 00037 ovm_severity severity, 00038 string name, 00039 string id, 00040 string message, 00041 int verbosity_level, 00042 string filename, 00043 int line, 00044 ovm_report_object client 00045 ); 00046 00047 string m; 00048 ovm_action a; 00049 OVM_FILE f; 00050 bit report_ok; 00051 ovm_report_handler rh; 00052 00053 rh = client.get_report_handler(); 00054 00055 // filter based on verbosity level 00056 00057 if(verbosity_level > rh.m_max_verbosity_level) begin 00058 return; 00059 end 00060 00061 // determine file to send report and actions to execute 00062 00063 a = rh.get_action(severity, id); 00064 if( a == OVM_NO_ACTION ) 00065 return; 00066 00067 f = rh.get_file_handle(severity, id); 00068 00069 // The hooks can do additional filtering. If the hook function 00070 // return 1 then continue processing the report. If the hook 00071 // returns 0 then skip processing the report. 00072 00073 if(a & OVM_CALL_HOOK) 00074 report_ok = rh.run_hooks(client, severity, id, 00075 message, verbosity_level, filename, line); 00076 else 00077 report_ok = 1; 00078 00079 if(report_ok) begin 00080 m = compose_message(severity, name, id, message, filename, line); 00081 process_report(severity, name, id, message, a, f, filename, 00082 line, m, verbosity_level, client); 00083 end 00084 00085 endfunction 00086 00087 00088 //-------------------------------------------------------------------- 00089 // process_report 00090 //-------------------------------------------------------------------- 00091 function void ovm_report_server::process_report( 00092 ovm_severity severity, 00093 string name, 00094 string id, 00095 string message, 00096 ovm_action action, 00097 OVM_FILE file, 00098 string filename, 00099 int line, 00100 string composed_message, 00101 int verbosity_level, 00102 ovm_report_object client 00103 ); 00104 00105 // update counts 00106 incr_severity_count(severity); 00107 incr_id_count(id); 00108 00109 if(action & OVM_DISPLAY) 00110 $display(composed_message); 00111 00112 if(action & OVM_LOG) 00113 if(file != 0 || !(action & OVM_DISPLAY)) // don't display twice 00114 $fdisplay(file, composed_message); 00115 00116 if(action & OVM_EXIT) client.die(); 00117 00118 if(action & OVM_COUNT) begin 00119 if(get_max_quit_count() != 0) begin 00120 incr_quit_count(); 00121 if(is_quit_count_reached()) begin 00122 client.die(); 00123 end 00124 end 00125 end 00126 00127 if (action & OVM_STOP) $stop; 00128 00129 endfunction 00130 00131 //-------------------------------------------------------------------- 00132 // compose_message 00133 //-------------------------------------------------------------------- 00134 function string ovm_report_server::compose_message( 00135 ovm_severity severity, 00136 string name, 00137 string id, 00138 string message, 00139 string filename, 00140 int line 00141 ); 00142 ovm_severity_type sv; 00143 string time_str; 00144 string line_str; 00145 00146 sv = ovm_severity_type'(severity); 00147 $swrite(time_str, "%0t", $time); 00148 $swrite(line_str, "%0d", line); 00149 00150 case(1) 00151 (name == "" && filename == ""): 00152 return {sv.name(), " @ ", time_str, " [", id, "] ", message}; 00153 (name != "" && filename == ""): 00154 return {sv.name(), " @ ", time_str, ": ", name, " [", id, "] ", message}; 00155 (name == "" && filename != ""): 00156 return {sv.name(), " ",filename, "(", line_str, ")", " @ ", time_str, " [", id, "] ", message}; 00157 (name != "" && filename != ""): 00158 return {sv.name(), " ", filename, "(", line_str, ")", " @ ", time_str, ": ", name, " [", id, "] ", message}; 00159 endcase // case(1) 00160 endfunction 00161 00162 `endif // OVM_EXTERN_REPORT_SERVER_SVH
![]() 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:23:29 2008 |