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/vc.hpp | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/intersim/vc.hpp (limited to 'src/intersim/vc.hpp') diff --git a/src/intersim/vc.hpp b/src/intersim/vc.hpp new file mode 100644 index 0000000..ecb8c2d --- /dev/null +++ b/src/intersim/vc.hpp @@ -0,0 +1,79 @@ +#ifndef _VC_HPP_ +#define _VC_HPP_ + +#include + +#include "flit.hpp" +#include "outputset.hpp" +#include "routefunc.hpp" +#include "config_utils.hpp" + +class VCRouter; + +class VC : public Module { +public: + enum eVCState { + idle, routing, vc_alloc, active + }; + +private: + int _size; + + queue _buffer; + + eVCState _state; + int _state_time; + + OutputSet *_route_set; + int _out_port, _out_vc; + + int _occupied_cnt; + int _total_cycles; + int _vc_alloc_cycles; + int _active_cycles; + int _idle_cycles; + + int _pri; + + void _Init( const Configuration& config, int outputs ); + + bool _watched; + +public: + VC() : Module() {} + void init( const Configuration& config, int outputs ); + VC( const Configuration& config, int outputs, + Module *parent, const string& name ); + ~VC( ); + + bool AddFlit( Flit *f ); + Flit *FrontFlit( ); + Flit *RemoveFlit( ); + + bool Empty( ) const; + + eVCState GetState( ) const; + int GetStateTime( ) const; + void SetState( eVCState s ); + + const OutputSet *GetRouteSet( ) const; + + void SetOutput( int port, int vc ); + int GetOutputPort( ) const; + int GetOutputVC( ) const; + + int GetPriority( ) const; + + void Route( tRoutingFunction rf, const Router* router, const Flit* f, int in_channel ); + + void AdvanceTime( ); + + // ==== Debug functions ==== + + void SetWatch( bool watch = true ); + bool IsWatched( ) const; + + void Display( ) const; +}; + +#endif -- cgit v1.3