47 inst(inst_), thread(thread_), let(let_)
52 unsigned int num_defns =
let->
defns.size();
91 uint64_t arg_value =
arg->
eval(context);
95 case Enums::timingExprSizeInBits:
101 case Enums::timingExprNot:
102 ret = arg_value != 0;
104 case Enums::timingExprInvert:
107 case Enums::timingExprSignExtend32To64:
108 ret =
static_cast<int64_t
>(
109 static_cast<int32_t
>(arg_value));
111 case Enums::timingExprAbs:
112 if (static_cast<int64_t>(arg_value) < 0)
126 uint64_t left_value =
left->
eval(context);
127 uint64_t right_value =
right->
eval(context);
131 case Enums::timingExprAdd:
132 ret = left_value + right_value;
134 case Enums::timingExprSub:
135 ret = left_value - right_value;
137 case Enums::timingExprUMul:
138 ret = left_value * right_value;
140 case Enums::timingExprUDiv:
141 if (right_value != 0) {
142 ret = left_value / right_value;
145 case Enums::timingExprUCeilDiv:
146 if (right_value != 0) {
147 ret = (left_value + (right_value - 1)) / right_value;
150 case Enums::timingExprSMul:
151 ret =
static_cast<int64_t
>(left_value) *
152 static_cast<int64_t>(right_value);
154 case Enums::timingExprSDiv:
155 if (right_value != 0) {
156 ret =
static_cast<int64_t
>(left_value) /
157 static_cast<int64_t>(right_value);
160 case Enums::timingExprEqual:
161 ret = left_value == right_value;
163 case Enums::timingExprNotEqual:
164 ret = left_value != right_value;
166 case Enums::timingExprULessThan:
167 ret = left_value < right_value;
169 case Enums::timingExprUGreaterThan:
170 ret = left_value > right_value;
172 case Enums::timingExprSLessThan:
173 ret =
static_cast<int64_t
>(left_value) <
174 static_cast<int64_t>(right_value);
176 case Enums::timingExprSGreaterThan:
177 ret =
static_cast<int64_t
>(left_value) >
178 static_cast<int64_t>(right_value);
180 case Enums::timingExprAnd:
181 ret = (left_value != 0) && (right_value != 0);
183 case Enums::timingExprOr:
184 ret = (left_value != 0) || (right_value != 0);
195 uint64_t cond_value =
cond->
eval(context);
204 TimingExprLiteralParams::create()
210 TimingExprSrcRegParams::create()
216 TimingExprReadIntRegParams::create()
222 TimingExprLetParams::create()
228 TimingExprRefParams::create()
234 TimingExprUnParams::create()
240 TimingExprBinParams::create()
246 TimingExprIfParams::create()
TimingExprEvalContext(const StaticInstPtr &inst_, ThreadContext *thread_, TimingExprLet *let_)
uint64_t eval(TimingExprEvalContext &context)
Object to gather the visible context for evaluation.
uint64_t eval(TimingExprEvalContext &context)
uint64_t eval(TimingExprEvalContext &context)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
uint64_t eval(TimingExprEvalContext &context)
std::vector< uint64_t > results
TimingExprLet * let
Context visible as sub expressions.
virtual uint64_t readIntReg(int reg_idx)=0
std::vector< bool > resultAvailable
const StaticInstPtr & inst
Special visible context.
uint64_t eval(TimingExprEvalContext &context)
RegIndex srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
uint64_t eval(TimingExprEvalContext &context)
uint64_t eval(TimingExprEvalContext &context)
virtual uint64_t eval(TimingExprEvalContext &context)=0
std::vector< TimingExpr * > defns