修复了旧版的BUG

This commit is contained in:
YuhangQ 2023-03-03 07:33:14 +00:00
parent 1a93b8a8a3
commit 17e95ded9b
4 changed files with 18167 additions and 16105 deletions

BIN
atpg

Binary file not shown.

10
c432.report Normal file
View File

@ -0,0 +1,10 @@
gates: 160
primary input: 36
primary output: 7
simulate patterns: 0
final patterns: 77
faults: 524
detect faults: 520
redundant faults: 0
test coverage:0.992
time: 0.00859

38
ls.cpp
View File

@ -360,12 +360,30 @@ void Circuit::ls_block_recal(Gate* stem) {
fault_total_weight += fault_weight[stem->id][!stem->value];
fault_total_cnt += 1;
stem->sa[!stem->value] = true;
for(Gate* pre : stem->pre_stems) {
if(flip_need_update[pre->id]) continue;
flip_need_update[pre->id] = true;
flip_update_queue.push_back(pre);
flip_total_weight += flip_weight[pre->id];
flip_total_cnt += 1;
}
}
if(stem->sa[stem->value] == true) {
fault_total_weight -= fault_weight[stem->id][stem->value];
fault_total_cnt -= 1;
stem->sa[stem->value] = false;
for(Gate* pre : stem->pre_stems) {
if(flip_need_update[pre->id]) continue;
flip_need_update[pre->id] = true;
flip_update_queue.push_back(pre);
flip_total_weight += flip_weight[pre->id];
flip_total_cnt += 1;
}
}
}
@ -402,32 +420,12 @@ void Circuit::ls_block_recal(Gate* stem) {
stem_satisfied[stem->id] = true;
stem_total_weight -= stem_weight[stem->id];
stem_total_cnt += 1;
for(Gate* pre : stem->pre_stems) {
if(flip_need_update[pre->id]) continue;
flip_need_update[pre->id] = true;
flip_update_queue.push_back(pre);
flip_total_weight += flip_weight[pre->id];
flip_total_cnt += 1;
}
}
if(stem->cal_value() != stem->value && stem_satisfied[stem->id]) {
stem_satisfied[stem->id] = false;
stem_total_weight += stem_weight[stem->id];
stem_total_cnt -= 1;
for(Gate* pre : stem->pre_stems) {
if(flip_need_update[pre->id]) continue;
flip_need_update[pre->id] = true;
flip_update_queue.push_back(pre);
flip_total_weight += flip_weight[pre->id];
flip_total_cnt += 1;
}
}
}

34222
output.txt

File diff suppressed because it is too large Load Diff