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/buffer_state.hpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/intersim/buffer_state.hpp (limited to 'src/intersim/buffer_state.hpp') diff --git a/src/intersim/buffer_state.hpp b/src/intersim/buffer_state.hpp new file mode 100644 index 0000000..8418f02 --- /dev/null +++ b/src/intersim/buffer_state.hpp @@ -0,0 +1,43 @@ +#ifndef _BUFFER_STATE_HPP_ +#define _BUFFER_STATE_HPP_ + +#include "module.hpp" +#include "flit.hpp" +#include "credit.hpp" +#include "config_utils.hpp" + +class BufferState : public Module { + + int _wait_for_tail_credit; + int _buf_size; + int _vcs; + + int _last_avail; + + bool *_in_use; + bool *_tail_sent; + int *_cur_occupied; + + void _Init( const Configuration& config ); + +public: + BufferState() : Module( ) {} + void init( const Configuration& config ); + BufferState( const Configuration& config, + Module *parent, const string& name ); + ~BufferState( ); + + void ProcessCredit( Credit *c ); + void SendingFlit( Flit *f ); + + void TakeBuffer( int vc = 0 ); + + bool IsFullFor( int vc = 0 ) const; + bool IsAvailableFor( int vc = 0 ) const; + + int FindAvailable( ); + + void Display( ) const; +}; + +#endif -- cgit v1.3