⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhuwei_debug.h

📁 systemc源码
💻 H
字号:
/************************************************************************
 * file name:		zhuwei_debug.h 
 * description:		for debug use.
 *
 * modification history
 * --------------------
 * 2002-5, created by zhuwei <zw84611@sina.com>
 * 2003-7-1, zhuwei add COUT, for C++ use.
 */

/*
 * example:
 * [#define ZHUWEI_SINGLE_DEBUG
 * #undef ZHUWEI_DEBUG
 * #define ZHUWEI_DEBUG]
 * #include "zhuwei_debug.h"
 *
 * example:
 * COUT( << "flit_num: " << flit_num << endl);
 */
 
#ifndef _ZHUWEI_DEBUG_H_
#define _ZHUWEI_DEGUB_H_

#include "string.h"
#include "stdio.h"

#ifndef ZHUWEI_SINGLE_DEBUG
#undef ZHUWEI_DEBUG
#define ZHUWEI_DEBUG /* comment it to turn off the debug command */
#endif

#define SEPARATOR '\\'  /* dos, windows: '\\', unix like(unix, linux, vxworks): '/' */

#ifdef ZHUWEI_DEBUG

  #define PRINTF printf
  #define PRINT(a) fprintf(stderr,"->ZHUWEI_DEBUG(%s,%d):"##a,strrchr(__FILE__,SEPARATOR),__LINE__)
  #define PRINT2(a,b) fprintf(stderr,"->ZHUWEI_DEBUG(%s,%d):"##a,strrchr(__FILE__,SEPARATOR),__LINE__,b)
  #define PRINT3(a,b,c) fprintf(stderr,"->ZHUWEI_DEBUG(%s,%d):"##a,strrchr(__FILE__,SEPARATOR),__LINE__,b,c)
  
  /* logMsg() only used in VxWorks. */
  #define LOG logMsg
  #define LOG1(a) logMsg("->ZW(%s,%d):"##a,strrchr(__FILE__,SEPARATOR),__LINE__)
  #define LOG2(a,b) logMsg("->ZW(%s,%d):"##a,strrchr(__FILE__,SEPARATOR),__LINE__,b)
  #define LOG3(a,b,c) logMsg("->ZW(%s,%d):"##a,strrchr(__FILE__,SEPARATOR),__LINE__,b,c)

  /* used in C++ */
  #define COUT(a) cout a
  #define COUTL(a) cout << a << endl
  
#else

  #define PRINTF
  #define PRINT(a)
  #define PRINT2(a,b)
  #define PRINT3(a,b,c)
  #define LOG
  #define LOG1(a)
  #define LOG2(a,b)
  #define LOG3(a,b,c)
  #define COUT(a)
  #define COUTL(a)
  
#endif

#endif  /* _ZHUWEI_DEGUB_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -