00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2006 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License Version 2.4 (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.systemc.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_stop_here.cpp -- Function provided for debugging purposes. 00021 This file is always compiled in debug mode, such that 00022 setting a breakpoint at this function can help locate 00023 the cause of a SystemC error or warning. 00024 00025 Original Author: Martin Janssen, Synopsys, Inc., 2001-11-14 00026 00027 *****************************************************************************/ 00028 00029 /***************************************************************************** 00030 00031 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00032 changes you are making here. 00033 00034 Name, Affiliation, Date: 00035 Description of Modification: 00036 00037 *****************************************************************************/ 00038 00039 00040 // $Log: sc_stop_here.cpp,v $ 00041 // Revision 1.1.1.1 2006/12/15 20:31:39 acg 00042 // SystemC 2.2 00043 // 00044 // Revision 1.3 2006/01/13 18:53:11 acg 00045 // Andy Goodrich: Added $Log command so that CVS comments are reproduced in 00046 // the source. 00047 // 00048 00049 #include "sysc/utils/sc_stop_here.h" 00050 00051 00052 namespace sc_core { 00053 00054 // ---------------------------------------------------------------------------- 00055 // FUNCTION : sc_interrupt_here 00056 // 00057 // Debugging aid for warning, error, and fatal reports. 00058 // This function *cannot* be inlined. 00059 // ---------------------------------------------------------------------------- 00060 00061 void 00062 sc_interrupt_here( const char* id, sc_severity severity ) 00063 { 00064 // you can set a breakpoint at some of the lines below, either to 00065 // interrupt with any severity, or to interrupt with a specific severity 00066 00067 switch( severity ) { 00068 case SC_INFO: 00069 static const char* info_id; 00070 info_id = id; 00071 break; 00072 case SC_WARNING: 00073 static const char* warning_id; 00074 warning_id = id; 00075 break; 00076 case SC_ERROR: 00077 static const char* error_id; 00078 error_id = id; 00079 break; 00080 default: 00081 case SC_FATAL: 00082 static const char* fatal_id; 00083 fatal_id = id; 00084 break; 00085 } 00086 } 00087 00088 00089 // ---------------------------------------------------------------------------- 00090 // FUNCTION : sc_stop_here 00091 // 00092 // Debugging aid for warning, error, and fatal reports. 00093 // This function *cannot* be inlined. 00094 // ---------------------------------------------------------------------------- 00095 00096 void 00097 sc_stop_here( const char* id, sc_severity severity ) 00098 { 00099 // you can set a breakpoint at some of the lines below, either to 00100 // stop with any severity, or to stop with a specific severity 00101 00102 switch( severity ) { 00103 case SC_INFO: 00104 static const char* info_id; 00105 info_id = id; 00106 break; 00107 case SC_WARNING: 00108 static const char* warning_id; 00109 warning_id = id; 00110 break; 00111 case SC_ERROR: 00112 static const char* error_id; 00113 error_id = id; 00114 break; 00115 default: 00116 case SC_FATAL: 00117 static const char* fatal_id; 00118 fatal_id = id; 00119 break; 00120 } 00121 } 00122 00123 } // namespace sc_core 00124 00125 // Taf!