When checking for stop, remember to reschedule.

This commit is contained in:
steve 2003-02-22 06:26:58 +00:00
parent 94914382c2
commit 2935e28ffb
1 changed files with 37 additions and 6 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vthread.cc,v 1.102 2003/02/22 02:52:06 steve Exp $"
#ident "$Id: vthread.cc,v 1.103 2003/02/22 06:26:58 steve Exp $"
#endif
# include "vthread.h"
@ -1425,7 +1425,12 @@ bool of_JMP(vthread_t thr, vvp_code_t cp)
keeps going to the next instruction. However, if there was
a $stop or vpiStop, returning false here can break the
simulation out of a hung loop. */
return ! schedule_stopped();
if (schedule_stopped()) {
schedule_vthread(thr, 0, false);
return false;
}
return true;
}
bool of_JMP0(vthread_t thr, vvp_code_t cp)
@ -1437,7 +1442,12 @@ bool of_JMP0(vthread_t thr, vvp_code_t cp)
keeps going to the next instruction. However, if there was
a $stop or vpiStop, returning false here can break the
simulation out of a hung loop. */
return ! schedule_stopped();
if (schedule_stopped()) {
schedule_vthread(thr, 0, false);
return false;
}
return true;
}
bool of_JMP0XZ(vthread_t thr, vvp_code_t cp)
@ -1449,7 +1459,12 @@ bool of_JMP0XZ(vthread_t thr, vvp_code_t cp)
keeps going to the next instruction. However, if there was
a $stop or vpiStop, returning false here can break the
simulation out of a hung loop. */
return ! schedule_stopped();
if (schedule_stopped()) {
schedule_vthread(thr, 0, false);
return false;
}
return true;
}
bool of_JMP1(vthread_t thr, vvp_code_t cp)
@ -1461,7 +1476,12 @@ bool of_JMP1(vthread_t thr, vvp_code_t cp)
keeps going to the next instruction. However, if there was
a $stop or vpiStop, returning false here can break the
simulation out of a hung loop. */
return ! schedule_stopped();
if (schedule_stopped()) {
schedule_vthread(thr, 0, false);
return false;
}
return true;
}
/*
@ -2501,7 +2521,15 @@ bool of_VPI_CALL(vthread_t thr, vvp_code_t cp)
{
// printf("thread %p: %%vpi_call\n", thr);
vpip_execute_vpi_call(thr, cp->handle);
return (schedule_finished() || schedule_stopped())? false : true;
if (schedule_stopped()) {
if (! schedule_finished())
schedule_vthread(thr, 0, false);
return false;
}
return schedule_finished()? false : true;
}
/*
@ -2636,6 +2664,9 @@ bool of_CALL_UFUNC(vthread_t thr, vvp_code_t cp)
/*
* $Log: vthread.cc,v $
* Revision 1.103 2003/02/22 06:26:58 steve
* When checking for stop, remember to reschedule.
*
* Revision 1.102 2003/02/22 02:52:06 steve
* Check for stopped flag in certain strategic points.
*