// Perform load/check
for (int byte_number=0; byte_number<CHECK_SIZE; byte_number++) {
if (uint8(m_value + byte_number) != data->getByte(byte_number)) {
- WARN_EXPR(proc);
- WARN_EXPR(address);
- WARN_EXPR(data);
- WARN_EXPR(byte_number);
- WARN_EXPR((int)m_value + byte_number);
- WARN_EXPR((int)data->getByte(byte_number));
- WARN_EXPR(*this);
- WARN_EXPR(g_eventQueue_ptr->getTime());
- ERROR_MSG("Action/check failure");
+ panic("Action/check failure: proc: %d address: %s data: %s "
+ "byte_number: %d m_value+byte_number: %d byte: %d %s"
+ "Time: %d\n",
+ proc, address, data, byte_number,
+ (int)m_value + byte_number,
+ (int)data->getByte(byte_number), *this,
+ g_eventQueue_ptr->getTime());
}
}
DPRINTF(RubyTest, "Action/check success\n");
pickValue();
} else {
- WARN_EXPR(*this);
- WARN_EXPR(proc);
- WARN_EXPR(data);
- WARN_EXPR(m_status);
- WARN_EXPR(g_eventQueue_ptr->getTime());
- ERROR_MSG("Unexpected TesterStatus");
+ panic("Unexpected TesterStatus: %s proc: %d data: %s m_status: %s "
+ "time: %d\n",
+ *this, proc, data, m_status, g_eventQueue_ptr->getTime());
}
DPRINTF(RubyTest, "proc: %d, Address: 0x%x\n", proc,
{
if (floorLog2(CHECK_SIZE) != 0) {
if (address.bitSelect(0, CHECK_SIZE_BITS - 1) != 0) {
- ERROR_MSG("Check not aligned");
+ panic("Check not aligned");
}
}
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "base/misc.hh"
#include "cpu/testers/rubytest/Check.hh"
#include "cpu/testers/rubytest/RubyTester.hh"
#include "mem/ruby/common/Global.hh"
for (int processor = 0; processor < size; processor++) {
if ((current_time - m_last_progress_vector[processor]) >
m_deadlock_threshold) {
- WARN_EXPR(current_time);
- WARN_EXPR(m_last_progress_vector[processor]);
- WARN_EXPR(current_time - m_last_progress_vector[processor]);
- WARN_EXPR(processor);
- ERROR_MSG("Deadlock detected.");
+ panic("Deadlock detected: current_time: %d last_progress_time: %d "
+ "difference: %d processor: %d\n",
+ current_time, m_last_progress_vector[processor],
+ current_time - m_last_progress_vector[processor], processor);
}
}
}
Time getTimePlusInt(Time addend1, int addend2);
Time getTimeMinusTime(Time t1, Time t2);
Time getPreviousDelayedCycles(Time t1, Time t2);
-void WARN_ERROR_TIME(Time time);
void procProfileCoherenceRequest(NodeID node, bool needCLB);
void dirProfileCoherenceRequest(NodeID node, bool needCLB);
bool isPerfectProtocol();
*/
#include "base/cprintf.hh"
+#include "base/misc.hh"
#include "base/stl_helpers.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/system/System.hh"
// the plus one is a kluge because of a SLICC issue
if (!m_ordering_set) {
- // WARN_EXPR(*this);
- WARN_EXPR(m_name);
- ERROR_MSG("Ordering property of this queue has not been set");
+ panic("Ordering property of %s has not been set", m_name);
}
// Calculate the arrival time of the message, that is, the first
assert(arrival_time > current_time);
if (m_strict_fifo) {
if (arrival_time < m_last_arrival_time) {
- WARN_EXPR(*this);
- WARN_EXPR(m_name);
- WARN_EXPR(current_time);
- WARN_EXPR(delta);
- WARN_EXPR(arrival_time);
- WARN_EXPR(m_last_arrival_time);
- ERROR_MSG("FIFO ordering violated");
+ panic("FIFO ordering violated: %s name: %s current time: %d "
+ "delta: %d arrival_time: %d last arrival_time: %d\n",
+ *this, m_name, current_time, delta, arrival_time,
+ m_last_arrival_time);
}
}
m_last_arrival_time = arrival_time;
if (m_consumer_ptr != NULL) {
g_eventQueue_ptr->scheduleEventAbsolute(m_consumer_ptr, arrival_time);
} else {
- WARN_EXPR(*this);
- WARN_EXPR(m_name);
- ERROR_MSG("No consumer");
+ panic("No consumer: %s name: %s\n", *this, m_name);
}
}
return out;
}
-const bool ERROR_MESSAGE_FLAG = true;
-const bool WARNING_MESSAGE_FLAG = true;
-
#undef assert
#define assert(EXPR) ASSERT(EXPR)
#undef ASSERT
#endif // NDEBUG
-#define ERROR_MSG(MESSAGE) do { \
- using namespace std; \
- if (ERROR_MESSAGE_FLAG) { \
- cerr << "Fatal Error: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": " \
- << (MESSAGE) << endl << flush; \
- (* debug_cout_ptr) << "Fatal Error: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": " \
- << (MESSAGE) << endl << flush; \
- abort(); \
- } \
-} while(0)
-
-#define WARN_MSG(MESSAGE) do { \
- using namespace std; \
- if (WARNING_MESSAGE_FLAG) { \
- cerr << "Warning: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": " \
- << (MESSAGE) << endl << flush; \
- (* debug_cout_ptr) << "Warning: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": " \
- << (MESSAGE) << endl << flush; \
- } \
-} while (0)
-
-#define WARN_EXPR(EXPR) do { \
- using namespace std; \
- if (WARNING_MESSAGE_FLAG) { \
- cerr << "Warning: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": " \
- << #EXPR << " is " \
- << (EXPR) << endl << flush; \
- (* debug_cout_ptr) << "Warning: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": " \
- << #EXPR << " is " \
- << (EXPR) << endl << flush; \
- } \
-} while (0)
-
-#define ERROR_OUT( rest... ) do { \
- using namespace std; \
- if (ERROR_MESSAGE_FLAG) { \
- cout << "error: in fn " \
- << __PRETTY_FUNCTION__ << " in " \
- << __FILE__ << ":" \
- << __LINE__ << ": "; \
- g_debug_ptr->debugMsg(rest); \
- } \
-} while (0)
-
#endif // __MEM_RUBY_COMMON_DEBUG_HH__
}
}
}
- ERROR_MSG("No smallest element of an empty set.");
+ panic("No smallest element of an empty set.");
}
MachineID
}
}
- ERROR_MSG("No smallest element of given MachineType.");
+ panic("No smallest element of given MachineType.");
}
// Returns true iff all bits are set
// modified (rewritten) 05/20/05 by Dan Gibson to accomimdate FASTER
// >32 bit set sizes
+#include "base/misc.hh"
#include "mem/ruby/common/Set.hh"
#include "mem/ruby/system/System.hh"
x = x >> 1;
}
- ERROR_MSG("No smallest element of an empty set.");
+ panic("No smallest element of an empty set.");
}
}
- ERROR_MSG("No smallest element of an empty set.");
-
- return 0;
+ panic("No smallest element of an empty set.");
}
/*
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "base/misc.hh"
#include "mem/protocol/MachineType.hh"
#include "mem/ruby/network/Network.hh"
#include "mem/ruby/network/simple/Topology.hh"
{
switch(size_type) {
case MessageSizeType_Undefined:
- ERROR_MSG("Can't convert Undefined MessageSizeType to integer");
+ panic("Can't convert Undefined MessageSizeType to integer");
break;
case MessageSizeType_Control:
case MessageSizeType_Request_Control:
case MessageSizeType_Writeback_Data:
return m_data_msg_size;
default:
- ERROR_MSG("Invalid range for type MessageSizeType");
+ panic("Invalid range for type MessageSizeType");
break;
}
- return 0;
}
const std::vector<Throttle*>*
m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
m_ni_ptr_vector[src]->addOutPort(net_link, credit_link);
} else {
- ERROR_MSG("Fatal Error:: Reconfiguration not allowed here");
+ panic("Fatal Error:: Reconfiguration not allowed here");
// do nothing
}
}
link_weight, credit_link);
m_ni_ptr_vector[dest]->addInPort(net_link, credit_link);
} else {
- ERROR_MSG("Fatal Error:: Reconfiguration not allowed here");
+ fatal("Fatal Error:: Reconfiguration not allowed here");
// do nothing
}
}
m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
link_weight, credit_link);
} else {
- ERROR_MSG("Fatal Error:: Reconfiguration not allowed here");
+ fatal("Fatal Error:: Reconfiguration not allowed here");
// do nothing
}
}
return i;
}
}
- ERROR_MSG("Could not determine vc");
- return -1;
+ fatal("Could not determine vc");
}
void
}
if (output_link == -1) {
- ERROR_MSG("Fatal Error:: No Route exists from this Router.");
+ fatal("Fatal Error:: No Route exists from this Router.");
exit(0);
}
return i;
}
}
- ERROR_MSG("Could not determine vc");
- return -1;
+ fatal("Could not determine vc");
}
void
return i;
}
}
- ERROR_MSG("Could not determine vc");
- return -1;
+ fatal("Could not determine vc");
}
void
m_router_ptr_vector[dest]->addInPort(net_link);
m_ni_ptr_vector[src]->addOutPort(net_link);
} else {
- ERROR_MSG("Fatal Error:: Reconfiguration not allowed here");
+ fatal("Fatal Error:: Reconfiguration not allowed here");
// do nothing
}
}
link_weight);
m_ni_ptr_vector[dest]->addInPort(net_link);
} else {
- ERROR_MSG("Fatal Error:: Reconfiguration not allowed here");
+ fatal("Fatal Error:: Reconfiguration not allowed here");
//do nothing
}
}
m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
link_weight);
} else {
- ERROR_MSG("Fatal Error:: Reconfiguration not allowed here");
+ fatal("Fatal Error:: Reconfiguration not allowed here");
// do nothing
}
if (machType == MachineType_Directory)
return GenericMachineType_Directory;
- ERROR_MSG("cannot convert to a GenericMachineType");
- return GenericMachineType_NULL;
+ panic("cannot convert to a GenericMachineType");
}
inline int
}
}
-inline void
-WARN_ERROR_TIME(Time time)
-{
- WARN_EXPR(time);
-}
-
// Return type for time_to_int is "Time" and not "int" so we get a
// 64-bit integer
inline Time
hit(int64_t id)
{
if (request_map.find(id) == request_map.end()) {
- ERROR_OUT("Request ID not found in the map");
- DPRINTF(RubyStorebuffer, "id: %lld\n", id);
- ASSERT(0);
+ panic("Request ID %d not found in the map\n", id);
} else {
request_map[id]->complete(id);
request_map.erase(id);
// make request to libruby
uint64_t id = libruby_issue_request(m_port, request);
if (request_map.find(id) != request_map.end()) {
- ERROR_OUT("Request ID is already in the map");
- DPRINTF(RubyStorebuffer, "id: %lld\n", id);
- ASSERT(0);
+ panic("Request ID: %d is already in the map\n", id);
} else {
request_map.insert(make_pair(id, this));
outstanding_requests.insert(make_pair(id, request));
// make request to libruby and return the id
uint64_t id = libruby_issue_request(m_port, request);
if (request_map.find(id) != request_map.end()) {
- ERROR_OUT("Request ID is already in the map");
- DPRINTF(RubyStorebuffer, "id: %lld\n", id);
- ASSERT(0);
+ panic("Request ID: %d is already in the map\n", id);
} else {
request_map.insert(make_pair(id, this));
outstanding_requests.insert(make_pair(id, request));
if (!m_use_storebuffer) {
// this function should never be called if we are not using a
// store buffer
- ERROR_OUT("checkForLoadHit called while write buffer is not in use");
- ASSERT(0);
+ panic("checkForLoadHit called while write buffer is not in use\n");
}
physical_address_t physical_address = request.paddr;
StoreBuffer::returnMatchedData(RubyRequest request)
{
if (!m_use_storebuffer) {
- ERROR_OUT("returnMatchedData called while write buffer is not in use");
- ASSERT(0);
+ panic("returnMatchedData called while write buffer is not in use\n");
}
uint8_t * data = new uint8_t[64];
// Note fastpath hits are handled like regular requests - they
// must remove the WB entry!
if (lineaddr != physical_address) {
- ERROR_OUT("error: StoreBuffer: ruby returns pa 0x%0llx "
+ warn("error: StoreBuffer: ruby returns pa 0x%0llx "
"which is not a cache line: 0x%0llx\n",
physical_address, lineaddr);
}
m_storebuffer_full = false;
} else {
- ERROR_OUT("[%d] error: StoreBuffer: at complete, address 0x%0llx "
- "not found.\n", m_id, lineaddr);
- ERROR_OUT("StoreBuffer:: complete FAILS\n");
- ASSERT(0);
+ panic("[%d] error: StoreBuffer: at complete, address 0x%0llx "
+ "not found.\n"
+ "StoreBuffer:: complete FAILS\n",
+ m_id, lineaddr);
}
} else if (type == RubyRequestType_LD) {
return;
}
}
- ERROR_MSG("Allocate didn't find an available entry");
+ panic("Allocate didn't find an available entry");
}
void
PerfectCacheMemory<ENTRY>::tryCacheAccess(const CacheMsg& msg,
bool& block_stc, ENTRY*& entry)
{
- ERROR_MSG("not implemented");
+ panic("not implemented");
}
// tests to see if an address is present in the cache
inline Address
PerfectCacheMemory<ENTRY>::cacheProbe(const Address& newAddress) const
{
- ERROR_MSG("cacheProbe called in perfect cache");
+ panic("cacheProbe called in perfect cache");
}
// looks an address up in the cache
*/
#include "base/str.hh"
+#include "base/misc.hh"
#include "cpu/testers/rubytest/RubyTester.hh"
#include "mem/protocol/CacheMsg.hh"
#include "mem/protocol/Protocol.hh"
if (current_time - request->issue_time < m_deadlock_threshold)
continue;
- WARN_MSG("Possible Deadlock detected");
- WARN_EXPR(m_version);
- WARN_EXPR(request->ruby_request.paddr);
- WARN_EXPR(m_readRequestTable.size());
- WARN_EXPR(current_time);
- WARN_EXPR(request->issue_time);
- WARN_EXPR(current_time - request->issue_time);
- ERROR_MSG("Aborting");
+ panic("Possible Deadlock detected. Aborting!\n"
+ "version: %d request.paddr: %d m_readRequestTable: %d "
+ "current time: %u issue_time: %d difference: %d\n", m_version,
+ request->ruby_request.paddr, m_readRequestTable.size(),
+ current_time, request->issue_time,
+ current_time - request->issue_time);
}
RequestTable::iterator write = m_writeRequestTable.begin();
if (current_time - request->issue_time < m_deadlock_threshold)
continue;
- WARN_MSG("Possible Deadlock detected");
- WARN_EXPR(m_version);
- WARN_EXPR(request->ruby_request.paddr);
- WARN_EXPR(current_time);
- WARN_EXPR(request->issue_time);
- WARN_EXPR(current_time - request->issue_time);
- WARN_EXPR(m_writeRequestTable.size());
- ERROR_MSG("Aborting");
+ panic("Possible Deadlock detected. Aborting!\n"
+ "version: %d request.paddr: %d m_writeRequestTable: %d "
+ "current time: %u issue_time: %d difference: %d\n", m_version,
+ request->ruby_request.paddr, m_writeRequestTable.size(),
+ current_time, request->issue_time,
+ current_time - request->issue_time);
}
total_outstanding += m_writeRequestTable.size();
*
*/
+#include "base/misc.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/tester/Tester_Globals.hh"
#include "mem/ruby/tester/DeterministicDriver.hh"
m_generator_vector[i] = new DetermSeriesGETSGenerator(i, *this);
break;
default:
- ERROR_MSG("Unexpected specified generator type");
+ fatal("Unexpected specified generator type");
}
}
void RaceyPseudoThread::checkForDeadlock() {
Time current_time = m_driver.eventQueue->getTime();
if(!m_done && (current_time - m_last_progress) > g_DEADLOCK_THRESHOLD) {
- WARN_EXPR(m_proc_id);
- WARN_EXPR(m_ic_counter);
- WARN_EXPR(m_last_progress);
- ERROR_MSG("Deadlock detected.");
+ panic("Deadlock detected: m_proc_id: %d m_ic_counter: %d "
+ "m_last_progress: %d\n",
+ m_proc_id, m_ic_counter, m_last_progress);
}
}
case 10:
goto L10;
default:
- WARN_EXPR(m_stop);
- ERROR_MSG("RaceyPseudoThread: Bad context point!");
+ fatal("RaceyPseudoThread: Bad context point %u!", m_stop);
}
//
using namespace std;
+#include "base/misc.hh"
#include "mem/ruby/tester/test_framework.hh"
#include "mem/protocol/protocol_name.hh"
#include "getopt.hh"
int read = replayer->playbackTrace(trace_filename);
cout << "(" << read << " requests read)" << endl;
if (read == 0) {
- ERROR_MSG("Zero items read from tracefile.");
+ fatal("Zero items read from tracefile.");
}
}
// Auto generated C++ code started by $__file__:$__line__
// ${ident}: ${{self.short}}
+#include "base/misc.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/protocol/${ident}_Controller.hh"
#include "mem/protocol/${ident}_State.hh"
code('''
default:
- WARN_EXPR(m_version);
- WARN_EXPR(g_eventQueue_ptr->getTime());
- WARN_EXPR(addr);
- WARN_EXPR(event);
- WARN_EXPR(state);
- ERROR_MSG(\"Invalid transition\");
+ fatal("Invalid transition\\n"
+ "version: %d time: %d addr: %s event: %s state: %s\\n",
+ m_version, g_eventQueue_ptr->getTime(), addr, event, state);
}
return TransitionResult_Valid;
}
#include <iostream>
#include <string>
+#include "base/misc.hh"
#include "mem/protocol/${{self.c_ident}}.hh"
using namespace std;
# Trailer
code('''
default:
- ERROR_MSG("Invalid range for type ${{self.c_ident}}");
- return "";
+ panic("Invalid range for type ${{self.c_ident}}");
}
}
code('''
} else {
- WARN_EXPR(str);
- ERROR_MSG("Invalid string conversion for type ${{self.c_ident}}");
+ panic("Invalid string conversion for %s, type ${{self.c_ident}}", str);
}
}
return ${{len(self.enums)}};
default:
- ERROR_MSG("Invalid range for type ${{self.c_ident}}");
- return -1;
+ panic("Invalid range for type ${{self.c_ident}}");
}
}
# Trailer
code('''
default:
- ERROR_MSG("Invalid range for type ${{self.c_ident}}");
- return MachineType_NUM;
+ panic("Invalid range for type ${{self.c_ident}}");
}
}
code('''
default:
- ERROR_MSG("Invalid range for type ${{self.c_ident}}");
- return -1;
+ panic("Invalid range for type ${{self.c_ident}}");
}
return base;
code('''
case ${{self.c_ident}}_NUM:
default:
- ERROR_MSG("Invalid range for type ${{self.c_ident}}");
- return -1;
+ panic("Invalid range for type ${{self.c_ident}}");
}
}
''')