修复了旧版的BUG
This commit is contained in:
parent
1a93b8a8a3
commit
17e95ded9b
10
c432.report
Normal file
10
c432.report
Normal 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
|
40
ls.cpp
40
ls.cpp
@ -332,7 +332,7 @@ void Circuit::ls_init_data_structs() {
|
||||
|
||||
|
||||
void Circuit::ls_block_recal(Gate* stem) {
|
||||
if(flip_need_update[stem->id]) {
|
||||
if(flip_need_update[stem->id]) {
|
||||
flip_need_update[stem->id] = false;
|
||||
flip_total_weight -= flip_weight[stem->id];
|
||||
flip_total_cnt -= 1;
|
||||
@ -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
34222
output.txt
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user