gem5.cc (10779:3e986011e99e) | gem5.cc (11315:10647f5d0f7f) |
---|---|
1// Copyright (c) 2015 ARM Limited 2// All rights reserved. 3// 4// The license below extends only to copyright in the software and shall 5// not be construed as granting a license to any other intellectual 6// property including but not limited to intellectual property relating 7// to a hardware implementation of the functionality of the software 8// licensed hereunder. You may use the software subject to the license --- 55 unchanged lines hidden (view full) --- 64#ifdef fatal // gem5 sets this 65#undef fatal 66#endif 67 68// More SST Headers 69#include <sst/core/params.h> 70#include <sst/core/link.h> 71#include <sst/core/timeConverter.h> | 1// Copyright (c) 2015 ARM Limited 2// All rights reserved. 3// 4// The license below extends only to copyright in the software and shall 5// not be construed as granting a license to any other intellectual 6// property including but not limited to intellectual property relating 7// to a hardware implementation of the functionality of the software 8// licensed hereunder. You may use the software subject to the license --- 55 unchanged lines hidden (view full) --- 64#ifdef fatal // gem5 sets this 65#undef fatal 66#endif 67 68// More SST Headers 69#include <sst/core/params.h> 70#include <sst/core/link.h> 71#include <sst/core/timeConverter.h> |
72#include <sst/core/debug.h> | |
73 74using namespace SST; 75using namespace SST::gem5; 76 77gem5Component::gem5Component(ComponentId_t id, Params ¶ms) : 78 SST::Component(id) 79{ 80 dbg.init("@t:gem5:@p():@l " + getName() + ": ", 0, 0, --- 7 unchanged lines hidden (view full) --- 88 // This sets how many gem5 cycles we'll need to simulate per clock tick 89 sim_cycles = clock->getFactor(); 90 91 // Disable gem5's inform() messages. 92 want_info = false; 93 94 std::string cmd = params.find_string("cmd", ""); 95 if (cmd.empty()) { | 72 73using namespace SST; 74using namespace SST::gem5; 75 76gem5Component::gem5Component(ComponentId_t id, Params ¶ms) : 77 SST::Component(id) 78{ 79 dbg.init("@t:gem5:@p():@l " + getName() + ": ", 0, 0, --- 7 unchanged lines hidden (view full) --- 87 // This sets how many gem5 cycles we'll need to simulate per clock tick 88 sim_cycles = clock->getFactor(); 89 90 // Disable gem5's inform() messages. 91 want_info = false; 92 93 std::string cmd = params.find_string("cmd", ""); 94 if (cmd.empty()) { |
96 _abort(gem5Component, "Component %s must have a 'cmd' parameter.\n", | 95 dbg.fatal(CALL_INFO, -1, "Component %s must have a 'cmd' parameter.\n", |
97 getName().c_str()); 98 } 99 100 std::vector<char*> args; 101 args.push_back(const_cast<char*>("sst.x")); // TODO: Compute this somehow? 102 splitCommandArgs(cmd, args); 103 args.push_back(const_cast<char*>("--initialize-only")); 104 dbg.output(CALL_INFO, "Command string: [sst.x %s --initialize-only]\n", --- 113 unchanged lines hidden (view full) --- 218 PyObject *mainModule,*mainDict; 219 220 Py_SetProgramName(argv[0]); // optional but recommended 221 222 Py_Initialize(); 223 224 int ret = initM5Python(); 225 if (ret != 0) { | 96 getName().c_str()); 97 } 98 99 std::vector<char*> args; 100 args.push_back(const_cast<char*>("sst.x")); // TODO: Compute this somehow? 101 splitCommandArgs(cmd, args); 102 args.push_back(const_cast<char*>("--initialize-only")); 103 dbg.output(CALL_INFO, "Command string: [sst.x %s --initialize-only]\n", --- 113 unchanged lines hidden (view full) --- 217 PyObject *mainModule,*mainDict; 218 219 Py_SetProgramName(argv[0]); // optional but recommended 220 221 Py_Initialize(); 222 223 int ret = initM5Python(); 224 if (ret != 0) { |
226 _abort(gem5Component, "Python failed to initialize. Code: %d\n", ret); | 225 dbg.fatal(CALL_INFO, -1, "Python failed to initialize. Code: %d\n", 226 ret); |
227 } 228 229 PySys_SetArgv(argc, argv); 230 231 mainModule = PyImport_AddModule("__main__"); 232 assert(mainModule); 233 234 mainDict = PyModule_GetDict(mainModule); --- 38 unchanged lines hidden --- | 227 } 228 229 PySys_SetArgv(argc, argv); 230 231 mainModule = PyImport_AddModule("__main__"); 232 assert(mainModule); 233 234 mainDict = PyModule_GetDict(mainModule); --- 38 unchanged lines hidden --- |