const bool V3Ntk::reportUnexpectedFaninSize(const V3GateType& type, const V3NetId& id) const { assert (type < V3_XD); assert (validNetId(id)); if (((isV3ReducedType(type) || BV_CONST == type || V3_PIO == type) && (getInputNetSize(id) != 1)) || ((isV3PairType(type) || AIG_NODE == type || V3_FF == type || BV_SLICE == type) && (getInputNetSize(id) != 2)) || ((BV_MUX == type) && (getInputNetSize(id) != 3)) || ((V3_MODULE == type) && (getInputNetSize(id) != 1))) Msg(MSG_ERR) << "Expecting Fanin Size is One while " << getInputNetSize(id) << " is Found @ " << id.id << " for Gate Type = " << V3GateTypeStr[type] << endl; else return false; return true; }
void V3Ntk::buildBdd(const V3NetId& netId) { V3NetVec orderedNets; orderedNets.clear(); orderedNets.reserve(getNetSize()); newMiscData(); dfsOrder(netId, orderedNets); assert (orderedNets.size() <= getNetSize()); // TODO: build BDD for the specified net here for(unsigned i=0;i<orderedNets.size();i++){ V3NetId& netid= orderedNets[i]; BddNodeV b = bddMgrV->getBddNodeV(netid.id); /* if(!bddMgrV->addBddNodeV(netid.id,b())){ continue; }*/ //cout<<"id:"<<netid.id<<" cp:"<<netid.cp<<endl; //cout<<"type:"<<V3GateTypeStr[getGateType(netid)]<<endl; //cout<<"inputnetsize:"<<getInputNetSize(netid)<<endl; //BddNodeV b = bddMgrV->getBddNodeV(netid.id); if( getGateType(netid)==AIG_NODE ){ assert(getInputNetSize(netid)==2); V3NetId in1=getInputNetId(netid, 0); BddNodeV b1 = bddMgrV->getBddNodeV(in1.id); V3NetId in2=getInputNetId(netid, 1); BddNodeV b2 = bddMgrV->getBddNodeV(in2.id); //cout<<"input:"<<endl; //cout<<in1.id<<" "<<in1.cp<<endl; //cout<<in2.id<<" "<<in2.cp<<endl; /* if (b1() == 0){ buildBdd(in1); } if (b2() == 0){ buildBdd(in2); }*/ if(in1.cp){ b1= ~b1; } if(in2.cp){ b2= ~b2; } b = b1& b2; } else if(getGateType(netid)==V3_FF) { V3NetId in1=getInputNetId(netid, 0); BddNodeV b1 = bddMgrV->getBddNodeV(in1.id); // cout<<"input:"<<endl; // cout<<"input_type:"<<V3GateTypeStr[getGateType(in1)]<<endl; // cout<<in1.id<<" "<<in1.cp<<endl; /* if (b1() == 0){ buildBdd(in1); }*/ if(in1.cp){ // b1= ~b1; } // b = b1;//BddNodeV::_zero; } if(netid.cp){ // b=~b; } bddMgrV->addBddNodeV(netid.id,b()); // cout<<"bdd:"<<b<<endl; } }