This patch removes the WARN_* and ERROR_* from src/mem/ruby/common/Debug.hh file...
authorNilay Vaish <nilay@cs.wisc.edu>
Thu, 23 Dec 2010 05:15:24 +0000 (23:15 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Thu, 23 Dec 2010 05:15:24 +0000 (23:15 -0600)
26 files changed:
src/cpu/testers/rubytest/Check.cc
src/cpu/testers/rubytest/CheckTable.cc
src/cpu/testers/rubytest/RubyTester.cc
src/mem/protocol/RubySlicc_Util.sm
src/mem/ruby/buffers/MessageBuffer.cc
src/mem/ruby/common/Debug.hh
src/mem/ruby/common/NetDest.cc
src/mem/ruby/common/Set.cc
src/mem/ruby/network/Network.cc
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh
src/mem/ruby/slicc_interface/RubySlicc_Util.hh
src/mem/ruby/storebuffer/storebuffer.cc
src/mem/ruby/system/CacheMemory.cc
src/mem/ruby/system/PerfectCacheMemory.hh
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/tester/DeterministicDriver.cc
src/mem/ruby/tester/RaceyPseudoThread.cc
src/mem/ruby/tester/test_framework.cc
src/mem/slicc/symbols/StateMachine.py
src/mem/slicc/symbols/Type.py

index 9ace655a861716ce63ca6097f2b45c56ae1343d0..0d384b08a176ca8e3da8d7501d3bcbf4909cf627 100644 (file)
@@ -270,15 +270,13 @@ Check::performCallback(NodeID proc, SubBlock* data)
         // 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");
@@ -291,12 +289,9 @@ Check::performCallback(NodeID proc, SubBlock* data)
         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,
index 4a0c1eaddd112475680b006d95815ba62927a628..af7467148d09c0fbf13db02a51c3656b97e3f318 100644 (file)
@@ -81,7 +81,7 @@ CheckTable::addCheck(const Address& address)
 {
     if (floorLog2(CHECK_SIZE) != 0) {
         if (address.bitSelect(0, CHECK_SIZE_BITS - 1) != 0) {
-            ERROR_MSG("Check not aligned");
+            panic("Check not aligned");
         }
     }
 
index 516d6ae40971356e66f8aadcb56166f2be8c40ff..8c5aafd8980f38e59c82ad1cb2c021f96019ab75 100644 (file)
@@ -27,6 +27,7 @@
  * 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"
@@ -173,11 +174,10 @@ RubyTester::checkForDeadlock()
     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);
         }
     }
 }
index d4232650f8048e0a06556db6afca511c112e4cc3..d69be1f5f3423ddf88d0caaae20bd3baa81f5af7 100644 (file)
@@ -46,7 +46,6 @@ Time getTimeModInt(Time time, int modulus);
 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();
index 2a86f1bab68225f77e0e0f6bb1c83966abc4f7d8..b6d755b580d3bfb0c84c62d1f31a06d01bf10d01 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #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"
@@ -161,9 +162,7 @@ MessageBuffer::enqueue(MsgPtr message, Time delta)
     // 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
@@ -191,13 +190,10 @@ MessageBuffer::enqueue(MsgPtr message, Time delta)
     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;
@@ -229,9 +225,7 @@ MessageBuffer::enqueue(MsgPtr message, Time delta)
     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);
     }
 }
 
index 8a2b75de32a291ba8badbf1e8b46a79dffeb208d..4183aca4df4314b29bf1bb485cb3bb1559e3e8b4 100644 (file)
@@ -119,9 +119,6 @@ operator<<(std::ostream& out, const Debug& obj)
     return out;
 }
 
-const bool ERROR_MESSAGE_FLAG = true;
-const bool WARNING_MESSAGE_FLAG = true;
-
 #undef assert
 #define assert(EXPR) ASSERT(EXPR)
 #undef ASSERT
@@ -161,67 +158,5 @@ const bool WARNING_MESSAGE_FLAG = true;
 
 #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__
 
index dbe02b0caa51199f2ed7eacd97619e88b552c33f..657df08b2efec8341844eb64cf9b4e48dbd917a9 100644 (file)
@@ -151,7 +151,7 @@ NetDest::smallestElement() const
             }
         }
     }
-    ERROR_MSG("No smallest element of an empty set.");
+    panic("No smallest element of an empty set.");
 }
 
 MachineID
@@ -165,7 +165,7 @@ NetDest::smallestElement(MachineType machine) const
         }
     }
 
-    ERROR_MSG("No smallest element of given MachineType.");
+    panic("No smallest element of given MachineType.");
 }
 
 // Returns true iff all bits are set
index c946fec16e16101e975bab14859b93ce589402e5..e747f51594e919adb5d429e61ffc6e90e6b23731 100644 (file)
@@ -29,6 +29,7 @@
 // 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"
 
