From 97c33d677f0130116ca40ca2e54a6aec7ad14961 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 15 Feb 2018 15:15:22 +0000 Subject: cpu: Avoid unnecessary dynamic_pointer_cast in atomic model In the atomic model a dynamic_pointer_cast is performed at every tick to check if the fault is a SyscallRetryFault. This was happening even when there was no generated fault. Change-Id: I7f4afeffffdf4f988230e05286602d8d9a919c6c Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/10101 Reviewed-by: Brandon Potter Reviewed-by: Jason Lowe-Power Maintainer: Andreas Sandberg --- src/cpu/simple/atomic.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index bc7670b23..7a368ab32 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -628,7 +628,8 @@ AtomicSimpleCPU::tick() traceData = NULL; } - if (dynamic_pointer_cast(fault)) { + if (fault != NoFault && + dynamic_pointer_cast(fault)) { // Retry execution of system calls after a delay. // Prevents immediate re-execution since conditions which // caused the retry are unlikely to change every tick. -- cgit v1.2.3