From ef8a5521e440baa2f86d468cdc9078f54ec7c0c0 Mon Sep 17 00:00:00 2001 From: Dongdong Li Date: Fri, 22 Nov 2013 15:38:36 -0800 Subject: Delete Intersim Code Review Issue: 113001 [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 17414] --- src/intersim/allocator.hpp | 122 --------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 src/intersim/allocator.hpp (limited to 'src/intersim/allocator.hpp') diff --git a/src/intersim/allocator.hpp b/src/intersim/allocator.hpp deleted file mode 100644 index 8d92933..0000000 --- a/src/intersim/allocator.hpp +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef _ALLOCATOR_HPP_ -#define _ALLOCATOR_HPP_ - -#include -#include - -#include "module.hpp" -#include "config_utils.hpp" - -class Allocator : public Module { -protected: - const int _inputs; - const int _outputs; - - int *_inmatch; - int *_outmatch; - - int *_outmask; - - void _ClearMatching( ); -public: - - struct sRequest { - int port; - int label; - int in_pri; - int out_pri; - }; - - Allocator( const Configuration &config, - Module *parent, const string& name, - int inputs, int outputs ); - virtual ~Allocator( ); - - virtual void Clear( ) = 0; - - virtual int ReadRequest( int in, int out ) const = 0; - virtual bool ReadRequest( sRequest &req, int in, int out ) const = 0; - - virtual void AddRequest( int in, int out, int label = 1, - int in_pri = 0, int out_pri = 0 ) = 0; - virtual void RemoveRequest( int in, int out, int label = 1 ) = 0; - - virtual void Allocate( ) = 0; - - void MaskOutput( int out, int mask = 1 ); - - int OutputAssigned( int in ) const; - int InputAssigned( int out ) const; - - virtual void PrintRequests( ) const = 0; - - static Allocator *NewAllocator( const Configuration &config, - Module *parent, const string& name, - const string &alloc_type, - int inputs, int input_speedup, - int outputs, int output_speedup ); -}; - -//================================================== -// A dense allocator stores the entire request -// matrix. -//================================================== - -class DenseAllocator : public Allocator { -protected: - sRequest **_request; - -public: - DenseAllocator( const Configuration &config, - Module *parent, const string& name, - int inputs, int outputs ); - virtual ~DenseAllocator( ); - - void Clear( ); - - int ReadRequest( int in, int out ) const; - bool ReadRequest( sRequest &req, int in, int out ) const; - - void AddRequest( int in, int out, int label = 1, - int in_pri = 0, int out_pri = 0 ); - void RemoveRequest( int in, int out, int label = 1 ); - - virtual void Allocate( ) = 0; - - void PrintRequests( ) const; -}; - -//================================================== -// A sparse allocator only stores the requests -// (allows for a more efficient implementation). -//================================================== - -class SparseAllocator : public Allocator { -protected: - list *_in_occ; - list *_out_occ; - - list *_in_req; - list *_out_req; - -public: - SparseAllocator( const Configuration &config, - Module *parent, const string& name, - int inputs, int outputs ); - virtual ~SparseAllocator( ); - - void Clear( ); - - int ReadRequest( int in, int out ) const; - bool ReadRequest( sRequest &req, int in, int out ) const; - - void AddRequest( int in, int out, int label = 1, - int in_pri = 0, int out_pri = 0 ); - void RemoveRequest( int in, int out, int label = 1 ); - - virtual void Allocate( ) = 0; - - void PrintRequests( ) const; -}; - -#endif -- cgit v1.3