cv(NULL),
rf_cv(NULL),
value(value),
+ reads_from_value(VALUE_NONE),
type(type),
order(order),
original_order(order),
cv(NULL),
rf_cv(NULL),
value(value),
+ reads_from_value(VALUE_NONE),
type(type),
order(order),
original_order(order),
cv(NULL),
rf_cv(NULL),
value(value),
+ reads_from_value(VALUE_NONE),
type(type),
order(order),
original_order(order),
cv(NULL),
rf_cv(NULL),
value(value),
+ reads_from_value(VALUE_NONE),
type(type),
order(order),
original_order(order),
cv(NULL),
rf_cv(NULL),
value(value),
+ reads_from_value(VALUE_NONE),
type(type),
order(order),
original_order(order),
Thread *t = thread ? thread : thread_current();
this->tid = t->get_id();
- // model_print("position: %s\n", position);
}
uint64_t ModelAction::get_reads_from_value() const
{
ASSERT(is_read());
- if (reads_from)
- return reads_from->get_write_value();
+ if (reads_from) {
+ if (reads_from->is_uninitialized())
+ return reads_from_value;
+ else
+ return reads_from->get_write_value();
+ }
return VALUE_NONE; // Only for new actions with no reads-from
}
ASSERT(act);
reads_from = act;
-
if (act->is_uninitialized()) { // WL
uint64_t val = *((uint64_t *) location);
ModelAction * act_uninitialized = (ModelAction *)act;
act_uninitialized->set_value(val);
reads_from = act_uninitialized;
+ reads_from_value = val;
// disabled by WL, because LLVM IR is unable to detect atomic init
/* model->assert_bug("May read from uninitialized atomic:\n"
/** @brief The value written (for write or RMW; undefined for read) */
uint64_t value;
+ /** @brief The value this action read from (only used when reads_from is an
+ * uninitialized action) */
+ uint64_t reads_from_value;
+
/** @brief Type of action (read, write, RMW, fence, thread create, etc.) */
action_type type;