void clbr::ClbrFile::readCN() { wxString wxCellName; if (moreData()) wxCellName = _textStream->ReadWord(); std::string cellName = std::string(wxCellName.mb_str(wxConvUTF8)); if (moreData(false)) { int nextChar; do { nextChar = _inStream->GetC(); //_textStream->GetChar } while (isspace(nextChar)); if ('c' == (char) nextChar) { // local CTM int ctmraw[6]; for (unsigned int vrtx = 0; vrtx < 6; vrtx++) { if (moreData()) ctmraw[vrtx] = _textStream->Read32(); } CTM cCtm(ctmraw[0], ctmraw[1], ctmraw[2], ctmraw[3], ctmraw[4], ctmraw[5]); _cCell->registerRuleRead( _cRuleName, _cRule); _cCell = _drcDB->registerCellRead(cellName, cCtm); _cRule = _cCell->cloneRule(_cRule); } else throw EXPTNdrc_reader("Expected valid CN (Cell Name) record"); } }
bool clbr::ClbrFile::checkCNnP() { int nextChar; std::string cnLine; if (moreData()) nextChar = _inStream->GetC(); if (isdigit(nextChar) || ('-' == (char) nextChar)) { _inStream->Ungetch((char) nextChar); return true; } else if ('C' != (char) nextChar) { _inStream->Ungetch((char) nextChar);// - should be a property! } else { if (moreData()) nextChar = _inStream->GetC(); if ('N' != (char) nextChar) { _inStream->Ungetch((char) nextChar);// - should be a property! } else { readCN(); return true; } } std::string property = getTextLine();// TODO parse a property return false; }
void clbr::ClbrFile::ruleMetaData() { assert(_cRule); if (moreData()) _cRule->setCurResCount(_textStream->Read32()); if (moreData()) _cRule->setOrigResCount(_textStream->Read32()); unsigned int numInfoLines; if (moreData()) numInfoLines = _textStream->Read32(); _cRule->setTimeStamp(getTextLine()); for (unsigned int i = 0; i < numInfoLines; i++) { _cRule->addDescrString(getTextLine()); } }
auxdata::DrcPoly* clbr::ClbrFile::drcPoly() { unsigned int ordinal; unsigned int numVrtx; if (moreData()) ordinal = _textStream->Read32(); if (moreData()) numVrtx = _textStream->Read32(); int4b* pdata = DEBUG_NEW int4b[2*numVrtx]; while (!checkCNnP()) {}; for (unsigned int vrtx = 0; vrtx < 2*numVrtx; vrtx++) { if (moreData()) pdata[vrtx] = _textStream->Read32(); } return DEBUG_NEW auxdata::DrcPoly(pdata, numVrtx, ordinal); }
auxdata::DrcSeg* clbr::ClbrFile::drcEdge() { unsigned int ordinal; unsigned int numEdgs; if (moreData()) ordinal = _textStream->Read32(); if (moreData()) numEdgs = _textStream->Read32(); while (!checkCNnP()) {}; int4b* pdata = DEBUG_NEW int4b [numEdgs * 4]; for (unsigned int vrtx = 0; vrtx < numEdgs * 4; vrtx++) { if (moreData()) pdata[vrtx] = _textStream->Read32(); } return DEBUG_NEW auxdata::DrcSeg(pdata, numEdgs, ordinal); }
NABoolean CmpStatementISP::readyToDie() { if ( exceptionRaised_ || !moreData() ) return TRUE; else return FALSE; }
//! [0] PushStream::PushStream(QObject *parent) : AbstractMediaStream(parent), m_timer(new QTimer(this)) { setStreamSize(getMediaStreamSize()); connect(m_timer, SIGNAL(timeout()), SLOT(moreData())); m_timer->setInterval(0); }
std::string clbr::ClbrFile::getTextLine() { if (moreData()) { wxString wxWord = _textStream->ReadLine(); return std::string(wxWord.mb_str(wxConvUTF8)); } return ""; }
//============================================================================= clbr::ClbrFile::ClbrFile(wxString wxfname, DrcLibrary*& drcDB) : InputDBFile (wxfname, false) { std::ostringstream info; if (!status()) { throw EXPTNdrc_reader("Failed to open the input file"); } info << "Parsing \"" << fileName() << "\" using ASCII DRC grammar)"; tell_log(console::MT_INFO,info.str()); _textStream = DEBUG_NEW wxTextInputStream(*_inStream); real precision; std::string cellName = getTextWord(); if (moreData()) precision = _textStream->ReadDouble(); _drcDB = drcDB = DEBUG_NEW DrcLibrary(cellName, precision); CTM defCtm; DrcCell* topCell = _drcDB->registerCellRead(cellName, defCtm); // Now parse the rules do // i.e. at least one rule is expected { // Get the rule name and create a drcRuleCheck object with it // It is considered that at this point is legal to finish the file // That's why getTextWord() is not used, it might throw an exception if (moreData(false)) { wxString wxRuleName = _textStream->ReadWord(); _cRuleName = std::string(wxRuleName.mb_str(wxConvUTF8)); if (_cRuleName.empty()) break; else _cRule = DEBUG_NEW DrcRule(); } else break; // For every new rule reset the value of the current cell _cCell = topCell; ruleMetaData(); ruleDrcResults(); _cCell->registerRuleRead( _cRuleName, _cRule); } while (true); }
void PushStream::needData() { m_timer->start(); moreData(); }