bug fix
authorroot <root@dw-6.eecs.uci.edu>
Wed, 31 Jul 2019 04:12:43 +0000 (21:12 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Wed, 31 Jul 2019 04:12:43 +0000 (21:12 -0700)
cmodelint.cc
execution.cc
stl-model.h

index b39e15b..cbf2132 100644 (file)
@@ -111,7 +111,11 @@ VOLATILELOAD(64)
                ensureModel();                                                      \
                model->switch_to_master(new ModelAction(ATOMIC_WRITE, position, memory_order_relaxed, obj, (uint64_t) val)); \
                *((volatile uint ## size ## _t *)obj) = val;            \
-       }
+               thread_id_t tid = thread_current()->get_id();           \
+               for(int i=0;i < size / 8;i++) {                         \
+                       recordWrite(tid, (void *)(((char *)obj)+i));          \
+               }                                                       \
+}
 
 VOLATILESTORE(8)
 VOLATILESTORE(16)
index 50e052a..4296895 100644 (file)
@@ -1161,11 +1161,11 @@ void ModelExecution::add_action_to_lists(ModelAction *act)
 void insertIntoActionList(action_list_t *list, ModelAction *act) {
        sllnode<ModelAction*> * rit = list->end();
        modelclock_t next_seq = act->get_seq_number();
-       if (rit == NULL || (rit->getVal())->get_seq_number() == next_seq)
+       if (rit == NULL || (rit->getVal()->get_seq_number() == next_seq))
                list->push_back(act);
        else {
                for(;rit != NULL;rit=rit->getPrev()) {
-                       if ((rit->getVal())->get_seq_number() == next_seq) {
+                       if (rit->getVal()->get_seq_number() == next_seq) {
                                list->insertAfter(rit, act);
                                break;
                        }
@@ -1654,7 +1654,7 @@ Thread * ModelExecution::take_step(ModelAction *curr)
        ASSERT(curr);
 
        /* Process this action in ModelHistory for records*/
-       model->get_history()->process_action( curr, curr->get_tid() );
+       //      model->get_history()->process_action( curr, curr->get_tid() );
 
        if (curr_thrd->is_blocked() || curr_thrd->is_complete())
                scheduler->remove_thread(curr_thrd);
index 74aaee6..7049096 100644 (file)
@@ -126,7 +126,7 @@ public:
                if (tail == node) {
                        tail = node->prev;
                } else {
-                       tail->next->prev = node->prev;
+                       node->next->prev = node->prev;
                }
                mllnode<_Tp> *next = node->next;
                delete node;
@@ -284,7 +284,7 @@ public:
                if (tail == node) {
                        tail = node->prev;
                } else {
-                       tail->next->prev = node->prev;
+                       node->next->prev = node->prev;
                }
 
                sllnode<_Tp> *next = node->next;
@@ -346,7 +346,7 @@ public:
        }
 
        type back() const {
-               return array[size - 1];
+               return array[_size - 1];
        }
 
        void resize(uint psize) {