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;

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

91 { fatal("Prefetches not implemented!");}
92
93 //! Function for collating statistics from all the controllers of this
94 //! particular type. This function should only be called from the
95 //! version 0 of this controller type.
96 virtual void collateStats()
97 {fatal("collateStats() should be overridden!");}
98
99 //! Set the message buffer with given name.
100 virtual void setNetQueue(const std::string& name, MessageBuffer *b) = 0;
101
102 public:
103 MachineID getMachineID() const { return m_machineID; }
104
105 Stats::Histogram& getDelayHist() { return m_delayHistogram; }
106 Stats::Histogram& getDelayVCHist(uint32_t index)
107 { return *(m_delayVCHistogram[index]); }
108
106 MessageBuffer *getPeerQueue(uint32_t pid)
107 {
108 std::map<uint32_t, MessageBuffer *>::iterator it =
109 peerQueueMap.find(pid);
110 assert(it != peerQueueMap.end());
111 return (*it).second;
112 }
113
109 protected:
110 //! Profiles original cache requests including PUTs
111 void profileRequest(const std::string &request);
112 //! Profiles the delay associated with messages.
113 void profileMsgDelay(uint32_t virtualNetwork, Cycles delay);
114
120 //! Function for connecting peer controllers
121 void connectWithPeer(AbstractController *);
122 virtual void getQueuesFromPeer(AbstractController *)
123 { fatal("getQueuesFromPeer() should be called only if implemented!"); }
124
115 void stallBuffer(MessageBuffer* buf, Address addr);
116 void wakeUpBuffers(Address addr);
117 void wakeUpAllBuffers(Address addr);
118 void wakeUpAllBuffers();
119
120 protected:
121 NodeID m_version;
122 MachineID m_machineID;

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

132
133 unsigned int m_in_ports;
134 unsigned int m_cur_in_port;
135 int m_number_of_TBEs;
136 int m_transitions_per_cycle;
137 unsigned int m_buffer_size;
138 Cycles m_recycle_latency;
139
150 //! Map from physical network number to the Message Buffer.
151 std::map<uint32_t, MessageBuffer*> peerQueueMap;
152
140 //! Counter for the number of cycles when the transitions carried out
141 //! were equal to the maximum allowed
142 Stats::Scalar m_fully_busy_cycles;
143
144 //! Histogram for profiling delay for the messages this controller
145 //! cares for
146 Stats::Histogram m_delayHistogram;
147 std::vector<Stats::Histogram *> m_delayVCHistogram;

--- 16 unchanged lines hidden ---