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/module.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/intersim/module.cpp (limited to 'src/intersim/module.cpp') diff --git a/src/intersim/module.cpp b/src/intersim/module.cpp new file mode 100644 index 0000000..e0a2289 --- /dev/null +++ b/src/intersim/module.cpp @@ -0,0 +1,63 @@ +#include "booksim.hpp" +#include +#include + +#include "module.hpp" + +Module::Module( ) +{ +} + +Module::Module( Module *parent, const string& name ) +{ + SetName( parent, name ); +} + +void Module::_AddChild( Module *child ) +{ + _children.push_back( child ); +} + +void Module::SetName( Module *parent, const string& name ) +{ + _name = name; + + if ( parent ) { + parent->_AddChild( this ); + _fullname = parent->_fullname + "/" + name; + } else { + _fullname = name; + } +} + +void Module::DisplayHierarchy( int level ) const +{ + vector::const_iterator mod_iter; + + for ( int l = 0; l < level; l++ ) { + cout << " "; + } + + cout << _name << endl; + + for ( mod_iter = _children.begin( ); + mod_iter != _children.end( ); mod_iter++ ) { + (*mod_iter)->DisplayHierarchy( level + 1 ); + } +} + +void Module::Error( const string& msg ) const +{ + cout << "Error in " << _fullname << " : " << msg << endl; + exit( -1 ); +} + +void Module::Debug( const string& msg ) const +{ + cout << "Debug (" << _fullname << ") : " << msg << endl; +} + +void Module::Display( ) const +{ + cout << "Display method not implemented for " << _fullname << endl; +} -- cgit v1.3