本文整理汇总了C++中Gate::getOutputCtrlValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Gate::getOutputCtrlValue方法的具体用法?C++ Gate::getOutputCtrlValue怎么用?C++ Gate::getOutputCtrlValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gate
的用法示例。
在下文中一共展示了Gate::getOutputCtrlValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FaultActivate
bool Atpg::FaultActivate() { // TODO: TDF support
Gate *fg = &cir_->gates_[current_fault_->gate_];
int fline = current_fault_->line_;
if (fline) { // input stuck fault on GUT.
Value v = impl_->GetVal(fg->fis_[fline-1]);
if (v==X) { // faulted input at X?
Value objv = (current_fault_->type_==Fault::SA0
|| current_fault_->type_==Fault::STR)?H:L;
current_obj_.first = fg->fis_[fline-1];
current_obj_.second = objv;
}
else {
Value objv = fg->getOutputCtrlValue();
if (objv==X) assert(0); //NOT, PO, PPO, TODO: XOR, XNOR
current_obj_.first = fg->id_;
current_obj_.second = objv;
return true;
}
}
else {
Value objv = (current_fault_->type_==Fault::SA0
|| current_fault_->type_==Fault::STR)?H:L;
current_obj_.first = fg->id_;
current_obj_.second = objv;
return true;
}
}
示例2: Backtrace
bool Atpg::Backtrace() {
Gate *g = &cir_->gates_[current_obj_.first];
Value objv = current_obj_.second;
while (!(g->type_==Gate::PI
|| g->type_==Gate::PPI)) { // while objective net not fed by P/PI
if (g->getOutputCtrlValue()==X) { //NOT, BUF, TODO: XOR, XNOR
if (g->type_==Gate::INV)
objv = EvalNot(objv);
g = &cir_->gates_[g->fis_[0]];
assert(impl_->GetVal(g->id_)==X);
continue;
}
Gate *gnext = NULL;
if (objv==EvalNot(g->getOutputCtrlValue())) { // if objv is easy to set
// choose input of "g" which
// 1) is at X
// 2) is easiest to control
gnext = FindEasiestToSetFanIn(g, objv);
}
else if (objv==g->getOutputCtrlValue()) { // is objv is hard to set
// choose input of "g" which
// 1) is at X
// 2) is hardest to control
gnext = FindHardestToSetFanIn(g, objv);
}
if (g->isInverse())
objv = EvalNot(objv);
g = gnext;
}
return impl_->MakeDecision(g, objv);
}
示例3: DDrive
bool Atpg::DDrive() {
GateVec dfront;
impl_->GetDFrontier(dfront);
if (dfront.size()==0) return false;
Gate *fg = &cir_->gates_[current_fault_->gate_];
assert(impl_->GetVal(fg->id_)==D || impl_->GetVal(fg->id_)==B);
Gate *gtoprop = NULL;
int observ = INT_MAX;
for (size_t i=0; i<dfront.size(); i++)
if(dfront[i]->co_o_<observ) {
gtoprop = dfront[i];
observ = dfront[i]->co_o_;
}
assert(gtoprop->isUnary()==L);
current_obj_.first = gtoprop->id_;
current_obj_.second = gtoprop->getOutputCtrlValue();
return true;
}