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/dev/net/sinic.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/dev/net/sinic.cc')
-rw-r--r-- | src/dev/net/sinic.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc index ce9fbb6a3..8d73d1542 100644 --- a/src/dev/net/sinic.cc +++ b/src/dev/net/sinic.cc @@ -142,16 +142,12 @@ Device::resetStats() _maxVnicDistance = 0; } -EtherInt* -Device::getEthPort(const std::string &if_name, int idx) +Port & +Device::getPort(const std::string &if_name, PortID idx) { - if (if_name == "interface") { - if (interface->getPeer()) - panic("interface already connected to\n"); - - return interface; - } - return NULL; + if (if_name == "interface") + return *interface; + return EtherDevBase::getPort(if_name, idx); } |