summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_sim.cc
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-16 20:26:49 -0800
committerTor Aamodt <[email protected]>2010-07-16 20:26:49 -0800
commit2a41477bc27387f23ec7c3d6fc3b8e0efdebc9d0 (patch)
tree3e5bb777f54b3dc01b1654d03519a0e2954e7b42 /src/cuda-sim/ptx_sim.cc
parent2ed07329c2babbc39388dec8e19c6c78d1d41d46 (diff)
- adding placeholders for new builtin registers
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6848]
Diffstat (limited to 'src/cuda-sim/ptx_sim.cc')
-rw-r--r--src/cuda-sim/ptx_sim.cc40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/cuda-sim/ptx_sim.cc b/src/cuda-sim/ptx_sim.cc
index 8ec60df..a1a77fd 100644
--- a/src/cuda-sim/ptx_sim.cc
+++ b/src/cuda-sim/ptx_sim.cc
@@ -65,6 +65,8 @@
#include <string>
#include "ptx_ir.h"
+void feature_not_implemented( const char *f );
+
std::set<unsigned long long> g_ptx_cta_info_sm_idx_used;
unsigned long long g_ptx_cta_info_uid = 1;
extern int gpgpu_option_spread_blocks_across_cores;
@@ -256,23 +258,37 @@ extern signed long long gpu_tot_sim_cycle;
unsigned ptx_thread_info::get_builtin( int builtin_id, unsigned dim_mod )
{
assert( m_valid );
- switch (builtin_id) {
- case NTID_ID:
- assert( dim_mod < 3 );
- return m_ntid[dim_mod];
- case CLOCK_ID:
+ switch ((builtin_id&0xFFFF)) {
+ case CLOCK_REG:
+ return (unsigned)(gpu_sim_cycle + gpu_tot_sim_cycle);
+ case CLOCK64_REG:
+ abort(); // change return value to unsigned long long?
return gpu_sim_cycle + gpu_tot_sim_cycle;
- case CTA_ID:
+ case CTAID_REG:
assert( dim_mod < 3 );
return m_ctaid[dim_mod];
- case GRIDID_ID:
+ case ENVREG_REG: feature_not_implemented( "%envreg" ); return 0;
+ case GRIDID_REG:
return m_gridid;
- case NCTAID_ID:
+ case LANEID_REG: feature_not_implemented( "%laneid" ); return 0;
+ case LANEMASK_EQ_REG: feature_not_implemented( "%lanemask_eq" ); return 0;
+ case LANEMASK_LE_REG: feature_not_implemented( "%lanemask_le" ); return 0;
+ case LANEMASK_LT_REG: feature_not_implemented( "%lanemask_lt" ); return 0;
+ case LANEMASK_GE_REG: feature_not_implemented( "%lanemask_ge" ); return 0;
+ case LANEMASK_GT_REG: feature_not_implemented( "%lanemask_gt" ); return 0;
+ case NCTAID_REG:
assert( dim_mod < 3 );
return m_nctaid[dim_mod];
- case TID_ID:
+ case NTID_REG:
+ assert( dim_mod < 3 );
+ return m_ntid[dim_mod];
+ case NWARPID_REG: feature_not_implemented( "%nwarpid" ); return 0;
+ case PM_REG: feature_not_implemented( "%pm" ); return 0;
+ case SMID_REG: feature_not_implemented( "%smid" ); return 0;
+ case TID_REG:
assert( dim_mod < 3 );
return m_tid[dim_mod];
+ case WARPSZ_REG: feature_not_implemented( "WARP_SZ" ); return 0;
default:
assert(0);
}
@@ -430,3 +446,9 @@ void ptx_thread_info::set_npc( const function_info *f )
m_func_info = const_cast<function_info*>( f );
m_symbol_table = m_func_info->get_symtab();
}
+
+void feature_not_implemented( const char *f )
+{
+ printf("GPGPU-Sim: feature '%s' not supported\n", f );
+ abort();
+}