当前位置: 首页>>代码示例>>C++>>正文


C++ Gate::setFin1方法代码示例

本文整理汇总了C++中Gate::setFin1方法的典型用法代码示例。如果您正苦于以下问题:C++ Gate::setFin1方法的具体用法?C++ Gate::setFin1怎么用?C++ Gate::setFin1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gate的用法示例。


在下文中一共展示了Gate::setFin1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: multi_Layer

//Multi-Layer Construction
//J-You class must change to multiple WireList & GateList
//
void CirMgr::multi_Layer(size_t Layer=0){
	//TODO input the longest route
	size_t layerSize = Layer;
	size_t wireSize = WireList[0].size();
	size_t gateSize = GateList[0].size();
	size_t inputSize = InputList[0].size();
	size_t outputSize = OutputList[0].size();
	for(size_t i=0; i<layerSize; ++i){
		//i is previous levelu
		//i+1 is current level
		vector<Wire*> currentWireList;
		vector<Gate*> currentGateList;
		vector<Wire*> currentInputList;
		int in0, in1, out;
		for(size_t j=0; j<wireSize; ++j){	
			Wire* wire = new Wire(WireList[i][j]->getId());
			wire->setListNum(j);
			currentWireList.push_back(wire);
			/*if(j>=inputSize && j<outputSize+inputSize){
				currentWireList.push_back(wire);
			}*/
		}
        #ifdef DEBUG
        cerr << "constuct a layer, new current WireList[i]" << endl;
        #endif

		//input of newer
		if(i == 0){
			for(size_t k=0; k<inputSize; ++k){
				currentWireList[k]->setFin(0);
				currentInputList.push_back(currentWireList[k]);
			}
			InputList.push_back(currentInputList);
		}
        
        #ifdef DEBUG
        if(i==0){
        	cerr<< " Second layer input = " << endl;
            for(size_t j=0 ; j<inputSize ; ++j){
                cerr << currentInputList[j]->getId() << " ";
            }
        }
        #endif
		//gate implement
		for(size_t j=0; j<gateSize; ++j){
			Gate* gate = new Gate(GateList[i][j]->getType(),GateList[i][j]->getId(),0,0,0);
			#ifdef DEBUG
            cerr << "new Gate in gateList["<<i<<"][" << j << "] --FINISHED..." << endl;
            #endif

			in0 = GateList[i][j]->getFin0VecNum();
			out = GateList[i][j]->getFoutVecNum();
			if(in0<(int)inputSize){
				gate->setFin0(InputList[1][in0]);
				InputList[1][in0]->addFout(gate);
			}
			else{
				gate->setFin0(WireList[i][in0]);
				WireList[i][in0]->addFout(gate);
			}
			gate->setFout(currentWireList[out]);
			currentWireList[out]->setFin(gate);
			if(gate->getType()!="NOT1"){
				in1 = GateList[i][j]->getFin1VecNum();
				if(in1<(int)inputSize){
					gate->setFin1(InputList[1][in1]);
					InputList[1][in1]->addFout(gate);
				}
				else{
					gate->setFin1(WireList[i][in1]);
					WireList[i][in1]->addFout(gate);
				}
                setVNum(gate,out,in0,in1);
			}
			else{
                setVNum(gate,out,in0);
			}
			currentGateList.push_back(gate);
		}
		WireList.push_back(currentWireList);
		GateList.push_back(currentGateList);
	}
	#ifdef DEBUG
    cerr <<"Check All Gate"<< endl;
    
	for(size_t i=0;i<layerSize;++i){
		cerr<<"\n*********LAYER "<<i<<"*********\n"<<endl;
		for(size_t j=0;j<gateSize;++j){
			checkGate(GateList[i][j]);	
		}
	}
	#endif	
}
开发者ID:jackie840129,项目名称:CAD2016,代码行数:96,代码来源:cirMgr.cpp


注:本文中的Gate::setFin1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。