@@ -199,13 +200,11 @@ Set::smallestElement() const
                 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.");
 }
 
 /*
index 91800d5bb91e374d2816e27d3598f78780ee55dd..3e866907f0845bb3a317da4de594eef5f36feae5 100644 (file)
@@ -26,6 +26,7 @@
  * 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"
@@ -64,7 +65,7 @@ Network::MessageSizeType_to_int(MessageSizeType size_type)
 {
     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:
@@ -85,10 +86,9 @@ Network::MessageSizeType_to_int(MessageSizeType size_type)
       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*>*
index befa09407c04f457abb59224aea224e4a9961795..69fc416e6681b7223a509c9c1a6bd88fc626e55b 100644 (file)
@@ -156,7 +156,7 @@ GarnetNetwork_d::makeInLink(NodeID src, SwitchID dest,
         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
     }
 }
@@ -188,7 +188,7 @@ GarnetNetwork_d::makeOutLink(SwitchID src, NodeID dest,
                                              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
     }
 }
@@ -214,7 +214,7 @@ GarnetNetwork_d::makeInternalLink(SwitchID src, SwitchID dest,
         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
     }
 }
index 16792ef2b2451dccfa08ea6d24065959e312806a..0bcefe337b78e0af88d07f9b14c449ab04fe6125 100644 (file)
@@ -333,8 +333,7 @@ NetworkInterface_d::get_vnet(int vc)
             return i;
         }
     }
-    ERROR_MSG("Could not determine vc");
-    return -1;
+    fatal("Could not determine vc");
 }
 
 void
index 5d7dc90158b02e9bcc2ff06645b55791e48a9738..13491184c1d8b3631706ebc2ed5a15bbc2f1f566 100644 (file)
@@ -81,7 +81,7 @@ RoutingUnit_d::routeCompute(flit_d *t_flit)
     }
 
     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);
     }
 
index 17daad1de350af6dfd916a31c8a5dc58177167fb..72ea7524fb9591f25beebe39ce489de7a2f1f252 100644 (file)
@@ -211,8 +211,7 @@ SWallocator_d::get_vnet(int invc)
             return i;
         }
     }
-    ERROR_MSG("Could not determine vc");
-    return -1;
+    fatal("Could not determine vc");
 }
 
 void
index b3954e3bcb9f40f9ed6ade0024afe1d3c6dbc4ea..9148cdf9d3a15e3f7e640565135a75586516be08 100644 (file)
@@ -241,8 +241,7 @@ VCallocator_d::get_vnet(int invc)
             return i;
         }
     }
-    ERROR_MSG("Could not determine vc");
-    return -1;
+    fatal("Could not determine vc");
 }
 
 void
index 9ce02d63ed187db3086aca9c69f42d68a8f9e647..631c5ab21d54115dd1a541de2be6fb2c16af430f 100644 (file)
@@ -138,7 +138,7 @@ GarnetNetwork::makeInLink(NodeID src, SwitchID dest,
         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
     }
 }
@@ -160,7 +160,7 @@ GarnetNetwork::makeOutLink(SwitchID src, NodeID dest,
                                              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
     }
 }
@@ -178,7 +178,7 @@ GarnetNetwork::makeInternalLink(SwitchID src, SwitchID dest,
         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
     }
 
index c966670284707da22323267468dc50e622329fd7..82c95c4690ad0adc03f12374ec819f634b05c877 100644 (file)
@@ -151,8 +151,7 @@ ConvertMachToGenericMach(MachineType machType)
     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
index 24240dc525f652ea5ce5372572a30642e6b300ac..432379449b34c52200be8bbe7006ce615f85c5bc 100644 (file)
@@ -148,12 +148,6 @@ getPreviousDelayedCycles(Time t1, Time t2)
     }
 }
 
-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
index 1549e33eeb4ac91a0d16d04c7d9dcf7fa0be3ba6..25089aaf23d832dc23faae217ab8c3775dc5602a 100644 (file)
@@ -42,9 +42,7 @@ void
 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);
@@ -94,9 +92,7 @@ StoreBuffer::addToStoreBuffer(RubyRequest request)
         // 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));
@@ -144,9 +140,7 @@ StoreBuffer::handleLoad(RubyRequest 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));
@@ -165,8 +159,7 @@ StoreBuffer::checkForLoadHit(RubyRequest 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;
@@ -217,8 +210,7 @@ void
 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];
@@ -304,7 +296,7 @@ StoreBuffer::complete(uint64_t id)
         // 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);
         }
@@ -326,10 +318,10 @@ StoreBuffer::complete(uint64_t id)
 
             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) {
index 87baebd0c0dafb740af7f8c96207e9d392f033cd..e9d0d88515b2f85d9030c1150161e8662b98dfd7 100644 (file)
@@ -282,7 +282,7 @@ CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry)
             return;
         }
     }
-    ERROR_MSG("Allocate didn't find an available entry");
+    panic("Allocate didn't find an available entry");
 }
 
 void
index 823dd7071c34068c2ace2f9e18050eb784b0833d..4b81cc790d091bb12392e1382658529588448ff8 100644 (file)
@@ -123,7 +123,7 @@ inline bool
 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
@@ -166,7 +166,7 @@ template<class ENTRY>
 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
index dd30835da90c742be939dc189bb06ca7c35b8547..1a0f8a66a93afae3c0ae4b3a877f3c559fdbf649 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include "base/str.hh"
+#include "base/misc.hh"
 #include "cpu/testers/rubytest/RubyTester.hh"
 #include "mem/protocol/CacheMsg.hh"
 #include "mem/protocol/Protocol.hh"
@@ -99,14 +100,12 @@ Sequencer::wakeup()
         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();
@@ -116,14 +115,12 @@ Sequencer::wakeup()
         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();
index 8dce1c70210b00027ceb7609f2a0f5ad44a266a8..533f58e6f0e8f9b55cba203130aaee820fb04ba4 100644 (file)
@@ -32,6 +32,7 @@
  *
  */
 
