From: Gabe Black Date: Sat, 17 Aug 2019 06:14:50 +0000 (-0700) Subject: sim: Add a << overload for the Port class which prints its name. X-Git-Tag: v19.0.0.0~628 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4f31b261cdda95fe6e5a5a71ce232ee479686ae;p=gem5.git sim: Add a << overload for the Port class which prints its name. This makes it easier/less verbose to print the name of a port, it's most important and identifying feature, in a DPRINTF or other stream based output. Change-Id: I050d102844612577f9a83d550e619736507a6781 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20234 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Reviewed-by: Nikos Nikoleris Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- diff --git a/src/sim/port.hh b/src/sim/port.hh index 111417263..2acdb7a78 100644 --- a/src/sim/port.hh +++ b/src/sim/port.hh @@ -147,4 +147,11 @@ class Port } }; +static inline std::ostream & +operator << (std::ostream &os, const Port &port) +{ + os << port.name(); + return os; +} + #endif //__SIM_PORT_HH__