1/* 2 * Copyright (c) 2009 Mark D. Hill and David A. Wood 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; --- 83 unchanged lines hidden (view full) --- 92 uint64_t getRequestCount() const { return m_request_count; } 93 const std::map<std::string, uint64_t>& getRequestProfileMap() const 94 { return m_requestProfileMap; } 95 96 Histogram& getDelayHist() { return m_delayHistogram; } 97 Histogram& getDelayVCHist(uint32_t index) 98 { return m_delayVCHistogram[index]; } 99 |
100 MessageBuffer *getPeerQueue(uint32_t pid) 101 { 102 std::map<uint32_t, MessageBuffer *>::iterator it = 103 peerQueueMap.find(pid); 104 assert(it != peerQueueMap.end()); 105 return (*it).second; 106 } 107 |
108 protected: 109 //! Profiles original cache requests including PUTs 110 void profileRequest(const std::string &request); 111 //! Profiles the delay associated with messages. 112 void profileMsgDelay(uint32_t virtualNetwork, Cycles delay); 113 |
114 //! Function for connecting peer controllers 115 void connectWithPeer(AbstractController *); 116 virtual void getQueuesFromPeer(AbstractController *) 117 { fatal("getQueuesFromPeer() should be called only if implemented!"); } 118 |
119 protected: 120 int m_transitions_per_cycle; 121 int m_buffer_size; 122 Cycles m_recycle_latency; 123 std::string m_name; 124 NodeID m_version; 125 Network* m_net_ptr; 126 MachineID m_machineID; 127 bool m_is_blocking; 128 std::map<Address, MessageBuffer*> m_block_map; 129 typedef std::vector<MessageBuffer*> MsgVecType; 130 typedef std::map< Address, MsgVecType* > WaitingBufType; 131 WaitingBufType m_waiting_buffers; 132 int m_max_in_port_rank; 133 int m_cur_in_port_rank; 134 int m_number_of_TBEs; 135 |
136 //! Map from physical network number to the Message Buffer. 137 std::map<uint32_t, MessageBuffer*> peerQueueMap; 138 |
139 //! Counter for the number of cycles when the transitions carried out 140 //! were equal to the maximum allowed 141 uint64_t m_fully_busy_cycles; 142 143 //! Map for couting requests of different types. The controller should 144 //! call requisite function for updating the count. 145 std::map<std::string, uint64_t> m_requestProfileMap; 146 uint64_t m_request_count; 147 148 //! Histogram for profiling delay for the messages this controller 149 //! cares for 150 Histogram m_delayHistogram; 151 std::vector<Histogram> m_delayVCHistogram; 152}; 153 154#endif // __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__ |