@@ -50,44 +50,44 @@ namespace olympia
50
50
TARGET_MISPREDICTION,
51
51
MISFETCH,
52
52
POST_SYNC,
53
- UKNOWN ,
53
+ UNKNOWN ,
54
54
__LAST
55
55
};
56
56
57
+ static bool determineInclusive (FlushCause cause)
58
+ {
59
+ static const std::map<FlushCause, bool > inclusive_flush_map = {
60
+ {FlushCause::TRAP, true },
61
+ {FlushCause::MISFETCH, true },
62
+ {FlushCause::MISPREDICTION, false },
63
+ {FlushCause::TARGET_MISPREDICTION, false },
64
+ {FlushCause::POST_SYNC, false }
65
+ };
66
+
67
+ if (auto match = inclusive_flush_map.find (cause); match != inclusive_flush_map.end ()) {
68
+ return match->second ;
69
+ }
70
+ sparta_assert (false , " Unknown flush cause: " << static_cast <uint16_t >(cause));
71
+ return false ;
72
+ }
73
+
57
74
class FlushingCriteria
58
75
{
59
76
public:
60
- FlushingCriteria (FlushCause cause, InstPtr inst_ptr) :
77
+ FlushingCriteria (FlushCause cause, const InstPtr & inst_ptr) :
61
78
cause_ (cause),
62
- inst_ptr_ (inst_ptr) {}
79
+ is_inclusive_ (determineInclusive(cause_)),
80
+ inst_ptr_ (inst_ptr)
81
+ {}
63
82
64
83
FlushingCriteria () = default ;
65
84
FlushingCriteria (const FlushingCriteria &rhs) = default ;
66
85
FlushingCriteria &operator =(const FlushingCriteria &rhs) = default ;
67
86
68
87
FlushCause getCause () const { return cause_; }
69
88
const InstPtr & getInstPtr () const { return inst_ptr_; }
70
-
71
- bool isInclusiveFlush () const
72
- {
73
- static const std::map<FlushCause, bool > inclusive_flush_map = {
74
- {FlushCause::TRAP, true },
75
- {FlushCause::MISFETCH, true },
76
- {FlushCause::MISPREDICTION, false },
77
- {FlushCause::TARGET_MISPREDICTION, false },
78
- {FlushCause::POST_SYNC, false }
79
- };
80
- if (auto match = inclusive_flush_map.find (cause_); match != inclusive_flush_map.end ()) {
81
- return match->second ;
82
- }
83
- sparta_assert (false , " Unknown flush cause: " << static_cast <uint16_t >(cause_));
84
- return true ;
85
- }
86
-
87
- bool isLowerPipeFlush () const
88
- {
89
- return cause_ == FlushCause::MISFETCH;
90
- }
89
+ bool isInclusiveFlush () const { return is_inclusive_; }
90
+ bool isLowerPipeFlush () const { return cause_ == FlushCause::MISFETCH; }
91
91
92
92
bool includedInFlush (const InstPtr& other) const
93
93
{
@@ -97,11 +97,12 @@ namespace olympia
97
97
}
98
98
99
99
private:
100
- FlushCause cause_ = FlushCause::UKNOWN;
100
+ // Cannot be const since these are copied into the PLE
101
+ FlushCause cause_ = FlushCause::UNKNOWN;
102
+ bool is_inclusive_ = false ;
101
103
InstPtr inst_ptr_;
102
104
};
103
105
104
-
105
106
static constexpr char name[] = " flushmanager" ;
106
107
107
108
class FlushManagerParameters : public sparta ::ParameterSet
@@ -202,8 +203,8 @@ namespace olympia
202
203
case FlushManager::FlushCause::POST_SYNC:
203
204
os << " POST_SYNC" ;
204
205
break ;
205
- case FlushManager::FlushCause::UKNOWN :
206
- os << " UKNOWN " ;
206
+ case FlushManager::FlushCause::UNKNOWN :
207
+ os << " UNKNOWN " ;
207
208
break ;
208
209
case FlushManager::FlushCause::__LAST:
209
210
throw sparta::SpartaException (" __LAST cannot be a valid enum state." );
0 commit comments