summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.h
diff options
context:
space:
mode:
authortgrogers <[email protected]>2019-05-19 09:35:48 -0400
committertgrogers <[email protected]>2019-05-19 09:35:48 -0400
commit206ccbe8c0f712c802f8919497ca70bff1aa6a1e (patch)
tree82ef1ef2631a0c8c32c2ce44319e96b944c52730 /src/abstract_hardware_model.h
parent8c45f47e1b683d9904956659340a394321c6682d (diff)
parent8fb484e4120a08e896f53424e9f4f46710966970 (diff)
Merge branch 'dev' of github.com:purdue-aalp/gpgpu-sim_distribution into dev
Diffstat (limited to 'src/abstract_hardware_model.h')
-rw-r--r--src/abstract_hardware_model.h52
1 files changed, 44 insertions, 8 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 28a22e0..1735c2f 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -212,7 +212,7 @@ public:
// m_num_cores_running=0;
// m_param_mem=NULL;
// }
- kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *entry );
+ kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *entry, std::map<std::string, const struct cudaArray*> nameToCudaArray, std::map<std::string, const struct textureInfo*> nameToTextureInfo);
~kernel_info_t();
void inc_running() { m_num_cores_running++; }
@@ -275,6 +275,23 @@ public:
std::list<class ptx_thread_info *> &active_threads() { return m_active_threads; }
class memory_space *get_param_memory() { return m_param_mem; }
+
+ //The following functions access texture bindings present at the kernel's launch
+
+ const struct cudaArray* get_texarray( const std::string &texname ) const
+ {
+ std::map<std::string,const struct cudaArray*>::const_iterator t=m_NameToCudaArray.find(texname);
+ assert(t != m_NameToCudaArray.end());
+ return t->second;
+ }
+
+ const struct textureInfo* get_texinfo( const std::string &texname ) const
+ {
+ std::map<std::string, const struct textureInfo*>::const_iterator t=m_NameToTextureInfo.find(texname);
+ assert(t != m_NameToTextureInfo.end());
+ return t->second;
+ }
+
private:
kernel_info_t( const kernel_info_t & ); // disable copy constructor
void operator=( const kernel_info_t & ); // disable copy operator
@@ -283,6 +300,10 @@ private:
unsigned m_uid;
static unsigned m_next_uid;
+
+ //These maps contain the snapshot of the texture mappings at kernel launch
+ std::map<std::string, const struct cudaArray*> m_NameToCudaArray;
+ std::map<std::string, const struct textureInfo*> m_NameToTextureInfo;
dim3 m_grid_dim;
dim3 m_block_dim;
@@ -365,6 +386,8 @@ struct core_config {
unsigned gpgpu_max_insn_issue_per_warp;
bool gmem_skip_L1D; // on = global memory access always skip the L1 cache
+
+ bool adaptive_volta_cache_config;
};
// bounded stack that implements simt reconvergence using pdom mechanism from MICRO'07 paper
@@ -376,7 +399,7 @@ typedef std::vector<address_type> addr_vector_t;
class simt_stack {
public:
- simt_stack( unsigned wid, unsigned warpSize);
+ simt_stack( unsigned wid, unsigned warpSize, class gpgpu_sim * gpu);
void reset();
void launch( address_type start_pc, const simt_mask_t &active_mask );
@@ -393,6 +416,7 @@ protected:
unsigned m_warp_id;
unsigned m_warp_size;
+
enum stack_entry_type {
STACK_ENTRY_TYPE_NORMAL = 0,
STACK_ENTRY_TYPE_CALL
@@ -410,6 +434,8 @@ protected:
};
std::deque<simt_stack_entry> m_stack;
+
+ class gpgpu_sim * m_gpu;
};
#define GLOBAL_HEAP_START 0xC0000000
@@ -548,6 +574,12 @@ public:
int resume_CTA;
int checkpoint_CTA_t;
int checkpoint_insn_Y;
+
+ //Move some cycle core stats here instead of being global
+ unsigned long long gpu_sim_cycle;
+ unsigned long long gpu_tot_sim_cycle;
+
+
void* gpu_malloc( size_t size );
void* gpu_mallocarray( size_t count );
void gpu_memset( size_t dst_start_addr, int c, size_t count );
@@ -580,8 +612,8 @@ public:
const struct textureInfo* get_texinfo( const std::string &texname ) const
{
- std::map<std::string, const struct textureInfo*>::const_iterator t=m_NameToTexureInfo.find(texname);
- assert(t != m_NameToTexureInfo.end());
+ std::map<std::string, const struct textureInfo*>::const_iterator t=m_NameToTextureInfo.find(texname);
+ assert(t != m_NameToTextureInfo.end());
return t->second;
}
@@ -594,6 +626,10 @@ public:
const gpgpu_functional_sim_config &get_config() const { return m_function_model_config; }
FILE* get_ptx_inst_debug_file() { return ptx_inst_debug_file; }
+
+ // These maps return the current texture mappings for the GPU at any given time.
+ std::map<std::string, const struct cudaArray*> getNameArrayMapping() {return m_NameToCudaArray;}
+ std::map<std::string, const struct textureInfo*> getNameInfoMapping() {return m_NameToTextureInfo;}
protected:
const gpgpu_functional_sim_config &m_function_model_config;
@@ -604,11 +640,11 @@ protected:
class memory_space *m_surf_mem;
unsigned long long m_dev_malloc;
-
+ // These maps contain the current texture mappings for the GPU at any given time.
std::map<std::string, std::set<const struct textureReference*> > m_NameToTextureRef;
std::map<const struct textureReference*, std::string> m_TextureRefToName;
std::map<std::string, const struct cudaArray*> m_NameToCudaArray;
- std::map<std::string, const struct textureInfo*> m_NameToTexureInfo;
+ std::map<std::string, const struct textureInfo*> m_NameToTextureInfo;
std::map<std::string, const struct textureReferenceAttr*> m_NameToAttribute;
};
@@ -808,8 +844,8 @@ public:
class mem_fetch_allocator {
public:
- virtual mem_fetch *alloc( new_addr_type addr, mem_access_type type, unsigned size, bool wr ) const = 0;
- virtual mem_fetch *alloc( const class warp_inst_t &inst, const mem_access_t &access ) const = 0;
+ virtual mem_fetch *alloc( new_addr_type addr, mem_access_type type, unsigned size, bool wr, unsigned long long cycle ) const = 0;
+ virtual mem_fetch *alloc( const class warp_inst_t &inst, const mem_access_t &access, unsigned long long cycle ) const = 0;
};
// the maximum number of destination, source, or address uarch operands in a instruction