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


C++ Signal::delayedName方法代码示例

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


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

示例1: buildVHDLRegisters

string  Operator::buildVHDLRegisters() {
	ostringstream o,l;

	if (isSequential()){

  if(getClkName().compare("") == 0) {
    std::cerr << "-- Can't find clock port for sequential component" << std::endl;
    return "";
  }

    std::string clk = getClkName();
    o << "-- clkname = " << clk << endl;
		o << tab << "process("<< clk <<")  begin\n"
		  << tab << tab << "if "<< clk << "'event and "<< clk <<"= '1' then\n";
		for(unsigned int i=0; i<signalList_.size(); i++) {
			Signal *s = signalList_[i];
			if(s->getLifeSpan() >0) {
				for(int j=1; j <= s->getLifeSpan(); j++)
					l << tab <<tab << tab << s->delayedName(j) << " <=  " << s->delayedName(j-1) <<";" << endl;
			}
		}
    // when there are not registers then we don't need that process stmnt
    if (l.str().compare("") == 0) return l.str();
    o << l.str();
		o << tab << tab << "end if;\n";
		o << tab << "end process;\n"; 
	}
	return o.str();
}
开发者ID:BBBSnowball,项目名称:PivPav,代码行数:29,代码来源:Operator.cpp

示例2: use

string Operator::use(string name) throw(std::string) {
	ostringstream e;
	e << "ERROR in use(), "; // just in case
	
	if(isSequential()) {
		Signal *s;
		try {
			s=getSignalByName(name);
		}
		catch (string e2) {
			e << endl << tab << e2;
			throw e.str();
		}
		if(s->getCycle() < 0) {
			e << "signal " << name<< " doesn't have (yet?) a valid cycle";
			throw e.str();
		} 
		if(s->getCycle() > currentCycle_) {
			ostringstream e;
			e << "active cycle of signal " << name<< " is later than current cycle, cannot delay it";
			throw e.str();
		} 
		// update the lifeSpan of s
		s->updateLifeSpan( currentCycle_ - s->getCycle() );
		return s->delayedName( currentCycle_ - s->getCycle() );
	}
	else
		return name;
}
开发者ID:BBBSnowball,项目名称:PivPav,代码行数:29,代码来源:Operator.cpp

示例3: inPortMap

void Operator::inPortMap(Operator* op, string componentPortName, string actualSignalName) throw(std::string) {
	Signal* formal;
	ostringstream e;
	string name;
	e << "ERROR in inPortMap(), "; // just in case
	
	if(isSequential()) {
		Signal *s;
		try {
			s=getSignalByName(actualSignalName);
		}
		catch (string e2) {
			e << endl << tab << e2;
			throw e.str();
		}
		if(s->getCycle() < 0) {
			ostringstream e;
			e << "signal " << actualSignalName<< " doesn't have (yet?) a valid cycle";
			throw e.str();
		} 
		if(s->getCycle() > currentCycle_) {
			ostringstream e;
			e << "active cycle of signal " << actualSignalName<< " is later than current cycle, cannot delay it";
			throw e.str();
		} 
		// update the lifeSpan of s
		s->updateLifeSpan( currentCycle_ - s->getCycle() );
		name = s->delayedName( currentCycle_ - s->getCycle() );
	}
	else
		name = actualSignalName;

	try {
		formal=op->getSignalByName(componentPortName);
	}
	catch (string e2) {
		e << endl << tab << e2;
		throw e.str();
	}
	if (formal->type()!=Signal::in){
		e << "signal " << componentPortName << " of component " << op->getName() 
		  << " doesn't seem to be an input port";
		throw e.str();
	}

	// add the mapping to the mapping list of Op
	op->portMap_[componentPortName] = name;
}
开发者ID:BBBSnowball,项目名称:PivPav,代码行数:48,代码来源:Operator.cpp


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