StateMachine.py (7839:9e556fb25900) StateMachine.py (7922:7532067f818e)
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 244 unchanged lines hidden (view full) ---

253 void init();
254 MessageBuffer* getMandatoryQueue() const;
255 const int & getVersion() const;
256 const std::string toString() const;
257 const std::string getName() const;
258 const MachineType getMachineType() const;
259 void stallBuffer(MessageBuffer* buf, Address addr);
260 void wakeUpBuffers(Address addr);
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 244 unchanged lines hidden (view full) ---

253 void init();
254 MessageBuffer* getMandatoryQueue() const;
255 const int & getVersion() const;
256 const std::string toString() const;
257 const std::string getName() const;
258 const MachineType getMachineType() const;
259 void stallBuffer(MessageBuffer* buf, Address addr);
260 void wakeUpBuffers(Address addr);
261 void wakeUpAllBuffers();
261 void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
262 void print(std::ostream& out) const;
263 void printConfig(std::ostream& out) const;
264 void wakeup();
265 void printStats(std::ostream& out) const;
266 void clearStats();
267 void blockOnQueue(Address addr, MessageBuffer* port);
268 void unblock(Address addr);

--- 460 unchanged lines hidden (view full) ---

729 (*(m_waiting_buffers[addr]))[in_port_rank]->reanalyzeMessages(addr);
730 }
731 }
732 delete m_waiting_buffers[addr];
733 m_waiting_buffers.erase(addr);
734}
735
736void
262 void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
263 void print(std::ostream& out) const;
264 void printConfig(std::ostream& out) const;
265 void wakeup();
266 void printStats(std::ostream& out) const;
267 void clearStats();
268 void blockOnQueue(Address addr, MessageBuffer* port);
269 void unblock(Address addr);

--- 460 unchanged lines hidden (view full) ---

730 (*(m_waiting_buffers[addr]))[in_port_rank]->reanalyzeMessages(addr);
731 }
732 }
733 delete m_waiting_buffers[addr];
734 m_waiting_buffers.erase(addr);
735}
736
737void
738$c_ident::wakeUpAllBuffers()
739{
740 //
741 // Wake up all possible buffers that could be waiting on any message.
742 //
743
744 std::vector<MsgVecType*> wokeUpMsgVecs;
745
746 for (WaitingBufType::iterator buf_iter = m_waiting_buffers.begin();
747 buf_iter != m_waiting_buffers.end();
748 ++buf_iter) {
749 for (MsgVecType::iterator vec_iter = buf_iter->second->begin();
750 vec_iter != buf_iter->second->end();
751 ++vec_iter) {
752 if (*vec_iter != NULL) {
753 (*vec_iter)->reanalyzeAllMessages();
754 }
755 }
756 wokeUpMsgVecs.push_back(buf_iter->second);
757 }
758
759 for (std::vector<MsgVecType*>::iterator wb_iter = wokeUpMsgVecs.begin();
760 wb_iter != wokeUpMsgVecs.end();
761 ++wb_iter) {
762 delete (*wb_iter);
763 }
764
765 m_waiting_buffers.clear();
766}
767
768void
737$c_ident::blockOnQueue(Address addr, MessageBuffer* port)
738{
739 m_is_blocking = true;
740 m_block_map[addr] = port;
741}
742
743void
744$c_ident::unblock(Address addr)

--- 846 unchanged lines hidden ---
769$c_ident::blockOnQueue(Address addr, MessageBuffer* port)
770{
771 m_is_blocking = true;
772 m_block_map[addr] = port;
773}
774
775void
776$c_ident::unblock(Address addr)

--- 846 unchanged lines hidden ---