summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/abstract_hardware_model.h14
-rw-r--r--src/cuda-sim/cuda-sim.cc92
-rw-r--r--src/cuda-sim/instructions.cc64
-rw-r--r--src/cuda-sim/memory.h2
-rw-r--r--src/cuda-sim/ptx.l2
-rw-r--r--src/cuda-sim/ptx.y5
-rw-r--r--src/cuda-sim/ptx_ir.h4
-rw-r--r--src/cuda-sim/ptx_sim.h10
-rw-r--r--src/gpgpu-sim/cflogger.h2
-rw-r--r--src/gpgpu-sim/delayqueue.h2
-rw-r--r--src/gpgpu-sim/dram_sched.cc2
-rw-r--r--src/gpgpu-sim/dwf.h2
-rw-r--r--src/gpgpu-sim/gpu-cache.h2
-rw-r--r--src/gpgpu-sim/gpu-sim.cc4
-rw-r--r--src/gpgpu-sim/l2cache.cc1
-rw-r--r--src/gpgpu-sim/mem_fetch.h1
-rw-r--r--src/gpgpu-sim/mem_latency_stat.h2
-rw-r--r--src/gpgpu-sim/shader.cc12
-rw-r--r--src/gpgpu-sim/shader.h2
-rw-r--r--src/gpgpu-sim/stack.h2
-rw-r--r--src/gpgpu-sim/stat-tool.cc2
-rw-r--r--src/gpgpu-sim/warp_tracker.h2
-rw-r--r--src/util.h79
23 files changed, 183 insertions, 127 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 39f4b3f..7066aa6 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -1,5 +1,5 @@
-#ifndef CORE_T_INCLUDED
-#define CORE_T_INCLUDED
+#ifndef ABSTRACT_HARDWARE_MODEL_INCLUDED
+#define ABSTRACT_HARDWARE_MODEL_INCLUDED
class core_t {
public:
@@ -9,4 +9,14 @@ public:
virtual bool warp_waiting_at_barrier( unsigned warp_id ) = 0;
};
+typedef unsigned address_type;
+typedef unsigned addr_t;
+
+#define NO_OP -1
+#define ALU_OP 1000
+#define LOAD_OP 2000
+#define STORE_OP 3000
+#define BRANCH_OP 4000
+#define BARRIER_OP 5000
+
#endif
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index e2326f2..f8a8db0 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -73,7 +73,7 @@
#include "dram_callback.h"
#include <set>
#include <map>
-#include "../util.h"
+#include "../abstract_hardware_model.h"
#include "memory.h"
#include "ptx-stats.h"
@@ -293,6 +293,7 @@ ptx_instruction::ptx_instruction( int opcode,
m_hi = false;
m_lo = false;
m_uni = false;
+ m_to_option = false;
m_rounding_mode = RN_OPTION;
m_compare_op = -1;
m_saturation_mode = 0;
@@ -401,6 +402,9 @@ ptx_instruction::ptx_instruction( int opcode,
break;
case FTZ_OPTION:
break;
+ case TO_OPTION:
+ m_to_option = true;
+ break;
default:
assert(0);
@@ -587,7 +591,7 @@ int load_static_globals( symbol_table *symtab, unsigned min_gaddr, unsigned max_
return ng_bytes;
}
-int load_constants( symbol_table *symtab )
+int load_constants( symbol_table *symtab, addr_t min_gaddr )
{
printf( "GPGPU-Sim PTX: loading constants with explicit initializers... " );
fflush(stdout);
@@ -617,6 +621,7 @@ int load_constants( symbol_table *symtab )
abort();
}
unsigned addr=constant->get_address() + nbytes_written;
+ assert( addr+nbytes < min_gaddr );
g_global_mem->write(addr,nbytes,&value); // assume little endian (so u8 is the first byte in u32)
nc_bytes+=nbytes;
@@ -629,7 +634,70 @@ int load_constants( symbol_table *symtab )
return nc_bytes;
}
-unsigned long long g_dev_malloc=0x10000000; // start allocating from this address (lower values used for allocating globals in .ptx file)
+#define GLOBAL_HEAP_START 0x10000000
+ // start allocating from this address (lower values used for allocating globals in .ptx file)
+
+#define SHARED_MEM_SIZE_MAX (64*1024)
+#define LOCAL_MEM_SIZE_MAX 1024
+#define MAX_STREAMING_MULTIPROCESSORS 64
+#define MAX_THREAD_PER_SM 1024
+#define TOTAL_LOCAL_MEM_PER_SM (MAX_THREAD_PER_SM*LOCAL_MEM_SIZE_MAX)
+#define TOTAL_SHARED_MEM (MAX_STREAMING_MULTIPROCESSORS*SHARED_MEM_SIZE_MAX)
+#define TOTAL_LOCAL_MEM (MAX_STREAMING_MULTIPROCESSORS*MAX_THREAD_PER_SM*LOCAL_MEM_SIZE_MAX)
+#define SHARED_GENERIC_START (GLOBAL_HEAP_START-TOTAL_SHARED_MEM)
+#define LOCAL_GENERIC_START (SHARED_GENERIC_START-TOTAL_LOCAL_MEM)
+
+#define STATIC_ALLOC_LIMIT (GLOBAL_HEAP_START - (TOTAL_LOCAL_MEM+TOTAL_SHARED_MEM))
+
+addr_t shared_to_generic( unsigned smid, addr_t addr )
+{
+ assert( addr < SHARED_MEM_SIZE_MAX );
+ return SHARED_GENERIC_START + smid*SHARED_MEM_SIZE_MAX + addr;
+}
+
+bool isspace_shared( unsigned smid, addr_t addr )
+{
+ addr_t start = SHARED_GENERIC_START + smid*SHARED_MEM_SIZE_MAX;
+ addr_t end = SHARED_GENERIC_START + (smid+1)*SHARED_MEM_SIZE_MAX;
+ if( (addr >= end) || (addr < start) )
+ return false;
+ return true;
+}
+
+bool isspace_global( addr_t addr )
+{
+ return (addr > GLOBAL_HEAP_START) || (addr < STATIC_ALLOC_LIMIT);
+}
+
+addr_t generic_to_shared( unsigned smid, addr_t addr )
+{
+ assert(isspace_shared(smid,addr));
+ return addr - (SHARED_GENERIC_START + smid*SHARED_MEM_SIZE_MAX);
+}
+
+addr_t local_to_generic( unsigned smid, unsigned hwtid, addr_t addr )
+{
+ assert(addr < LOCAL_MEM_SIZE_MAX);
+ return LOCAL_GENERIC_START + (TOTAL_LOCAL_MEM_PER_SM * smid) + (LOCAL_MEM_SIZE_MAX * hwtid) + addr;
+}
+
+bool isspace_local( unsigned smid, unsigned hwtid, addr_t addr )
+{
+ addr_t start = LOCAL_GENERIC_START + (TOTAL_LOCAL_MEM_PER_SM * smid) + (LOCAL_MEM_SIZE_MAX * hwtid);
+ addr_t end = LOCAL_GENERIC_START + (TOTAL_LOCAL_MEM_PER_SM * smid) + (LOCAL_MEM_SIZE_MAX * (hwtid+1));
+ if( (addr >= end) || (addr < start) )
+ return false;
+ return true;
+}
+
+addr_t generic_to_local( unsigned smid, unsigned hwtid, addr_t addr )
+{
+ assert(isspace_local(smid,hwtid,addr));
+ return addr - (LOCAL_GENERIC_START + (TOTAL_LOCAL_MEM_PER_SM * smid) + (LOCAL_MEM_SIZE_MAX * hwtid));
+}
+
+
+unsigned long long g_dev_malloc=GLOBAL_HEAP_START;
void* gpgpu_ptx_sim_malloc( size_t size )
{
@@ -954,12 +1022,6 @@ void function_info::add_param_data( unsigned argn, struct gpgpu_ptx_sim_arg *arg
}
}
-int ptx_branch_taken( void *thd )
-{
- ptx_thread_info *thread = (ptx_thread_info *) thd;
- return (thread != NULL) && thread->branch_taken();
-}
-
template<int activate_level>
bool ptx_debug_exec_dump_cond(int thd_uid, addr_t pc)
{
@@ -1810,8 +1872,8 @@ void gpgpu_ptx_sim_load_gpu_kernels()
ptx_parse();
ptxinfo_in = open_ptxinfo(g_filename);
ptxinfo_parse();
- load_static_globals(g_global_symbol_table,0x10000000,0xFFFFFFFF);
- load_constants(g_global_symbol_table);
+ load_static_globals(g_global_symbol_table,STATIC_ALLOC_LIMIT,0xFFFFFFFF);
+ load_constants(g_global_symbol_table,STATIC_ALLOC_LIMIT);
} else {
if (!g_override_embedded_ptx) {
g_used_embedded_ptx_files=1;
@@ -1819,8 +1881,8 @@ void gpgpu_ptx_sim_load_gpu_kernels()
ptx_info_t *s;
for ( s=g_ptx_source_array; s!=NULL; s=s->next ) {
gpgpu_ptx_sim_load_ptx_from_string(s->str, ++source_num);
- load_static_globals(g_global_symbol_table,0x10000000,0xFFFFFFFF);
- load_constants(g_global_symbol_table);
+ load_static_globals(g_global_symbol_table,STATIC_ALLOC_LIMIT,0xFFFFFFFF);
+ load_constants(g_global_symbol_table,STATIC_ALLOC_LIMIT);
}
} else {
g_filename = NULL;
@@ -1845,8 +1907,8 @@ void gpgpu_ptx_sim_load_gpu_kernels()
ptxinfo_in = open_ptxinfo(g_filename);
ptxinfo_parse();
g_filename = NULL;
- load_static_globals(g_global_symbol_table,0x10000000,0xFFFFFFFF);
- load_constants(g_global_symbol_table);
+ load_static_globals(g_global_symbol_table,STATIC_ALLOC_LIMIT,0xFFFFFFFF);
+ load_constants(g_global_symbol_table,STATIC_ALLOC_LIMIT);
}
free(namelist);
}
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 7cdf0de..ffbcd8f 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -1326,7 +1326,41 @@ void cvt_impl( const ptx_instruction *pI, ptx_thread_info *thread )
thread->set_operand_value(dst,data);
}
-void cvta_impl( const ptx_instruction *pI, ptx_thread_info *thread ) { inst_not_implemented(pI); }
+void cvta_impl( const ptx_instruction *pI, ptx_thread_info *thread )
+{
+ ptx_reg_t data;
+
+ const operand_info &dst = pI->dst();
+ const operand_info &src1 = pI->src1();
+ unsigned space = pI->get_space();
+ bool to_non_generic = pI->is_to();
+
+ ptx_reg_t from_addr = thread->get_operand_value(src1);
+ addr_t from_addr_hw = (addr_t)from_addr.u64;
+ addr_t to_addr_hw = 0;
+ unsigned smid = thread->get_hw_sid();
+ unsigned hwtid = thread->get_hw_tid();
+
+ if( to_non_generic ) {
+ switch( space ) {
+ case SHARED_DIRECTIVE: to_addr_hw = generic_to_shared( smid, from_addr_hw ); break;
+ case LOCAL_DIRECTIVE: to_addr_hw = generic_to_local( smid, hwtid, from_addr_hw ); break;
+ case GLOBAL_DIRECTIVE: to_addr_hw = from_addr_hw; break;
+ default: abort();
+ }
+ } else {
+ switch( space ) {
+ case SHARED_DIRECTIVE: to_addr_hw = shared_to_generic( smid, from_addr_hw ); break;
+ case LOCAL_DIRECTIVE: to_addr_hw = local_to_generic( smid, hwtid, from_addr_hw ); break;
+ case GLOBAL_DIRECTIVE: to_addr_hw = from_addr_hw; break;
+ default: abort();
+ }
+ }
+
+ ptx_reg_t to_addr;
+ to_addr.u64 = to_addr_hw;
+ thread->set_operand_value(dst,to_addr);
+}
void div_impl( const ptx_instruction *pI, ptx_thread_info *thread )
{
@@ -1402,7 +1436,33 @@ void fma_impl( const ptx_instruction *pI, ptx_thread_info *thread )
mad_def(pI,thread);
}
-void isspacep_impl( const ptx_instruction *pI, ptx_thread_info *thread ) { inst_not_implemented(pI); }
+void isspacep_impl( const ptx_instruction *pI, ptx_thread_info *thread )
+{
+ ptx_reg_t a;
+ bool t=false;
+
+ const operand_info &dst = pI->dst();
+ const operand_info &src1 = pI->src1();
+ unsigned space = pI->get_space();
+
+ a = thread->get_operand_value(src1);
+ addr_t addr = (addr_t)a.u64;
+ unsigned smid = thread->get_hw_sid();
+ unsigned hwtid = thread->get_hw_tid();
+
+ switch( space ) {
+ case SHARED_DIRECTIVE: t = isspace_shared( smid, addr );
+ case LOCAL_DIRECTIVE: t = isspace_local( smid, hwtid, addr );
+ case GLOBAL_DIRECTIVE: t = isspace_global( addr );
+ default: abort();
+ }
+
+ ptx_reg_t p;
+ p.pred = t?1:0;
+
+ thread->set_operand_value(dst,p);
+}
+
void ld_impl( const ptx_instruction *pI, ptx_thread_info *thread )
{
diff --git a/src/cuda-sim/memory.h b/src/cuda-sim/memory.h
index 6eebcf4..1ea3efe 100644
--- a/src/cuda-sim/memory.h
+++ b/src/cuda-sim/memory.h
@@ -84,7 +84,7 @@
#include <assert.h>
#include <string.h>
#include <string>
-#include "../util.h"
+#include "../abstract_hardware_model.h"
typedef address_type mem_addr_t;
diff --git a/src/cuda-sim/ptx.l b/src/cuda-sim/ptx.l
index 9e45bc3..4711470 100644
--- a/src/cuda-sim/ptx.l
+++ b/src/cuda-sim/ptx.l
@@ -305,6 +305,8 @@ xor TC; ptx_lval.int_value = XOR_OP; return OPCODE;
\.gl TC; return GLOBAL_OPTION;
\.cta TC; return CTA_OPTION;
+\.to TC; return TO_OPTION;
+
\.and TC; return ATOMIC_AND;
\.or TC; return ATOMIC_OR;
\.xor TC; return ATOMIC_XOR;
diff --git a/src/cuda-sim/ptx.y b/src/cuda-sim/ptx.y
index 4f1502a..7b4c17a 100644
--- a/src/cuda-sim/ptx.y
+++ b/src/cuda-sim/ptx.y
@@ -195,6 +195,7 @@
%token ALL_OPTION
%token GLOBAL_OPTION
%token CTA_OPTION
+%token TO_OPTION
%type <int_value> function_decl_header
%type <ptr_value> function_decl
@@ -384,7 +385,9 @@ option: type_spec
| FTZ_OPTION { add_option(FTZ_OPTION); }
| APPROX_OPTION { add_option(APPROX_OPTION); }
| FULL_OPTION { add_option(FULL_OPTION); }
- | atomic_operation_spec ;
+ | atomic_operation_spec
+ | TO_OPTION { add_option(TO_OPTION); }
+ ;
atomic_operation_spec: ATOMIC_AND { add_option(ATOMIC_AND); }
| ATOMIC_OR { add_option(ATOMIC_OR); }
diff --git a/src/cuda-sim/ptx_ir.h b/src/cuda-sim/ptx_ir.h
index 67b274c..3f2080b 100644
--- a/src/cuda-sim/ptx_ir.h
+++ b/src/cuda-sim/ptx_ir.h
@@ -78,7 +78,7 @@
#include "ptx.tab.h"
#include "ptx_sim.h"
#include "dram_callback.h"
- #include "../util.h"
+ #include "../abstract_hardware_model.h"
#include "memory.h"
@@ -807,6 +807,7 @@ public:
bool is_lo() const { return m_lo;}
bool is_wide() const { return m_wide;}
bool is_uni() const { return m_uni;}
+ bool is_to() const { return m_to_option; }
unsigned rounding_mode() const { return m_rounding_mode;}
unsigned saturation_mode() const { return m_saturation_mode;}
unsigned dimension() const { return m_geom_spec;}
@@ -836,6 +837,7 @@ private:
bool m_hi;
bool m_lo;
bool m_uni; //if branch instruction, this evaluates to true for uniform branches (ie jumps)
+ bool m_to_option;
unsigned m_rounding_mode;
unsigned m_compare_op;
unsigned m_saturation_mode;
diff --git a/src/cuda-sim/ptx_sim.h b/src/cuda-sim/ptx_sim.h
index 17eb250..b4a78c8 100644
--- a/src/cuda-sim/ptx_sim.h
+++ b/src/cuda-sim/ptx_sim.h
@@ -68,10 +68,8 @@
#include <stdlib.h>
#include "dram_callback.h"
-#include "../util.h"
#include "../abstract_hardware_model.h"
-typedef address_type addr_t;
struct dim3 {
unsigned int x, y, z;
@@ -450,6 +448,14 @@ private:
unsigned type_decode( unsigned type, size_t &size, int &t );
+addr_t generic_to_local( unsigned smid, unsigned hwtid, addr_t addr );
+addr_t generic_to_shared( unsigned smid, addr_t addr );
+addr_t local_to_generic( unsigned smid, unsigned hwtid, addr_t addr );
+addr_t shared_to_generic( unsigned smid, addr_t addr );
+bool isspace_local( unsigned smid, unsigned hwtid, addr_t addr );
+bool isspace_shared( unsigned smid, addr_t addr );
+bool isspace_global( addr_t addr );
+
#endif
#define MAX_REG_OPERANDS 8
diff --git a/src/gpgpu-sim/cflogger.h b/src/gpgpu-sim/cflogger.h
index bdf57e5..2afe732 100644
--- a/src/gpgpu-sim/cflogger.h
+++ b/src/gpgpu-sim/cflogger.h
@@ -66,6 +66,8 @@
#ifndef CFLOGGER_H
#define CFLOGGER_H
+#include "../abstract_hardware_model.h"
+
void try_snap_shot (unsigned long long current_cycle);
void set_spill_interval (unsigned long long interval);
void spill_log_to_file (FILE *fout, int final, unsigned long long current_cycle);
diff --git a/src/gpgpu-sim/delayqueue.h b/src/gpgpu-sim/delayqueue.h
index baa3892..a8d6fc1 100644
--- a/src/gpgpu-sim/delayqueue.h
+++ b/src/gpgpu-sim/delayqueue.h
@@ -70,8 +70,6 @@
#ifndef DELAYQUEUE_H
#define DELAYQUEUE_H
-#include "../util.h"
-
typedef struct delay_data_t delay_data;
struct delay_data_t {
void *data;
diff --git a/src/gpgpu-sim/dram_sched.cc b/src/gpgpu-sim/dram_sched.cc
index 24b518f..f6fdeca 100644
--- a/src/gpgpu-sim/dram_sched.cc
+++ b/src/gpgpu-sim/dram_sched.cc
@@ -67,7 +67,7 @@
#include "dram_sched.h"
#include "gpu-misc.h"
#include "gpu-sim.h"
-#include "../util.h"
+#include "../abstract_hardware_model.h"
extern unsigned long long gpu_sim_cycle;
extern signed long long gpu_tot_sim_cycle;
diff --git a/src/gpgpu-sim/dwf.h b/src/gpgpu-sim/dwf.h
index 6328f1a..9771af5 100644
--- a/src/gpgpu-sim/dwf.h
+++ b/src/gpgpu-sim/dwf.h
@@ -78,7 +78,7 @@
#endif
-#include "../util.h"
+#include "../abstract_hardware_model.h"
extern unsigned *acc_dyn_pcs;
diff --git a/src/gpgpu-sim/gpu-cache.h b/src/gpgpu-sim/gpu-cache.h
index e82ad05..cdb3414 100644
--- a/src/gpgpu-sim/gpu-cache.h
+++ b/src/gpgpu-sim/gpu-cache.h
@@ -66,7 +66,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "../util.h"
+#include "../abstract_hardware_model.h"
#ifndef GPU_CACHE_H
#define GPU_CACHE_H
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 6ae7430..d77d1e0 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -168,7 +168,7 @@ char *gpgpu_cache_dl2_opt;
extern int gpgpu_l2_readoverwrite;
int gpgpu_partial_write_mask = 0;
-int gpgpu_perfect_mem = FALSE;
+bool gpgpu_perfect_mem = false;
char *gpgpu_shader_core_pipeline_opt;
extern unsigned int *requests_by_warp;
unsigned int gpgpu_dram_buswidth = 4;
@@ -258,7 +258,7 @@ extern unsigned int warp_size;
extern int pipe_simd_width;
extern unsigned int gpgpu_dwf_heuristic;
extern unsigned int gpgpu_dwf_regbk;
-int gpgpu_reg_bankconflict = FALSE;
+bool gpgpu_reg_bankconflict = false;
extern int gpgpu_shmem_port_per_bank;
extern int gpgpu_cache_port_per_bank;
extern int gpgpu_const_port_per_bank;
diff --git a/src/gpgpu-sim/l2cache.cc b/src/gpgpu-sim/l2cache.cc
index aef837b..03a6a25 100644
--- a/src/gpgpu-sim/l2cache.cc
+++ b/src/gpgpu-sim/l2cache.cc
@@ -13,6 +13,7 @@
#include "histogram.h"
#include "l2cache.h"
#include "../intersim/statwraper.h"
+#include "../abstract_hardware_model.h"
class L2c_mshr;
class L2c_miss_tracker;
diff --git a/src/gpgpu-sim/mem_fetch.h b/src/gpgpu-sim/mem_fetch.h
index 0e12a2d..dbd3a2a 100644
--- a/src/gpgpu-sim/mem_fetch.h
+++ b/src/gpgpu-sim/mem_fetch.h
@@ -69,6 +69,7 @@
#include "shader.h"
#include "addrdec.h"
+#include "../abstract_hardware_model.h"
enum mf_type {
RD_REQ = 0,
diff --git a/src/gpgpu-sim/mem_latency_stat.h b/src/gpgpu-sim/mem_latency_stat.h
index 2fa6b1c..150a1be 100644
--- a/src/gpgpu-sim/mem_latency_stat.h
+++ b/src/gpgpu-sim/mem_latency_stat.h
@@ -80,7 +80,7 @@ extern unsigned int gpu_mem_n_bk;
#define EXTERN_DEF extern
#endif
-EXTERN_DEF int gpgpu_memlatency_stat = FALSE;
+EXTERN_DEF bool gpgpu_memlatency_stat = false;
EXTERN_DEF unsigned max_mrq_latency;
EXTERN_DEF unsigned max_dq_latency;
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 8f3f700..c173206 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -223,7 +223,6 @@ extern unsigned g_max_regs_per_thread;
void ptx_decode_inst( void *thd, unsigned *op, int *i1, int *i2, int *i3, int *i4, int *o1, int *o2, int *o3, int *o4, int *vectorin, int *vectorout, int *arch_reg );
unsigned ptx_get_inst_op( void *thd);
void ptx_exec_inst( void *thd, address_type *addr, unsigned *space, unsigned *data_size, dram_callback_t* callback, unsigned warp_active_mask);
-int ptx_branch_taken( void *thd );
void ptx_sim_free_sm( void** thread_info );
unsigned ptx_sim_init_thread( void** thread_info, int sid, unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id);
unsigned ptx_sim_cta_size();
@@ -1750,7 +1749,6 @@ void shader_decode( shader_core_ctx_t *shader,
address_type addr;
dram_callback_t callback;
op_type op = NO_OP;
- register int is_write;
int tid;
int i1, i2, i3, i4, o1, o2, o3, o4; //4 outputs needed for texture fetches in cuda-sim
int i;
@@ -1950,16 +1948,6 @@ void shader_decode( shader_core_ctx_t *shader,
shader->pipeline_reg[IF_ID][i].out[2] = o3;
shader->pipeline_reg[IF_ID][i].out[3] = o4;
- if ( op == STORE_OP ) {
- is_write = TRUE;
- }
-
- if ( op == BRANCH_OP ) {
- int taken=0;
- assert( gpgpu_cuda_sim );
- taken = ptx_branch_taken(shader->thread[tid].ptx_thd_info);
- }
-
// go to the next instruction
// - done implicitly in ptx_exec_inst()
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 8333202..1567d6a 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -139,7 +139,7 @@ typedef struct {
int reg_bank_access_pending;
int reg_bank_conflict_stall_checked; // flag to turn off register bank conflict checker to avoid double stalling
- unsigned char inst_type;
+ unsigned inst_type;
unsigned priority;
diff --git a/src/gpgpu-sim/stack.h b/src/gpgpu-sim/stack.h
index b00e25b..9ddab6d 100644
--- a/src/gpgpu-sim/stack.h
+++ b/src/gpgpu-sim/stack.h
@@ -69,7 +69,7 @@
#ifndef _MY_STACK_
#define _MY_STACK_
-#include "../util.h"
+#include "../abstract_hardware_model.h"
typedef struct {
address_type *v;
diff --git a/src/gpgpu-sim/stat-tool.cc b/src/gpgpu-sim/stat-tool.cc
index 2dc9c0b..9845e06 100644
--- a/src/gpgpu-sim/stat-tool.cc
+++ b/src/gpgpu-sim/stat-tool.cc
@@ -88,6 +88,7 @@
#endif
#include "histogram.h"
+#include "../abstract_hardware_model.h"
binned_histogram::binned_histogram (std::string name, int nbins, int* bins)
: m_name(name), m_nbins(nbins), m_bins(NULL), m_bin_cnts(new int[m_nbins]), m_maximum(0)
@@ -178,7 +179,6 @@ void linear_histogram::add2bin (int sample) {
#include <map>
#include <algorithm>
#include <string>
-#include "../util.h"
#include "cflogger.h"
diff --git a/src/gpgpu-sim/warp_tracker.h b/src/gpgpu-sim/warp_tracker.h
index a4faa09..5375543 100644
--- a/src/gpgpu-sim/warp_tracker.h
+++ b/src/gpgpu-sim/warp_tracker.h
@@ -79,7 +79,7 @@
#endif
-#include "../util.h"
+#include "../abstract_hardware_model.h"
#include "shader.h"
void init_warp_tracker( );
diff --git a/src/util.h b/src/util.h
deleted file mode 100644
index d021652..0000000
--- a/src/util.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * util.h
- *
- * Copyright (c) 2009 by Tor M. Aamodt and the University of British Columbia
- * Vancouver, BC V6T 1Z4
- * All Rights Reserved.
- *
- * THIS IS A LEGAL DOCUMENT BY DOWNLOADING GPGPU-SIM, YOU ARE AGREEING TO THESE
- * TERMS AND CONDITIONS.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * NOTE: The files libcuda/cuda_runtime_api.c and src/cuda-sim/cuda-math.h
- * are derived from the CUDA Toolset available from http://www.nvidia.com/cuda
- * (property of NVIDIA). The files benchmarks/BlackScholes/ and
- * benchmarks/template/ are derived from the CUDA SDK available from
- * http://www.nvidia.com/cuda (also property of NVIDIA). The files from
- * src/intersim/ are derived from Booksim (a simulator provided with the
- * textbook "Principles and Practices of Interconnection Networks" available
- * from http://cva.stanford.edu/books/ppin/). As such, those files are bound by
- * the corresponding legal terms and conditions set forth separately (original
- * copyright notices are left in files from these sources and where we have
- * modified a file our copyright notice appears before the original copyright
- * notice).
- *
- * Using this version of GPGPU-Sim requires a complete installation of CUDA
- * which is distributed seperately by NVIDIA under separate terms and
- * conditions. To use this version of GPGPU-Sim with OpenCL requires a
- * recent version of NVIDIA's drivers which support OpenCL.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the University of British Columbia nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 4. This version of GPGPU-SIM is distributed freely for non-commercial use only.
- *
- * 5. No nonprofit user may place any restrictions on the use of this software,
- * including as modified by the user, by any other authorized user.
- *
- * 6. GPGPU-SIM was developed primarily by Tor M. Aamodt, Wilson W. L. Fung,
- * Ali Bakhoda, George L. Yuan, at the University of British Columbia,
- * Vancouver, BC V6T 1Z4
- */
-
-#ifndef util_h_INCLUDED
-#define util_h_INCLUDED
-
-typedef unsigned address_type;
-
-#define NO_OP -1
-#define ALU_OP 1
-#define LOAD_OP 2
-#define STORE_OP 3
-#define BRANCH_OP 4
-#define BARRIER_OP 5
-#define TRUE 1
-#define FALSE 0
-
-#endif