Deleted Added
sdiff udiff text old ( 2868:6a7e69fa92d3 ) new ( 2889:9e367e03d656 )
full compact
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 101 unchanged lines hidden (view full) ---

110 cerr << "Program aborted at cycle " << curTick << endl;
111
112#if TRACING_ON
113 // dump trace buffer, if there is one
114 Trace::theLog.dump(cerr);
115#endif
116}
117
118extern "C" { void init_cc_main(); }
119
120int
121main(int argc, char **argv)
122{
123 signal(SIGFPE, SIG_IGN); // may occur on misspeculated paths
124 signal(SIGTRAP, SIG_IGN);
125 signal(SIGUSR1, dumpStatsHandler); // dump intermediate stats
126 signal(SIGUSR2, dumprstStatsHandler); // dump and reset stats
127 signal(SIGINT, exitNowHandler); // dump final stats and exit
128 signal(SIGABRT, abortHandler);
129
130 Py_SetProgramName(argv[0]);
131
132 // default path to m5 python code is the currently executing
133 // file... Python ZipImporter will find embedded zip archive.
134 // The M5_ARCHIVE environment variable can be used to override this.
135 char *m5_archive = getenv("M5_ARCHIVE");
136 string pythonpath = m5_archive ? m5_archive : argv[0];
137
138 char *oldpath = getenv("PYTHONPATH");
139 if (oldpath != NULL) {
140 pythonpath += ":";
141 pythonpath += oldpath;
142 }
143
144 if (setenv("PYTHONPATH", pythonpath.c_str(), true) == -1)
145 fatal("setenv: %s\n", strerror(errno));
146
147 // initialize embedded Python interpreter
148 Py_Initialize();
149 PySys_SetArgv(argc, argv);
150
151 // initialize SWIG 'cc_main' module
152 init_cc_main();
153
154 PyRun_SimpleString("import m5");
155 PyRun_SimpleString("m5.main()");
156
157 // clean up Python intepreter.
158 Py_Finalize();
159}
160
161
162void
163setOutputDir(const string &dir)
164{

--- 290 unchanged lines hidden ---