From 66f0d26059ffaa09b829c0a84419936f88fd68c2 Mon Sep 17 00:00:00 2001 From: Tushar Krishna Date: Tue, 22 Jun 2010 15:36:07 -0700 Subject: style: updated garnet to match M5 coding style --- .../garnet/flexible-pipeline/NetworkInterface.hh | 88 ++++++++++++---------- 1 file changed, 49 insertions(+), 39 deletions(-) (limited to 'src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh') diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh index 01608498d..401a8bc23 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh @@ -28,8 +28,8 @@ * Authors: Niket Agarwal */ -#ifndef NET_INTERFACE_H -#define NET_INTERFACE_H +#ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_NETWORK_INTERFACE_HH__ +#define __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_NETWORK_INTERFACE_HH__ #include #include @@ -45,52 +45,62 @@ class NetworkMessage; class MessageBuffer; class flitBuffer; -class NetworkInterface : public FlexibleConsumer { -public: - NetworkInterface(int id, int virtual_networks, GarnetNetwork* network_ptr); +class NetworkInterface : public FlexibleConsumer +{ + public: + NetworkInterface(int id, int virtual_networks, + GarnetNetwork* network_ptr); - ~NetworkInterface(); + ~NetworkInterface(); - void addInPort(NetworkLink *in_link); - void addOutPort(NetworkLink *out_link); + void addInPort(NetworkLink *in_link); + void addOutPort(NetworkLink *out_link); - void wakeup(); - void addNode(std::vector &inNode, std::vector &outNode); - void grant_vc(int out_port, int vc, Time grant_time); - void release_vc(int out_port, int vc, Time release_time); - bool isBufferNotFull(int vc, int inport) - { - return true; - } - void request_vc(int in_vc, int in_port, NetDest destination, Time request_time); + void wakeup(); + void addNode(std::vector &inNode, + std::vector &outNode); + void grant_vc(int out_port, int vc, Time grant_time); + void release_vc(int out_port, int vc, Time release_time); - void printConfig(std::ostream& out) const; - void print(std::ostream& out) const; + bool + isBufferNotFull(int vc, int inport) + { + return true; + } + void request_vc(int in_vc, int in_port, NetDest destination, + Time request_time); -private: -/**************Data Members*************/ - GarnetNetwork *m_net_ptr; - int m_virtual_networks, m_num_vcs, m_vc_per_vnet; - NodeID m_id; + void printConfig(std::ostream& out) const; + void print(std::ostream& out) const; - std::vector m_out_vc_state; - std::vector m_vc_allocator; - int m_vc_round_robin; // For round robin scheduling - flitBuffer *outSrcQueue; // For modelling link contention + private: + GarnetNetwork *m_net_ptr; + int m_virtual_networks, m_num_vcs, m_vc_per_vnet; + NodeID m_id; - NetworkLink *inNetLink; - NetworkLink *outNetLink; + std::vector m_out_vc_state; + std::vector m_vc_allocator; + int m_vc_round_robin; // For round robin scheduling + flitBuffer *outSrcQueue; // For modelling link contention - // Input Flit Buffers - std::vector m_ni_buffers; // The flit buffers which will serve the Consumer + NetworkLink *inNetLink; + NetworkLink *outNetLink; - std::vector inNode_ptr; // The Message buffers that takes messages from the protocol - std::vector outNode_ptr; // The Message buffers that provides messages to the protocol + // Input Flit Buffers - bool flitisizeMessage(MsgPtr msg_ptr, int vnet); - int calculateVC(int vnet); - void scheduleOutputLink(); - void checkReschedule(); + // The flit buffers which will serve the Consumer + std::vector m_ni_buffers; + + // The Message buffers that takes messages from the protocol + std::vector inNode_ptr; + + // The Message buffers that provides messages to the protocol + std::vector outNode_ptr; + + bool flitisizeMessage(MsgPtr msg_ptr, int vnet); + int calculateVC(int vnet); + void scheduleOutputLink(); + void checkReschedule(); }; -#endif +#endif // __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_NETWORK_INTERFACE_HH__ -- cgit v1.2.3