+#include "base/misc.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/tester/Tester_Globals.hh"
 #include "mem/ruby/tester/DeterministicDriver.hh"
@@ -89,7 +90,7 @@ DeterministicDriver::DeterministicDriver(string generator_type, int num_completi
       m_generator_vector[i] = new DetermSeriesGETSGenerator(i, *this);
       break;
     default:
-      ERROR_MSG("Unexpected specified generator type");
+      fatal("Unexpected specified generator type");
     }
   }
 
index eaae1112fbe89724271272101cbfd22c60260ab1..cfe4078cf0de97e79ce165cd413914dc1d069bc0 100644 (file)
@@ -50,10 +50,9 @@ RaceyPseudoThread::~RaceyPseudoThread() {
 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);
   }
 }
 
@@ -123,8 +122,7 @@ void RaceyPseudoThread::wakeup() {
   case 10:
     goto L10;
   default:
-    WARN_EXPR(m_stop);
-    ERROR_MSG("RaceyPseudoThread: Bad context point!");
+    fatal("RaceyPseudoThread: Bad context point %u!", m_stop);
   }
 
   //
index 99d11887fe4eac9cc4f415a971c47ed67051a4b9..2dcace49d0d11544430fa220a4ab2d6002d2df6c 100644 (file)
@@ -34,6 +34,7 @@
 
 using namespace std;
 
+#include "base/misc.hh"
 #include "mem/ruby/tester/test_framework.hh"
 #include "mem/protocol/protocol_name.hh"
 #include "getopt.hh"
@@ -211,7 +212,7 @@ void tester_playback_trace()
   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.");
   }
 }
 
index a7ac556e10ba8b4a60e192daa414d4b1763fc857..da6bc681c9494ef8c91094b951b8fa979df4e124 100644 (file)
@@ -829,6 +829,7 @@ ${ident}_Controller::wakeup()
 // 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"
@@ -972,12 +973,9 @@ if (!%s.areNSlotsAvailable(%s))
 
         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;
 }
index cefae16aeef799eac24a73fcd26edafc5030f855..d6e156908db5e26fb07fb7d796003833e5ba8266 100644 (file)
@@ -511,6 +511,7 @@ std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj);
 #include <iostream>
 #include <string>
 
+#include "base/misc.hh"
 #include "mem/protocol/${{self.c_ident}}.hh"
 
 using namespace std;
@@ -548,8 +549,7 @@ ${{self.c_ident}}_to_string(const ${{self.c_ident}}& obj)
         # Trailer
         code('''
       default:
-        ERROR_MSG("Invalid range for type ${{self.c_ident}}");
-        return "";
+        panic("Invalid range for type ${{self.c_ident}}");
     }
 }
 
@@ -570,8 +570,7 @@ string_to_${{self.c_ident}}(const string& str)
 
         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);
     }
 }
 
@@ -613,8 +612,7 @@ ${{self.c_ident}}_base_level(const ${{self.c_ident}}& obj)
         return ${{len(self.enums)}};
 
       default:
-        ERROR_MSG("Invalid range for type ${{self.c_ident}}");
-        return -1;
+        panic("Invalid range for type ${{self.c_ident}}");
     }
 }
 
@@ -638,8 +636,7 @@ ${{self.c_ident}}_from_base_level(int type)
             # Trailer
             code('''
       default:
-        ERROR_MSG("Invalid range for type ${{self.c_ident}}");
-        return MachineType_NUM;
+        panic("Invalid range for type ${{self.c_ident}}");
     }
 }
 
@@ -666,8 +663,7 @@ ${{self.c_ident}}_base_number(const ${{self.c_ident}}& obj)
 
             code('''
       default:
-        ERROR_MSG("Invalid range for type ${{self.c_ident}}");
-        return -1;
+        panic("Invalid range for type ${{self.c_ident}}");
     }
 
     return base;
@@ -693,8 +689,7 @@ ${{self.c_ident}}_base_count(const ${{self.c_ident}}& obj)
             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}}");
     }
 }
 ''')