main.cc (2763:c3741c707d53) main.cc (2768:5f23b83c8b0c)
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;

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

130" -p, --path <path> prepends <path> to PYTHONPATH instead of using\n"
131" built-in zip archive. Useful when developing/debugging\n"
132" changes to built-in Python libraries, as the new Python\n"
133" can be tested without building a new m5 binary.\n\n"
134" -i, --interactive forces entry into interactive mode after the supplied\n"
135" script is executed (just like the -i option to the\n"
136" Python interpreter).\n\n"
137" -h Prints this help\n\n"
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;

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

130" -p, --path <path> prepends <path> to PYTHONPATH instead of using\n"
131" built-in zip archive. Useful when developing/debugging\n"
132" changes to built-in Python libraries, as the new Python\n"
133" can be tested without building a new m5 binary.\n\n"
134" -i, --interactive forces entry into interactive mode after the supplied\n"
135" script is executed (just like the -i option to the\n"
136" Python interpreter).\n\n"
137" -h Prints this help\n\n"
138" <configfile> config file name (ends in .py)\n\n",
138" <configfile> config file name which ends in .py. (Normally you can\n"
139" run <configfile> --help to get help on that config files\n"
140" parameters.\n\n",
139 prog);
140
141}
142
143const char *briefCopyright =
144"Copyright (c) 2001-2006\n"
145"The Regents of The University of Michigan\n"
146"All Rights Reserved\n";

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

161 if (!host)
162 host = getenv("HOST");
163
164 if (host)
165 ccprintf(out, "M5 executing on %s\n", host);
166}
167
168
141 prog);
142
143}
144
145const char *briefCopyright =
146"Copyright (c) 2001-2006\n"
147"The Regents of The University of Michigan\n"
148"All Rights Reserved\n";

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

163 if (!host)
164 host = getenv("HOST");
165
166 if (host)
167 ccprintf(out, "M5 executing on %s\n", host);
168}
169
170
169extern "C" { void init_cc_main(); }
171extern "C" { void init_main(); }
170
171int
172main(int argc, char **argv)
173{
174 // Saze off program name
175 myProgName = argv[0];
176
177 sayHello(cerr);

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

253
254 if (setenv("PYTHONPATH", newpath.c_str(), true) == -1)
255 fatal("setenv: %s\n", strerror(errno));
256
257 // initialize embedded Python interpreter
258 Py_Initialize();
259 PySys_SetArgv(argc, argv);
260
172
173int
174main(int argc, char **argv)
175{
176 // Saze off program name
177 myProgName = argv[0];
178
179 sayHello(cerr);

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

255
256 if (setenv("PYTHONPATH", newpath.c_str(), true) == -1)
257 fatal("setenv: %s\n", strerror(errno));
258
259 // initialize embedded Python interpreter
260 Py_Initialize();
261 PySys_SetArgv(argc, argv);
262
261 // initialize SWIG 'cc_main' module
262 init_cc_main();
263 // initialize SWIG 'main' module
264 init_main();
263
264 if (argc > 0) {
265 // extra arg(s): first is script file, remaining ones are args
266 // to script file
267 char *filename = argv[0];
268 FILE *fp = fopen(filename, "r");
269 if (!fp) {
270 fatal("cannot open file '%s'\n", filename);

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

292
293 PyRun_InteractiveLoop(stdin, "stdin");
294 }
295
296 // clean up Python intepreter.
297 Py_Finalize();
298}
299
265
266 if (argc > 0) {
267 // extra arg(s): first is script file, remaining ones are args
268 // to script file
269 char *filename = argv[0];
270 FILE *fp = fopen(filename, "r");
271 if (!fp) {
272 fatal("cannot open file '%s'\n", filename);

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

294
295 PyRun_InteractiveLoop(stdin, "stdin");
296 }
297
298 // clean up Python intepreter.
299 Py_Finalize();
300}
301
300
301void
302setOutputDir(const string &dir)
303{
304 simout.setDirectory(dir);
305}
306
307
308IniFile inifile;
309
310SimObject *
311createSimObject(const string &name)
312{
313 return SimObjectClass::createObject(inifile, name);
314}
315

--- 242 unchanged lines hidden ---
302IniFile inifile;
303
304SimObject *
305createSimObject(const string &name)
306{
307 return SimObjectClass::createObject(inifile, name);
308}
309

--- 242 unchanged lines hidden ---