Re: [Gems-users] ctrl+C does not interrupt the simulation


Date: Wed, 14 Oct 2009 17:04:55 -0500
From: Philip Garcia <pcgarcia@xxxxxxxx>
Subject: Re: [Gems-users] ctrl+C does not interrupt the simulation
it sounds like you didn't declare the function ahead of time. Just put the line "void SignalInt(int);" at the top of system.C, or include it in the system.h header.

Phil
On Oct 13, 2009, at 5:07 AM, Mahmood Naderan wrote:

I added to signal(SIGINT,SignalInt) to system_t::system_t( const char
*configurationFile ) in system.C and compiled opal again. Here is the
error:
....
system/system.C:314: error: ‘SignalInt’ was not declared in this scope
system/system.C: In member function ‘void
system_t::postedBreakpoint(uint32, uint32)
....

_mnaderan_




On Tue, Oct 13, 2009 at 12:06 PM, Philip Garcia <pcgarcia@xxxxxxxx> wrote:
my copy only has the one in system.C that is passed in a configuration file. If there are multiple ways that system_t can be instantiated in
your version, put the line in each path.  Basically that call just
needs to be made somewhere in the code early on so that it registers
the signal handler.

Phil
On Oct 13, 2009, at 3:10 AM, Mahmood Naderan wrote:

Then in the system_t constructor class, i register my signal handler
with opal using:
signal(SIGINT,SignalInt);

I have found two constructors for system_t in system.C and system.h.
Which one do you mean?

_mnaderan_




On Tue, Oct 13, 2009 at 11:20 AM, Philip Garcia <pcgarcia@xxxxxxxx>
wrote:
I had this same issue a while back when I switched to using Simics
3.0. An unsupported workaround to this is to install your own ctrl-c
signal handler into opal/system/system.C .

I can't say exactly what the changes are, as I don't know offhand
which stuff I've added to system.C and what is in the vanilla
system.C

Adding the signal handler itself is pretty easy, I just include the
file  #include <signal.h>
I also added the following function into system.C (not as a method of
the class, just a plain C function):

void SignalInt(int sig)
{
  signal (sig,SIG_IGN); //ignore the signal
  //HaltSimulation("hit control-c");
  HALT_SIMULATION;
  signal(SIGINT,SignalInt);
}

Then in the system_t constructor class, i register my signal handler
with opal using:

signal(SIGINT,SignalInt);

This should allow ctrl-C events to halt opal. I'm not sure why opal no longer gets the SIGINT signal from simics. The simics forum said something about how they don't know what would happen if you add your
own signal handler (like I did), but this method has worked pretty
well for me.

Phil

On Oct 13, 2009, at 2:27 AM, Mahmood Naderan wrote:

Hi,
I have followed the instructions to start a simulation. After
successfully loading ruby and opal, I ran these commands:
simics> ruby0.setparam g_NUM_PROCESSORS 1
simics> ruby0.setparam g_MEMORY_SIZE_BYTES 4294967296
simics> ruby0.init
simics> opal0.init
simics> opal0.simstart "results.opal"

Now at this point I ran  simics> opal0.simstep 10000000000, and it
seems the simulation starts, but I am not able to interrupt it with ctrl+C (!). pressing ctrl+C results in displaying ^C character only.
How can I stop it?

Thanks,
_mnaderan_
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding
"site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding
"site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding
"site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


[← Prev in Thread] Current Thread [Next in Thread→]