diff --git a/atpg b/atpg index 77fcaa4..c0c2232 100755 Binary files a/atpg and b/atpg differ diff --git a/src/ls.cpp b/src/ls.cpp index 6c86f5c..2689218 100644 --- a/src/ls.cpp +++ b/src/ls.cpp @@ -123,23 +123,34 @@ void Circuit::ls_update_weight() { } } + for(Gate* g : gates) { + if(!g->fault_detected[0]) { + g->fault_detected_weight[0] += 1; + g->fault_propagated_weight[0] += 1; + } + if(!g->fault_detected[1]) { + g->fault_detected_weight[1] += 1; + g->fault_propagated_weight[1] += 1; + } + } + for(Gate* g : detected_unsatisfied_vars) { - g->fault_detected_unsatisfied_cost[0] += g->level; - g->fault_detected_unsatisfied_cost[1] += g->level; + g->fault_detected_unsatisfied_cost[0] += 1; + g->fault_detected_unsatisfied_cost[1] += 1; for(Gate* r : g->score_reigon) { gates_need_recal_score.insert(r); } } for(Gate* g : propagated_unsatisfied_vars) { - g->fault_propagated_unsatisfied_cost[0] += g->level; - g->fault_propagated_unsatisfied_cost[1] += g->level; + g->fault_propagated_unsatisfied_cost[0] += 1; + g->fault_propagated_unsatisfied_cost[1] += 1; for(Gate* r : g->score_reigon) { gates_need_recal_score.insert(r); } } - for(Gate *g : gates_need_recal_score) { + for(Gate *g : gates) { g->cal_score(); }