Permalink
Browse files

Minor merge corrections from big coherency merge

  • Loading branch information...
KevinBrownell committed Apr 8, 2013
1 parent c0e31fe commit a6bb78d67526af8410eedacbac323d673737b4c3
Showing with 21 additions and 17 deletions.
  1. +1 −1 .gitmodules
  2. +1 −1 pintool/BufferManager.cpp
  3. +13 −13 pintool/ildjit.cpp
  4. +4 −0 pintool/scheduler.cpp
  5. +2 −2 sim-slave.cpp
View
@@ -5,6 +5,6 @@
fetchRecurseSubmodules = true
[submodule "mem-repeater"]
path = mem-repeater
- url = file:///home/skanev/zesto_repeater
+ url = file:///group/brooks/git/librepeater
update = merge
fetchRecurseSubmodules = true
@@ -108,7 +108,6 @@ handshake_container_t* BufferManager::front(THREADID tid, bool isLocal)
PIN_Yield();
while(consumers_sleep) {
PIN_SemaphoreWait(&consumer_sleep_lock);
- // PIN_Sleep(250);
}
lk_lock(locks_[tid], tid+1);
spins++;
@@ -140,6 +139,7 @@ handshake_container_t* BufferManager::back(THREADID tid)
bool BufferManager::empty(THREADID tid)
{
+ assert(locks_[tid]);
lk_lock(locks_[tid], tid+1);
bool result = queueSizes_[tid] == 0;
lk_unlock(locks_[tid]);
View
@@ -385,7 +385,7 @@ VOID ILDJIT_endParallelLoop(THREADID tid, ADDRINT loop, ADDRINT numIterations)
int numInstsToIgnore = 3;
flushLookahead(tid, numInstsToIgnore);
- PauseSimulation(tid);
+ ILDJIT_PauseSimulation(tid);
cerr << tid << ": Paused simulation!" << endl;
first_invocation = false;
@@ -1030,18 +1030,6 @@ VOID ILDJIT_PauseSimulation(THREADID tid)
memcpy(handshake->handshake.ins, syscall_template, sizeof(syscall_template));
handshake_buffer.producer_done(*it, true);
- /* Deactivate this core, so we can advance the cycle conunter of
- * others without waiting on it */
- handshake_container_t* handshake_2 = handshake_buffer.get_buffer(*it);
-
- handshake_2->flags.isFirstInsn = false;
- handshake_2->handshake.sleep_thread = true;
- handshake_2->handshake.resume_thread = false;
- handshake_2->handshake.real = false;
- handshake_2->handshake.pc = 0;
- handshake_2->flags.valid = true;
- handshake_buffer.producer_done(*it, true);
-
/* And finally, flush the core's pipelie to get rid of anything
* left over (including the trap) and flush the ring cache */
handshake_container_t* handshake_3 = handshake_buffer.get_buffer(*it);
@@ -1054,6 +1042,18 @@ VOID ILDJIT_PauseSimulation(THREADID tid)
handshake_3->handshake.pc = 0;
handshake_3->flags.valid = true;
handshake_buffer.producer_done(*it, true);
+
+ /* Deactivate this core, so we can advance the cycle conunter of
+ * others without waiting on it */
+ handshake_container_t* handshake_2 = handshake_buffer.get_buffer(*it);
+
+ handshake_2->flags.isFirstInsn = false;
+ handshake_2->handshake.sleep_thread = true;
+ handshake_2->handshake.resume_thread = false;
+ handshake_2->handshake.real = false;
+ handshake_2->handshake.pc = 0;
+ handshake_2->flags.valid = true;
+ handshake_buffer.producer_done(*it, true);
handshake_buffer.flushBuffers(*it);
}
View
@@ -57,6 +57,7 @@ VOID HardcodeSchedule(THREADID tid, INT32 coreID)
{
lk_lock(&run_queues[coreID].lk, 1);
ASSERTX(run_queues[coreID].q.empty());
+ activate_core(coreID);
run_queues[coreID].q.push(tid);
lk_unlock(&run_queues[coreID].lk);
@@ -136,6 +137,9 @@ VOID GiveUpCore(INT32 coreID, BOOL reschedule_thread)
if (reschedule_thread) {
run_queues[coreID].q.push(tid);
+ thread_state_t* tstate = get_tls(tid);
+ tstate->coreID = coreID;
+
lk_lock(&printing_lock, tid+1);
cerr << "Rescheduling " << tid << " on core " << coreID << endl;
lk_unlock(&printing_lock);
View
@@ -468,7 +468,7 @@ void sim_main_slave_pre_pin(int coreID)
/* Spin, spin, spin */
yield();
while(consumers_sleep) {
- xio_sleep(250);
+ xio_sleep(10);
}
lk_lock(&cycle_lock, coreID+1);
@@ -516,7 +516,7 @@ void sim_main_slave_pre_pin(int coreID)
lk_unlock(&cycle_lock);
yield();
while(consumers_sleep) {
- xio_sleep(250);
+ xio_sleep(10);
}
lk_lock(&cycle_lock, coreID+1);
}

0 comments on commit a6bb78d

Please sign in to comment.