source: trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h @ 138

Last change on this file since 138 was 138, checked in by rosiere, 14 years ago

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#ifndef Morpheo_ErrorMorpheo_h
2#define Morpheo_ErrorMorpheo_h
3
4/*
5 * $Id: ErrorMorpheo.h 138 2010-05-12 17:34:01Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Common/include/ToString.h"
12#include "Common/include/Translation.h"
13#include "Common/include/Message.h"
14
15#include <iostream>
16#include <exception>
17
18namespace morpheo              {
19
20#define ERRORMORPHEO(funcname,msg) ErrorMorpheo(funcname,msg,__LINE__,__FILE__)
21
22  class ErrorMorpheo : public std::exception
23  {
24    // -----[ fields ]----------------------------------------------------
25  private : std::string _msg;
26   
27    // -----[ methods ]---------------------------------------------------
28  public  :             ErrorMorpheo  ()                throw() {_msg = toString("%s ",MSG_ERROR); _msg+="Exception detected ...";}
29  public  :             ErrorMorpheo  (std::string msg) throw() {_msg = toString("%s ",MSG_ERROR); _msg+=msg;}
30  public  :             ErrorMorpheo  (std::string funcname,
31                                       std::string msg     ,
32                                       int         line    ,
33                                       std::string file    ) throw() 
34    { 
35#ifdef DEBUG
36      _msg = toString(_("%s at line %d, in file %s"),MSG_ERROR,line,file.c_str());
37      _msg = toString(_("%s <%s> %s"),MSG_ERROR,funcname.c_str(),msg.c_str());
38#else
39      _msg = toString(_("%s %s"),MSG_ERROR,msg.c_str());
40#endif
41//     msg("%s",_msg.c_str());
42    }
43  public  :             ~ErrorMorpheo (void)       throw() {}
44  public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
45
46  };
47
48//   class TestMorpheo : public std::exception
49//   {
50//     // -----[ fields ]----------------------------------------------------
51//   private : std::string _msg;
52   
53//     // -----[ methods ]---------------------------------------------------
54//   public  :             TestMorpheo   ()                throw() {_msg=_("Test error ...");}
55//   public  :             TestMorpheo   (std::string msg) throw() {_msg=msg;}
56//   public  :             ~TestMorpheo  (void)            throw() {}
57//   public  : const char* what          ()    const       throw() { return ( _msg.c_str() );}
58//   };
59
60}; // end namespace morpheo             
61
62#endif
Note: See TracBrowser for help on using the repository browser.