📄 oaverilogvalue.h
字号:
// *****************************************************************************// *****************************************************************************// oaVerilogValue.h//// This file contains the definition for the parser value class and its public// supporting classes. The parser value class implements a simple container // of values that may be manipulated by Verilog values.//// This file also contains the definitions for a list of values (ValueList) and// an iterator on that list (ValueListIter). The ValueList owns values// assigned to it. When the list is deleted, the values in the list are also// deleted.//// *****************************************************************************// Except as specified in the OpenAccess terms of use of Cadence or Silicon// Integration Initiative, this material may not be copied, modified,// re-published, uploaded, executed, or distributed in any way, in any medium,// in whole or in part, without prior written permission from Cadence.//// Copyright 2003-2005 Cadence Design Systems, Inc.// All Rights Reserved.//// $Author: sailajad $// $Revision: 1.21 $// $Date: 2005/08/05 21:48:55 $// $State: Exp $// *****************************************************************************// *****************************************************************************#ifndef oaVerilogValue_P#define oaVerilogValue_PBEGIN_VERILOG_NAMESPACE// *****************************************************************************// ValueTypeEnum// *****************************************************************************enum ValueTypeEnum { StringValue = 0, DecimalValue = 1, OctalValue = 2, HexValue = 3, BinaryValue = 4, DoubleValue = 5, PaddedBinaryValue = 6, NumAsStringValue = 7 };// *****************************************************************************// Value// *****************************************************************************class OA_VERILOG_DLL_API Value { public: Value(); Value(oaInt4 init); Value(oaUInt4 init); Value(const oaString &init); Value(const Value &init); Value(const oaString &initStr, ValueTypeEnum initType, oaUInt4 initNumBits); Value &operator=(const Value &rhs); Value &operator=(const oaInt4 rhs); Value &operator=(const oaUInt4 rhs); Value &operator=(const oaDouble rhs); Value &operator=(const oaString &rhs); Value &operator=(const oaChar *rhs); oaInt4 toInt() const; oaDouble toDouble() const; const oaString &toString(); const oaString getString() const; oaBoolean isString() const; oaUInt4 getNumBits() const; void setNumBits(oaUInt4 bits); void setType(ValueTypeEnum value); ValueTypeEnum getType() const; oaBoolean testBit(oaUInt4 index); static oaBoolean isNumber(const oaString &str); protected: static void convertToBinary(const oaString &input, const oaUInt4 numInputBits, const ValueTypeEnum inputType, oaString &output, oaUInt4 &numOutputBits, ValueTypeEnum &outputType); static void hexToBinary(const oaString &input, const oaUInt4 numInputBits, oaString &output); static void octalToBinary(const oaString &input, const oaUInt4 numInputBits, oaString &output); static void decimalToBinary(const oaString &input, const oaUInt4 numInputBits, oaString &output); static void stringToBinary(const oaString &input, const oaUInt4 numInputBits, oaString &output, oaUInt4 &numOutputBits); static ValueTypeEnum calcType(const oaChar c); static oaUInt4 calcNumBits(ValueTypeEnum valueType, const oaString &valueString); ValueTypeEnum type; oaUInt4 numBits; oaString sval;};// *****************************************************************************// List and Iterator for values.// *****************************************************************************// *****************************************************************************// ValueList// *****************************************************************************class OA_VERILOG_DLL_API ValueList : public std::list<Value*> { public: ValueList(); ~ValueList();};// *****************************************************************************// ValueListIter// *****************************************************************************typedef ValueList::const_iterator ValueListIter;END_VERILOG_NAMESPACE#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -