system.cc (8826:6cc162805986) system.cc (8832:247fee427324)
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

108 debugSymbolTable = new SymbolTable;
109
110 /**
111 * Get a port proxy to memory
112 */
113 physProxy = new PortProxy(*getSystemPort());
114 virtProxy = new FSTranslatingPortProxy(*getSystemPort());
115 }
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

108 debugSymbolTable = new SymbolTable;
109
110 /**
111 * Get a port proxy to memory
112 */
113 physProxy = new PortProxy(*getSystemPort());
114 virtProxy = new FSTranslatingPortProxy(*getSystemPort());
115 }
116
117 // Get the generic system master IDs
118 MasterID tmp_id M5_VAR_USED;
119 tmp_id = getMasterId("writebacks");
120 assert(tmp_id == Request::wbMasterId);
121 tmp_id = getMasterId("functional");
122 assert(tmp_id == Request::funcMasterId);
123 tmp_id = getMasterId("interrupt");
124 assert(tmp_id == Request::intMasterId);
125
116}
117
118System::~System()
119{
120 delete kernelSymtab;
121 delete kernel;
122
123 for (uint32_t j = 0; j < numWorkIds; j++)

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

394}
395
396void
397printSystems()
398{
399 System::printSystems();
400}
401
126}
127
128System::~System()
129{
130 delete kernelSymtab;
131 delete kernel;
132
133 for (uint32_t j = 0; j < numWorkIds; j++)

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

404}
405
406void
407printSystems()
408{
409 System::printSystems();
410}
411
412MasterID
413System::getMasterId(std::string master_name)
414{
415 // strip off system name if the string starts with it
416 if (master_name.size() > name().size() &&
417 master_name.compare(0, name().size(), name()) == 0)
418 master_name = master_name.erase(0, name().size() + 1);
419
420 // CPUs in switch_cpus ask for ids again after switching
421 for (int i = 0; i < masterIds.size(); i++) {
422 if (masterIds[i] == master_name) {
423 return i;
424 }
425 }
426
427 // todo: Check if stats are enabled yet
428 // I just don't know a good way to do it
429
430 if (false)
431 fatal("Can't request a masterId after regStats(). \
432 You must do so in init().\n");
433
434 masterIds.push_back(master_name);
435
436 return masterIds.size() - 1;
437}
438
439std::string
440System::getMasterName(MasterID master_id)
441{
442 if (master_id >= masterIds.size())
443 fatal("Invalid master_id passed to getMasterName()\n");
444
445 return masterIds[master_id];
446}
447
402const char *System::MemoryModeStrings[3] = {"invalid", "atomic",
403 "timing"};
404
405System *
406SystemParams::create()
407{
408 return new System(this);
409}
448const char *System::MemoryModeStrings[3] = {"invalid", "atomic",
449 "timing"};
450
451System *
452SystemParams::create()
453{
454 return new System(this);
455}