summaryrefslogtreecommitdiff
path: root/src/debug.cc
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-10-08 07:21:51 -0800
committerTor Aamodt <[email protected]>2010-10-08 07:21:51 -0800
commit8c2954c263b4cfd756188362919c1a16a7189788 (patch)
treee4827655db3edb26d4668fc42e78f1e5731afa02 /src/debug.cc
parent474e6d99c8efa9e3b8518eecb059546364370fd9 (diff)
1. refactoring cuda api code for loading PTX (removing external PTX loading entirely)
2. some bug fixes for warp_inst_t 3. creating a new class, gpgpu_t, which contains the functional "memory" state visible to all threads running on a GPU (doing this as part of my continuing effort to hunt down and eradicate every global variable that is not the top level "the gpu") 4. other misc. changes Almost passing CUDA 3.1 regression? oclHistogram keeps failing under torque, but does not fail when run on the command line from the same directory. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7827]
Diffstat (limited to 'src/debug.cc')
-rw-r--r--src/debug.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/debug.cc b/src/debug.cc
index 7bc72ac..c1aa3c6 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -61,7 +61,8 @@ void gpgpu_sim::gpgpu_debug()
brk_pt &b=i->second;
if( b.is_watchpoint() ) {
unsigned addr = b.get_addr();
- unsigned new_value = read_location(addr);
+ unsigned new_value;
+ g_global_mem->read(addr,4,&new_value);
if( new_value != b.get_value() || g_watchpoint_hits.find(num) != g_watchpoint_hits.end() ) {
printf( "GPGPU-Sim PTX DBG: watch point %u triggered (old value=%x, new value=%x)\n",
num,b.get_value(),new_value );
@@ -155,7 +156,8 @@ void gpgpu_sim::gpgpu_debug()
tok = strtok(NULL," \t\n");
unsigned addr;
sscanf(tok,"%x",&addr);
- unsigned value = read_location(addr);
+ unsigned value;
+ g_global_mem->read(addr,4,&value);
g_global_mem->set_watch(addr,next_brkpt);
breakpoints[next_brkpt++] = brk_pt(addr,value);
} else if( !strcmp(tok,"l") ) {
@@ -199,9 +201,3 @@ bool thread_at_brkpt( ptx_thread_info *thread, const struct brk_pt &b )
return b.is_equal(thread->get_location(),thread->get_uid());
}
-unsigned read_location( addr_t addr )
-{
- unsigned result=0;
- g_global_mem->read(addr,4,&result);
- return result;
-}