m_in_use[network_num] = true;
}
+/*
+ * Go through all the routers, network interfaces and the interconnecting
+ * links for reading/writing all the messages.
+ */
+bool
+GarnetNetwork::functionalRead(Packet *pkt)
+{
+ for (unsigned int i = 0; i < m_router_ptr_vector.size(); i++) {
+ if (m_router_ptr_vector[i]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+
+ for (unsigned int i = 0; i < m_ni_ptr_vector.size(); ++i) {
+ if (m_ni_ptr_vector[i]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+
+ for (unsigned int i = 0; i < m_link_ptr_vector.size(); ++i) {
+ if (m_link_ptr_vector[i]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+uint32_t
+GarnetNetwork::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+
+ for (unsigned int i = 0; i < m_router_ptr_vector.size(); i++) {
+ num_functional_writes += m_router_ptr_vector[i]->functionalWrite(pkt);
+ }
+
+ for (unsigned int i = 0; i < m_ni_ptr_vector.size(); ++i) {
+ num_functional_writes += m_ni_ptr_vector[i]->functionalWrite(pkt);
+ }
+
+ for (unsigned int i = 0; i < m_link_ptr_vector.size(); ++i) {
+ num_functional_writes += m_link_ptr_vector[i]->functionalWrite(pkt);
+ }
+
+ return num_functional_writes;
+}
+
void
GarnetNetwork::printLinkStats(ostream& out) const
{
const NetDest& routing_table_entry,
bool isReconfiguration);
+ //! Function for performing a functional read. The return value
+ //! indicates if a message was found that had the required address.
+ bool functionalRead(Packet *pkt);
+
+ //! Function for performing a functional write. The return value
+ //! indicates the number of messages that were written.
+ uint32_t functionalWrite(Packet *pkt);
+
private:
void checkNetworkAllocation(NodeID id, bool ordered, int network_num,
std::string vnet_type);
}
#endif // __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_GARNET_NETWORK_HH__
-
}
}
+bool
+NetworkInterface::functionalRead(Packet *pkt)
+{
+ // Go through the internal buffers
+ for (unsigned int i = 0; i < m_ni_buffers.size(); ++i) {
+ if (m_ni_buffers[i]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+
+ // Go through the buffer between this network interface and the router
+ if (outSrcQueue->functionalRead(pkt)) {
+ return true;
+ }
+
+ return false;
+}
+
+uint32_t
+NetworkInterface::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+ for (unsigned int i = 0; i < m_ni_buffers.size(); ++i) {
+ num_functional_writes += m_ni_buffers[i]->functionalWrite(pkt);
+ }
+
+ num_functional_writes += outSrcQueue->functionalWrite(pkt);
+ return num_functional_writes;
+}
+
void
NetworkInterface::print(std::ostream& out) const
{
void print(std::ostream& out) const;
+ bool functionalRead(Packet *);
+ uint32_t functionalWrite(Packet *);
+
private:
GarnetNetwork *m_net_ptr;
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
return linkBuffer->getTopFlit();
}
+bool
+NetworkLink::functionalRead(Packet *pkt)
+{
+ return linkBuffer->functionalRead(pkt);
+}
+
+uint32_t
+NetworkLink::functionalWrite(Packet *pkt)
+{
+ return linkBuffer->functionalWrite(pkt);
+}
+
NetworkLink *
NetworkLinkParams::create()
{
m_net_ptr = net_ptr;
}
+ bool functionalRead(Packet *);
+ uint32_t functionalWrite(Packet *);
+
protected:
int m_id, m_latency;
int m_in_port, m_out_port;
}
}
+bool
+Router::functionalRead(Packet *pkt)
+{
+ // Access the buffers in the router for performing a functional read
+ for (unsigned int i = 0; i < m_router_buffers.size(); i++) {
+ for (unsigned int j = 0; j < m_router_buffers[i].size(); ++j) {
+ if (m_router_buffers[i][j]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+ }
+
+ // Access the link queues for performing a functional read
+ for (unsigned int i = 0; i < m_out_src_queue.size(); i++) {
+ if (m_out_src_queue[i]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+uint32_t
+Router::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+
+ // Access the buffers in the router for performing a functional write
+ for (unsigned int i = 0; i < m_router_buffers.size(); i++) {
+ for (unsigned int j = 0; j < m_router_buffers[i].size(); ++j) {
+ num_functional_writes +=
+ m_router_buffers[i][j]->functionalWrite(pkt);
+ }
+ }
+
+ // Access the link queues for performing a functional write
+ for (unsigned int i = 0; i < m_out_src_queue.size(); i++) {
+ num_functional_writes += m_out_src_queue[i]->functionalWrite(pkt);
+ }
+
+ return num_functional_writes;
+}
+
void
Router::print(ostream& out) const
{
m_net_ptr = net_ptr;
}
+ bool functionalRead(Packet *);
+ uint32_t functionalWrite(Packet *);
+
private:
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
GarnetNetwork *m_net_ptr;
out << "Enqueue Time=" << m_enqueue_time << " ";
out << "]";
}
+
+bool
+flit::functionalRead(Packet *pkt)
+{
+ Message *msg = m_msg_ptr.get();
+ return msg->functionalRead(pkt);
+}
+
+bool
+flit::functionalWrite(Packet *pkt)
+{
+ Message *msg = m_msg_ptr.get();
+ return msg->functionalWrite(pkt);
+}
return (n1->get_time() > n2->get_time());
}
+ bool functionalRead(Packet *pkt);
+ bool functionalWrite(Packet *pkt);
+
private:
int m_id;
int m_vnet;
out << "[flitBuffer: ";
out << m_buffer.size() << "] " << std::endl;
}
+
+bool
+flitBuffer::functionalRead(Packet *pkt)
+{
+ for (unsigned int i = 0; i < m_buffer.size(); ++i) {
+ if (m_buffer[i]->functionalRead(pkt)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+uint32_t
+flitBuffer::functionalWrite(Packet *pkt)
+{
+ uint32_t num_functional_writes = 0;
+
+ for (unsigned int i = 0; i < m_buffer.size(); ++i) {
+ if (m_buffer[i]->functionalWrite(pkt)) {
+ num_functional_writes++;
+ }
+ }
+ return num_functional_writes;
+}
void insert(flit *flt);
void print(std::ostream& out) const;
+ bool functionalRead(Packet *);
+ uint32_t functionalWrite(Packet *);
+
private:
std::vector<flit *> m_buffer;
int size, max_size;
// FIXME printing
out << "[Switch]";
}
+
bool
Switch::functionalRead(Packet *pkt)
{