gem5/ext/dsent/libutil/Assert.h
Nilay Vaish e8ed7b1d1b ext: add the source code for DSENT
This patch adds a tool called DSENT to the ext/ directory.  DSENT
is a tool that models power and area for on-chip networks.  The next
patch adds a script for using the tool.
2014-10-11 15:02:23 -05:00

23 lines
489 B
C

#ifndef __ASSERT_H__
#define __ASSERT_H__
#include "String.h"
#include "Exception.h"
#ifdef NDEBUG
#define ASSERT(test_value_,exception_msg_)
#else
#define ASSERT(test_value_,msg_) \
do \
{ \
if(!(test_value_)) \
{ \
const LibUtil::String& exception_msg = LibUtil::String::format("\nAt %s:%d\n", __FILE__, __LINE__) + (String)(msg_); \
throw LibUtil::Exception(exception_msg); \
} \
} while(0);
#endif
#endif // __ASSERT_H__