diff options
author | Gabe Black <gabeblack@google.com> | 2019-03-07 03:02:35 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-03-19 10:22:50 +0000 |
commit | d3d24835bcc03ecf312ac6ba7df114656770730f (patch) | |
tree | 43bb564a7bc3e22ffd7b1b906f6f96742ecb619a /src/learning_gem5/part2/simple_memobj.cc | |
parent | 378d9ccbeb4053aeeab002159b26625854af54f7 (diff) | |
download | gem5-d3d24835bcc03ecf312ac6ba7df114656770730f.tar.xz |
arch, cpu, dev, gpu, mem, sim, python: start using getPort.
Replace the getMasterPort, getSlavePort, and getEthPort functions
with getPort, and remove extraneous mechanisms that are no longer
necessary.
Change-Id: Iab7e3c02d2f3a0cf33e7e824e18c28646b5bc318
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17040
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/learning_gem5/part2/simple_memobj.cc')
-rw-r--r-- | src/learning_gem5/part2/simple_memobj.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/learning_gem5/part2/simple_memobj.cc b/src/learning_gem5/part2/simple_memobj.cc index cb4d3d8db..c9af3461f 100644 --- a/src/learning_gem5/part2/simple_memobj.cc +++ b/src/learning_gem5/part2/simple_memobj.cc @@ -41,33 +41,21 @@ SimpleMemobj::SimpleMemobj(SimpleMemobjParams *params) : { } -BaseMasterPort& -SimpleMemobj::getMasterPort(const std::string& if_name, PortID idx) +Port & +SimpleMemobj::getPort(const std::string &if_name, PortID idx) { panic_if(idx != InvalidPortID, "This object doesn't support vector ports"); // This is the name from the Python SimObject declaration (SimpleMemobj.py) if (if_name == "mem_side") { return memPort; - } else { - // pass it along to our super class - return MemObject::getMasterPort(if_name, idx); - } -} - -BaseSlavePort& -SimpleMemobj::getSlavePort(const std::string& if_name, PortID idx) -{ - panic_if(idx != InvalidPortID, "This object doesn't support vector ports"); - - // This is the name from the Python SimObject declaration in SimpleCache.py - if (if_name == "inst_port") { + } else if (if_name == "inst_port") { return instPort; } else if (if_name == "data_port") { return dataPort; } else { // pass it along to our super class - return MemObject::getSlavePort(if_name, idx); + return MemObject::getPort(if_name, idx); } } |