Ignore:
Timestamp:
Dec 19, 2008, 4:34:00 PM (16 years ago)
Author:
rosiere
Message:

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

Location:
trunk/IPs/systemC/processor/Morpheo/Common/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Common/src/Debug.cpp

    r88 r97  
    1111namespace morpheo {
    1212
    13 static uint32_t _debug_depth = 0;
     13#ifdef DEBUG
     14static bool       debug_initialized;
     15#endif
     16debug_verbosity_t debug;
    1417
    1518#undef  FUNCTION
    16 #define FUNCTION "debug_tab"
    17 std::string debug_tab (void)
     19#define FUNCTION "debug_init"
     20void debug_init (void)
    1821{
    19   return std::string(_debug_depth,'\t');
     22#ifdef DEBUG
     23  if (not debug_initialized)
     24    {
     25      debug = DEBUG;
     26
     27//       debug_initialized = true;
     28    }
     29#endif
    2030}
    2131
    2232#undef  FUNCTION
    23 #define FUNCTION "debug_tab_inc"
    24 void debug_tab_inc (void)
     33#define FUNCTION "debug_init"
     34void debug_init (debug_verbosity_t level)
    2535{
    26 //   _debug_depth ++;
    27 }
    28 
    29 #undef  FUNCTION
    30 #define FUNCTION "debug_tab_dec"
    31 void debug_tab_dec (void)
    32 {
    33 //   _debug_depth --;
     36#ifdef DEBUG
     37  if (not debug_initialized)
     38    {
     39      // Take min
     40      debug = (level < DEBUG)?level:DEBUG;
     41     
     42      debug_initialized = true;
     43    }
     44#endif
    3445}
    3546
  • trunk/IPs/systemC/processor/Morpheo/Common/src/Environment.cpp

    r88 r97  
    99#include "Common/include/ErrorMorpheo.h"
    1010#include "Common/include/Debug.h"
     11#include "Common/include/Message.h"
    1112#include <sys/stat.h>
    1213
  • trunk/IPs/systemC/processor/Morpheo/Common/src/Message.cpp

    r88 r97  
    1 #ifdef LOG_FILE
    21/*
    32 * $Id$
     
    1615namespace morpheo {
    1716
    18 static bool log_initialized;
    19 FILE * log_stream;
    20 
     17  static bool log_initialized;
     18  FILE * log_stream;
     19 
     20#undef  FUNCTION
     21#define FUNCTION "log"
     22  FILE * log (FILE * stream)
     23  {
     24    // if log stream is initialized, take this, else return the default stream.
     25    return (log_initialized and (log_stream!=NULL))?log_stream:stream;
     26  };
     27 
    2128#undef  FUNCTION
    2229#define FUNCTION "log_init"
    23 void log_init (void)
    24 {
    25   if (not log_initialized)
    26     {
    27       log_initialized = true;
    28 
    29       directory();
    30      
    31       std::string filename = MORPHEO_LOG+"/Morpheo_"+toString<pid_t>(getpid())+".log";
    32 
    33       log_stream = fopen (filename.c_str(), "w");
    34 
    35       if (log_stream==NULL)
    36         {
    37           fprintf(stderr,_("%s Error create log file \"%s\", take the standard output.\n"),MSG_ERROR,filename.c_str());
    38           log_stream = stdout;
    39         }
    40       else
    41         {
    42           fprintf(stdout,_("%s Create log file \"%s\".\n"),MSG_INFORMATION,filename.c_str());
    43         }
    44     }
    45 }
    46 
     30  void log_init (bool        have_file,
     31                 std::string directory,
     32                 std::string file)
     33  {
     34    if (not log_initialized)
     35      {
     36        log_initialized = true;
     37       
     38        if (have_file)
     39          {
     40            // if the file is not define, take pid.
     41            std::string filename = directory+"/Morpheo_"+((file!="")?file:toString<pid_t>(getpid()))+".log";
     42           
     43            log_stream = fopen (filename.c_str(), "w");
     44           
     45            if (log_stream==NULL)
     46              {
     47                fprintf(stderr,_("%s Error create log file \"%s\", take the standard output.\n"),MSG_ERROR,filename.c_str());
     48                log_stream = stdout;
     49              }
     50            else
     51              {
     52                fprintf(stdout,_("%s Create log file \"%s\".\n"),MSG_INFORMATION,filename.c_str());
     53              }
     54          }
     55        else
     56          {
     57            log_stream = NULL;
     58          }
     59      }
     60  }
     61 
    4762}; // end namespace morpheo
    48 #endif
Note: See TracChangeset for help on using the changeset viewer.