From 58fa2857e123a44b1633628b898847773153c047 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Wed, 22 Dec 2010 23:15:24 -0600 Subject: This patch removes the WARN_* and ERROR_* from src/mem/ruby/common/Debug.hh file. These statements have been replaced with warn(), panic() and fatal() defined in src/base/misc.hh --- src/cpu/testers/rubytest/Check.cc | 25 ++++----- src/cpu/testers/rubytest/CheckTable.cc | 2 +- src/cpu/testers/rubytest/RubyTester.cc | 10 ++-- src/mem/protocol/RubySlicc_Util.sm | 1 - src/mem/ruby/buffers/MessageBuffer.cc | 20 +++---- src/mem/ruby/common/Debug.hh | 65 ---------------------- src/mem/ruby/common/NetDest.cc | 4 +- src/mem/ruby/common/Set.cc | 7 +-- src/mem/ruby/network/Network.cc | 6 +- .../garnet/fixed-pipeline/GarnetNetwork_d.cc | 6 +- .../garnet/fixed-pipeline/NetworkInterface_d.cc | 3 +- .../network/garnet/fixed-pipeline/RoutingUnit_d.cc | 2 +- .../network/garnet/fixed-pipeline/SWallocator_d.cc | 3 +- .../network/garnet/fixed-pipeline/VCallocator_d.cc | 3 +- .../garnet/flexible-pipeline/GarnetNetwork.cc | 6 +- .../slicc_interface/RubySlicc_ComponentMapping.hh | 3 +- src/mem/ruby/slicc_interface/RubySlicc_Util.hh | 6 -- src/mem/ruby/storebuffer/storebuffer.cc | 28 ++++------ src/mem/ruby/system/CacheMemory.cc | 2 +- src/mem/ruby/system/PerfectCacheMemory.hh | 4 +- src/mem/ruby/system/Sequencer.cc | 29 +++++----- src/mem/ruby/tester/DeterministicDriver.cc | 3 +- src/mem/ruby/tester/RaceyPseudoThread.cc | 10 ++-- src/mem/ruby/tester/test_framework.cc | 3 +- src/mem/slicc/symbols/StateMachine.py | 10 ++-- src/mem/slicc/symbols/Type.py | 19 +++---- 26 files changed, 87 insertions(+), 193 deletions(-) (limited to 'src') diff --git a/src/cpu/testers/rubytest/Check.cc b/src/cpu/testers/rubytest/Check.cc index 9ace655a8..0d384b08a 100644 --- a/src/cpu/testers/rubytest/Check.cc +++ b/src/cpu/testers/rubytest/Check.cc @@ -270,15 +270,13 @@ Check::performCallback(NodeID proc, SubBlock* data) // Perform load/check for (int byte_number=0; byte_numbergetByte(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, diff --git a/src/cpu/testers/rubytest/CheckTable.cc b/src/cpu/testers/rubytest/CheckTable.cc index 4a0c1eadd..af7467148 100644 --- a/src/cpu/testers/rubytest/CheckTable.cc +++ b/src/cpu/testers/rubytest/CheckTable.cc @@ -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"); } } diff --git a/src/cpu/testers/rubytest/RubyTester.cc b/src/cpu/testers/rubytest/RubyTester.cc index 516d6ae40..8c5aafd89 100644 --- a/src/cpu/testers/rubytest/RubyTester.cc +++ b/src/cpu/testers/rubytest/RubyTester.cc @@ -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); } } } diff --git a/src/mem/protocol/RubySlicc_Util.sm b/src/mem/protocol/RubySlicc_Util.sm index d4232650f..d69be1f5f 100644 --- a/src/mem/protocol/RubySlicc_Util.sm +++ b/src/mem/protocol/RubySlicc_Util.sm @@ -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(); diff --git a/src/mem/ruby/buffers/MessageBuffer.cc b/src/mem/ruby/buffers/MessageBuffer.cc index 2a86f1bab..b6d755b58 100644 --- a/src/mem/ruby/buffers/MessageBuffer.cc +++ b/src/mem/ruby/buffers/MessageBuffer.cc @@ -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); } } diff --git a/src/mem/ruby/common/Debug.hh b/src/mem/ruby/common/Debug.hh index 8a2b75de3..4183aca4d 100644 --- a/src/mem/ruby/common/Debug.hh +++ b/src/mem/ruby/common/Debug.hh @@ -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__ diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc index dbe02b0ca..657df08b2 100644 --- a/src/mem/ruby/common/NetDest.cc +++ b/src/mem/ruby/common/NetDest.cc @@ -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 diff --git a/src/mem/ruby/common/Set.cc b/src/mem/ruby/common/Set.cc index c946fec16..e747f5159 100644 --- a/src/mem/ruby/common/Set.cc +++ b/src/mem/ruby/common/Set.cc @@ -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."); } /* diff --git a/src/mem/ruby/network/Network.cc b/src/mem/ruby/network/Network.cc index 91800d5bb..3e866907f 100644 --- a/src/mem/ruby/network/Network.cc +++ b/src/mem/ruby/network/Network.cc @@ -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* diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc index befa09407..69fc416e6 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -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 } } diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc index 16792ef2b..0bcefe337 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -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 diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc index 5d7dc9015..13491184c 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc @@ -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); } diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc index 17daad1de..72ea7524f 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc @@ -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 diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc index b3954e3bc..9148cdf9d 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc @@ -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 diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc index 9ce02d63e..631c5ab21 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc @@ -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 } diff --git a/src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh b/src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh index c96667028..82c95c469 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh +++ b/src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh @@ -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 diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh index 24240dc52..432379449 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh +++ b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh @@ -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 diff --git a/src/mem/ruby/storebuffer/storebuffer.cc b/src/mem/ruby/storebuffer/storebuffer.cc index 1549e33ee..25089aaf2 100644 --- a/src/mem/ruby/storebuffer/storebuffer.cc +++ b/src/mem/ruby/storebuffer/storebuffer.cc @@ -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) { diff --git a/src/mem/ruby/system/CacheMemory.cc b/src/mem/ruby/system/CacheMemory.cc index 87baebd0c..e9d0d8851 100644 --- a/src/mem/ruby/system/CacheMemory.cc +++ b/src/mem/ruby/system/CacheMemory.cc @@ -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 diff --git a/src/mem/ruby/system/PerfectCacheMemory.hh b/src/mem/ruby/system/PerfectCacheMemory.hh index 823dd7071..4b81cc790 100644 --- a/src/mem/ruby/system/PerfectCacheMemory.hh +++ b/src/mem/ruby/system/PerfectCacheMemory.hh @@ -123,7 +123,7 @@ inline bool PerfectCacheMemory::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 inline Address PerfectCacheMemory::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 diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index dd30835da..1a0f8a66a 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -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(); diff --git a/src/mem/ruby/tester/DeterministicDriver.cc b/src/mem/ruby/tester/DeterministicDriver.cc index 8dce1c702..533f58e6f 100644 --- a/src/mem/ruby/tester/DeterministicDriver.cc +++ b/src/mem/ruby/tester/DeterministicDriver.cc @@ -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"); } } diff --git a/src/mem/ruby/tester/RaceyPseudoThread.cc b/src/mem/ruby/tester/RaceyPseudoThread.cc index eaae1112f..cfe4078cf 100644 --- a/src/mem/ruby/tester/RaceyPseudoThread.cc +++ b/src/mem/ruby/tester/RaceyPseudoThread.cc @@ -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); } // diff --git a/src/mem/ruby/tester/test_framework.cc b/src/mem/ruby/tester/test_framework.cc index 99d11887f..2dcace49d 100644 --- a/src/mem/ruby/tester/test_framework.cc +++ b/src/mem/ruby/tester/test_framework.cc @@ -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."); } } diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index a7ac556e1..da6bc681c 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -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; } diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index cefae16ae..d6e156908 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -511,6 +511,7 @@ std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj); #include #include +#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}}"); } } ''') -- cgit v1.2.3