atomic.hh (10913:38dbdeea7f1f) atomic.hh (11147:cc8d6e99cf46)
1/*
1/*
2 * Copyright (c) 2012-2013 ARM Limited
2 * Copyright (c) 2012-2013,2015 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 28 unchanged lines hidden (view full) ---

39 *
40 * Authors: Steve Reinhardt
41 */
42
43#ifndef __CPU_SIMPLE_ATOMIC_HH__
44#define __CPU_SIMPLE_ATOMIC_HH__
45
46#include "cpu/simple/base.hh"
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 28 unchanged lines hidden (view full) ---

39 *
40 * Authors: Steve Reinhardt
41 */
42
43#ifndef __CPU_SIMPLE_ATOMIC_HH__
44#define __CPU_SIMPLE_ATOMIC_HH__
45
46#include "cpu/simple/base.hh"
47#include "cpu/simple/exec_context.hh"
47#include "params/AtomicSimpleCPU.hh"
48#include "sim/probe/probe.hh"
49
50class AtomicSimpleCPU : public BaseSimpleCPU
51{
52 public:
53
54 AtomicSimpleCPU(AtomicSimpleCPUParams *params);

--- 36 unchanged lines hidden (view full) ---

91 * call. The only way this can happen at the moment is if
92 * there is an event in the PC event queue that affects the
93 * CPU state while it is in an LLSC region.
94 *
95 * <li>Stay at PC is true.
96 * </ul>
97 */
98 bool isDrained() {
48#include "params/AtomicSimpleCPU.hh"
49#include "sim/probe/probe.hh"
50
51class AtomicSimpleCPU : public BaseSimpleCPU
52{
53 public:
54
55 AtomicSimpleCPU(AtomicSimpleCPUParams *params);

--- 36 unchanged lines hidden (view full) ---

92 * call. The only way this can happen at the moment is if
93 * there is an event in the PC event queue that affects the
94 * CPU state while it is in an LLSC region.
95 *
96 * <li>Stay at PC is true.
97 * </ul>
98 */
99 bool isDrained() {
99 return microPC() == 0 &&
100 SimpleExecContext &t_info = *threadInfo[curThread];
101
102 return t_info.thread->microPC() == 0 &&
100 !locked &&
103 !locked &&
101 !stayAtPC;
104 !t_info.stayAtPC;
102 }
103
104 /**
105 * Try to complete a drain request.
106 *
107 * @returns true if the CPU is drained, false otherwise.
108 */
109 bool tryCompleteDrain();

--- 104 unchanged lines hidden ---
105 }
106
107 /**
108 * Try to complete a drain request.
109 *
110 * @returns true if the CPU is drained, false otherwise.
111 */
112 bool tryCompleteDrain();

--- 104 unchanged lines hidden ---