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


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

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


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

示例1: throw

void 
Operator::addPort(
  const std::string name, const int width, 
  bool isIn,     bool isClk, 
  bool isRst,    bool isCE, 
  bool isSigned, bool isUnsigned, 
  bool isFP,     int  exp_sz,
  int  fra_sz,   bool isRegistered)
  throw(std::string)
{

	if (signalMap_.find(name) != signalMap_.end()) {
		std::ostringstream o;
		o << "ERROR in " << __FUNCTION__ << ", port: '" << name<< "' seems to already exist";
		throw o.str();
	}

/*
  std::cerr << "addPort( " << endl << \
    "\t name  = " << name  << endl << \
    "\t widht = " << width << endl << \
    "\t isIn  = " << isIn  << endl << \
    "\t isClk = " << isClk << endl << \
    "\t isRst = " << isRst << endl << \
    "\t isSign= " << isSigned << endl << \
    "\t isUnsi= " << isUnsigned << endl << \
    "\t isFP  = " << isFP << endl << \
    "\t exp_sz= " << exp_sz << endl << \
    "\t fra_sz= " << fra_sz << endl << \
    "\t isReg = " << isRegistered << ");"<< endl;
*/
  Signal::SignalType inout = Signal::in;
  if (isIn==0) { inout = Signal::out; }

  Signal *s;
  if (isFP==0) {
    s = new Signal(name, inout, width) ; 
  } else {
    s = new Signal(name, inout, exp_sz, fra_sz) ;
  }

  s->setClk(isClk);
  s->setRst(isRst);
  s->setCE(isCE);
  s->setSigned(isSigned);
  s->setUnsigned(isUnsigned);
  s->setRegistered(isRegistered);

  //isConst
  //Value

  // add signal to component
	ioList_.push_back(s);
	signalMap_[name] = s ;
	numberOfInputs_ ++;
}
开发者ID:BBBSnowball,项目名称:PivPav,代码行数:56,代码来源:Operator.cpp

示例2: addInput

void Operator::addInput(const std::string name, const int width, bool isBus) throw(std::string) {
	if (signalMap_.find(name) != signalMap_.end()) {
		std::ostringstream o;
		o << "ERROR in addInput, signal " << name<< " seems to already exist";
		throw o.str();
	}
	Signal *s = new Signal(name, Signal::in, width, isBus) ; // default TTL and cycle OK
  s->setClk(0);
  s->setRst(0);
  s->setCE(0);
  s->setSigned(0);
  s->setRegistered(0);
	ioList_.push_back(s);
	signalMap_[name] = s ;
	numberOfInputs_ ++;
}
开发者ID:BBBSnowball,项目名称:PivPav,代码行数:16,代码来源:Operator.cpp


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