> On Feb. 7, 2013, 7:19 a.m., Steve Reinhardt wrote: > > If we were doing this over again, I'd suggest that run() should just > > unconditionally return exit_event.getCode() (or maybe even exit_event); > > then simulation scripts would have the option of doing some clean-up or > > other work after the simulation is done. Unfortunately this would require > > changing existing scripts that end with Simulation.run(...) to > > sys.exit(Simulation.run(...)). Maybe that's worth it though. Thoughts? > > Andreas Sandberg wrote: > That'd just shift the problem to the individual simulation scripts. In > that case, we'd have to check if gem5 is run in interactive mode in both > se.py and fs.py. I agree with you that the current situation is less than > ideal for many reasons and should be fixed (I never use Simulation.run in my > own scripts because I find it too broken), but I'd like to see the patch > merged because it solves the issue of not being able to use interactive mode > in the example scripts. > > In the long run, we should probably redesign most of the example scripts. > I find most of the scripts in config/ very confusing and hard to understand.
Good point... I never use interactive mode myself so it didn't occur to me that you'd have the same problem if you pushed the sys.exit() call up a level. I definitely agree on the need to redesign the example scripts (and restructure a lot of the python code in configs/common too). That's outside the scope of this patch though... - Steve ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/1696/#review3996 ----------------------------------------------------------- On Feb. 7, 2013, 3:38 a.m., Andreas Sandberg wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/1696/ > ----------------------------------------------------------- > > (Updated Feb. 7, 2013, 3:38 a.m.) > > > Review request for Default. > > > Description > ------- > > Changeset 9496:202aa9125749 > --------------------------- > config: Don't call sys.exit in interactive mode in run() > > The run() method in Simulation.py used to call sys.exit() when the > simulator exits. This is undesirable when user has requested the > simulator to be run in interactive mode since it causes the simulator > to exit rather than entering the interactive Python environment. > > > Diffs > ----- > > configs/common/Simulation.py 890fc69ba53c > > Diff: http://reviews.gem5.org/r/1696/diff/ > > > Testing > ------- > > Tried running gem5 with the -i option. It works when the patch is applied. > > > Thanks, > > Andreas Sandberg > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
