diff options
author | Gabe Black <gabeblack@google.com> | 2019-08-17 01:40:39 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-08-28 08:25:51 +0000 |
commit | 7584c390ebbb890642468a7cfd40aaa52699684e (patch) | |
tree | 205c6735a3a8460249dfe57308996cab06e811a3 /src/cpu/o3/cpu.hh | |
parent | 642489740985f2804e8229c69edeb46f2432d8f9 (diff) | |
download | gem5-7584c390ebbb890642468a7cfd40aaa52699684e.tar.xz |
cpu: Make get(Data|Inst)Port return a Port and not a MasterPort.
No caller uses any of the MasterPort specific properties of these
function's return values, so we can instead return a reference to the
base Port class. This makes it possible for the data and inst ports
to be of any port type, not just gem5 style MasterPorts. This makes
life simpler for, for example, systemc based CPUs which might have TLM
ports.
It also makes it possible for any two CPUs which have compatible ports
to be switched between, as long as the ports they use support being
unbound. Unfortunately that does not include TLM or systemc ports which
are bound permanently.
Change-Id: I98fce5a16d2ef1af051238e929dd96d57a4ac838
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20240
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/cpu/o3/cpu.hh')
-rw-r--r-- | src/cpu/o3/cpu.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 58a22184d..ac917dba9 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -735,14 +735,14 @@ class FullO3CPU : public BaseO3CPU } /** Used by the fetch unit to get a hold of the instruction port. */ - MasterPort & + Port & getInstPort() override { return this->fetch.getInstPort(); } /** Get the dcache port (used to find block size for translations). */ - MasterPort & + Port & getDataPort() override { return this->iew.ldstQueue.getDataPort(); |