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 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()) { |
95 dbg.fatal(CALL_INFO, -1, "Component %s must have a 'cmd' parameter.\n", |
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) { |
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 --- |