diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-20 09:14:14 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-20 09:14:14 -0500 |
commit | 4b67ada89e2e47b26ad07562774ff65beb5633a5 (patch) | |
tree | a93e52d39595313eec559d9c4d9b164f76418706 /src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh | |
parent | 4f7ef51efba1c1688eadc14f628a1411512b235e (diff) | |
download | gem5-4b67ada89e2e47b26ad07562774ff65beb5633a5.tar.xz |
ruby: garnet: convert network interfaces into clocked objects
This helps in configuring the network interfaces from the python script and
these objects no longer rely on the network object for the timing information.
Diffstat (limited to 'src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh')
-rw-r--r-- | src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh index a4dd36da6..0af538bf2 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh @@ -40,16 +40,17 @@ #include "mem/ruby/network/garnet/flexible-pipeline/OutVcState.hh" #include "mem/ruby/network/garnet/NetworkHeader.hh" #include "mem/ruby/slicc_interface/Message.hh" +#include "params/GarnetNetworkInterface.hh" class NetworkMessage; class MessageBuffer; class flitBuffer; -class NetworkInterface : public FlexibleConsumer +class NetworkInterface : public ClockedObject, public FlexibleConsumer { public: - NetworkInterface(int id, int virtual_networks, - GarnetNetwork* network_ptr); + typedef GarnetNetworkInterfaceParams Params; + NetworkInterface(const Params *p); ~NetworkInterface(); @@ -62,11 +63,7 @@ class NetworkInterface : public FlexibleConsumer void grant_vc(int out_port, int vc, Cycles grant_time); void release_vc(int out_port, int vc, Cycles release_time); - bool - isBufferNotFull(int vc, int inport) - { - return true; - } + bool isBufferNotFull(int vc, int inport) { return true; } void request_vc(int in_vc, int in_port, NetDest destination, Cycles request_time); @@ -75,9 +72,11 @@ class NetworkInterface : public FlexibleConsumer bool functionalRead(Packet *); uint32_t functionalWrite(Packet *); + void init_net_ptr(GarnetNetwork* net_ptr) { m_net_ptr = net_ptr; } + private: GarnetNetwork *m_net_ptr; - int m_virtual_networks, m_num_vcs, m_vc_per_vnet; + uint32_t m_virtual_networks, m_num_vcs, m_vc_per_vnet; NodeID m_id; std::vector<OutVcState *> m_out_vc_state; |