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/singlenet.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/intersim/singlenet.cpp (limited to 'src/intersim/singlenet.cpp') diff --git a/src/intersim/singlenet.cpp b/src/intersim/singlenet.cpp new file mode 100644 index 0000000..ec68fb4 --- /dev/null +++ b/src/intersim/singlenet.cpp @@ -0,0 +1,43 @@ +#include "booksim.hpp" +#include + +#include "singlenet.hpp" + +SingleNet::SingleNet( const Configuration &config ) : +Network( config ) +{ + _ComputeSize( config ); + _Alloc( ); + _BuildNet( config ); +} + +void SingleNet::_ComputeSize( const Configuration &config ) +{ + _sources = config.GetInt( "in_ports" ); + _dests = config.GetInt( "out_ports" ); + + _size = 1; + _channels = 0; +} + +void SingleNet::_BuildNet( const Configuration &config ) +{ + int i; + + _routers[0] = Router::NewRouter( config, this, "router", 0, + _sources, _dests ); + + for ( i = 0; i < _sources; ++i ) { + _routers[0]->AddInputChannel( &_inject[i], &_inject_cred[i] ); + } + + for ( i = 0; i < _dests; ++i ) { + _routers[0]->AddOutputChannel( &_eject[i], &_eject_cred[i] ); + } +} + +void SingleNet::Display( ) const +{ + _routers[0]->Display( ); +} + -- cgit v1.3