cxx_manager.cc (13784:1941dc118243) | cxx_manager.cc (13892:0182a0601f66) |
---|---|
1/* 2 * Copyright (c) 2014 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 --- 31 unchanged lines hidden (view full) --- 40#include "sim/cxx_manager.hh" 41 42#include <cstdlib> 43#include <sstream> 44 45#include "base/str.hh" 46#include "base/trace.hh" 47#include "debug/CxxConfig.hh" | 1/* 2 * Copyright (c) 2014 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 --- 31 unchanged lines hidden (view full) --- 40#include "sim/cxx_manager.hh" 41 42#include <cstdlib> 43#include <sstream> 44 45#include "base/str.hh" 46#include "base/trace.hh" 47#include "debug/CxxConfig.hh" |
48#include "mem/mem_object.hh" | |
49#include "sim/serialize.hh" | 48#include "sim/serialize.hh" |
49#include "sim/sim_object.hh" |
|
50 51CxxConfigManager::CxxConfigManager(CxxConfigFileBase &configFile_) : 52 configFile(configFile_), flags(configFile_.getFlags()), 53 simObjectResolver(*this) 54{ 55} 56 57const CxxConfigDirectoryEntry & --- 388 unchanged lines hidden (view full) --- 446 447void 448CxxConfigManager::bindPort( 449 SimObject *master_object, const std::string &master_port_name, 450 PortID master_port_index, 451 SimObject *slave_object, const std::string &slave_port_name, 452 PortID slave_port_index) 453{ | 50 51CxxConfigManager::CxxConfigManager(CxxConfigFileBase &configFile_) : 52 configFile(configFile_), flags(configFile_.getFlags()), 53 simObjectResolver(*this) 54{ 55} 56 57const CxxConfigDirectoryEntry & --- 388 unchanged lines hidden (view full) --- 446 447void 448CxxConfigManager::bindPort( 449 SimObject *master_object, const std::string &master_port_name, 450 PortID master_port_index, 451 SimObject *slave_object, const std::string &slave_port_name, 452 PortID slave_port_index) 453{ |
454 MemObject *master_mem_object = dynamic_cast<MemObject *>(master_object); 455 MemObject *slave_mem_object = dynamic_cast<MemObject *>(slave_object); 456 457 if (!master_mem_object) { 458 throw Exception(master_object->name(), csprintf( 459 "Object isn't a mem object and so can have master port:" 460 " %s[%d]", master_port_name, master_port_index)); 461 } 462 463 if (!slave_mem_object) { 464 throw Exception(slave_object->name(), csprintf( 465 "Object isn't a mem object and so can have slave port:" 466 " %s[%d]", slave_port_name, slave_port_index)); 467 } 468 | |
469 /* FIXME, check slave_port_index against connection_count 470 * defined for port, need getPortConnectionCount and a 471 * getCxxConfigDirectoryEntry for each object. */ 472 473 /* It would be nice to be able to catch the errors from these calls. */ | 454 /* FIXME, check slave_port_index against connection_count 455 * defined for port, need getPortConnectionCount and a 456 * getCxxConfigDirectoryEntry for each object. */ 457 458 /* It would be nice to be able to catch the errors from these calls. */ |
474 Port &master_port = master_mem_object->getPort( | 459 Port &master_port = master_object->getPort( |
475 master_port_name, master_port_index); | 460 master_port_name, master_port_index); |
476 Port &slave_port = slave_mem_object->getPort( | 461 Port &slave_port = slave_object->getPort( |
477 slave_port_name, slave_port_index); 478 479 if (master_port.isConnected()) { 480 throw Exception(master_object->name(), csprintf( 481 "Master port: %s[%d] is already connected\n", master_port_name, 482 master_port_index)); 483 } 484 --- 246 unchanged lines hidden --- | 462 slave_port_name, slave_port_index); 463 464 if (master_port.isConnected()) { 465 throw Exception(master_object->name(), csprintf( 466 "Master port: %s[%d] is already connected\n", master_port_name, 467 master_port_index)); 468 } 469 --- 246 unchanged lines hidden --- |