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

Last change on this file since 118 was 117, checked in by rosiere, 15 years ago

1) Platforms : add new organization for test
2) Load_Store_Unit : add array to count nb_check in store_queue
3) Issue_queue and Core_Glue : rewrite the issue network
4) Special_Register_Unit : add reset value to register CID
5) Softwares : add multicontext test
6) Softwares : add SPECINT
7) Softwares : add MiBench?
7) Read_queue : inhib access for r0
8) Change Core_Glue (network) - dont yet support priority and load balancing scheme

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