From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- src/intersim/network.hpp | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/intersim/network.hpp (limited to 'src/intersim/network.hpp') diff --git a/src/intersim/network.hpp b/src/intersim/network.hpp new file mode 100644 index 0000000..601ac7a --- /dev/null +++ b/src/intersim/network.hpp @@ -0,0 +1,72 @@ +#ifndef _NETWORK_HPP_ +#define _NETWORK_HPP_ + +#include + +#include "module.hpp" +#include "flit.hpp" +#include "credit.hpp" +#include "router.hpp" +#include "module.hpp" + +#include "config_utils.hpp" + +extern int gN; +extern int gK; + +extern int gNodes; + +class Network : public Module { +protected: + + int _size; + int _sources; + int _dests; + int _channels; + + Router **_routers; + + Flit **_inject; + Credit **_inject_cred; + + Flit **_eject; + Credit **_eject_cred; + + Flit **_chan; + Credit **_chan_cred; + + int *_chan_use; + int _chan_use_cycles; + + virtual void _ComputeSize( const Configuration &config ) = 0; + virtual void _BuildNet( const Configuration &config ) = 0; + + void _Alloc( ); + +public: + Network( const Configuration &config ); + virtual ~Network( ); + + void WriteFlit( Flit *f, int source ); + Flit *ReadFlit( int dest ); + + void WriteCredit( Credit *c, int dest ); + Credit *ReadCredit( int source ); + + int NumSources( ) const; + int NumDests( ) const; + + virtual void InsertRandomFaults( const Configuration &config ); + void OutChannelFault( int r, int c, bool fault = true ); + + virtual double Capacity( ) const; + + void ReadInputs( ); + void InternalStep( ); + void WriteOutputs( ); + + void Display( ) const; +}; + +#endif + -- cgit v1.3