mirror of
https://github.com/verilator/verilator.git
synced 2025-01-08 15:47:36 +00:00
Internal cleanup: Prep for strings
This commit is contained in:
parent
e40b5819bd
commit
b6447a9032
@ -42,11 +42,14 @@ using namespace std;
|
||||
//=========================================================================
|
||||
// Basic types
|
||||
|
||||
typedef vluint8_t CData; ///< Verilated data, 1-8 bits
|
||||
typedef vluint16_t SData; ///< Verilated data, 9-16 bits
|
||||
typedef vluint32_t IData; ///< Verilated data, 17-32 bits
|
||||
typedef vluint64_t QData; ///< Verilated data, 33-64 bits
|
||||
typedef vluint32_t WData; ///< Verilated data, >64 bits, as an array
|
||||
typedef vluint8_t CData; ///< Verilated pack data, 1-8 bits
|
||||
typedef vluint16_t SData; ///< Verilated pack data, 9-16 bits
|
||||
typedef vluint32_t IData; ///< Verilated pack data, 17-32 bits
|
||||
typedef vluint64_t QData; ///< Verilated pack data, 33-64 bits
|
||||
typedef vluint32_t WData; ///< Verilated pack data, >64 bits, as an array
|
||||
// float F // No typedef needed; Verilator uses float
|
||||
// double G // No typedef needed; Verilator uses double
|
||||
// string N // No typedef needed; Verilator uses double
|
||||
|
||||
typedef const WData* WDataInP; ///< Array input to a function
|
||||
typedef WData* WDataOutP; ///< Array output from a function
|
||||
|
14
src/V3Ast.h
14
src/V3Ast.h
@ -228,7 +228,7 @@ public:
|
||||
static const char* names[] = {
|
||||
"unsigned char", "char", "void*", "int", "int", "svLogic", "long long",
|
||||
"double", "double", "short int", "float", "long long",
|
||||
"char*",
|
||||
"const char*",
|
||||
"dpiScope", "const char*",
|
||||
""
|
||||
};
|
||||
@ -253,23 +253,23 @@ public:
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
int isSigned() const {
|
||||
bool isSigned() const {
|
||||
return m_e==BYTE || m_e==SHORTINT || m_e==INT || m_e==LONGINT || m_e==INTEGER;
|
||||
}
|
||||
int isFourstate() const {
|
||||
bool isFourstate() const {
|
||||
return m_e==INTEGER || m_e==LOGIC || m_e==LOGIC_IMPLICIT;
|
||||
}
|
||||
int isZeroInit() const { // Otherwise initializes to X
|
||||
bool isZeroInit() const { // Otherwise initializes to X
|
||||
return (m_e==BIT || m_e==BYTE || m_e==CHANDLE || m_e==INT || m_e==LONGINT || m_e==SHORTINT
|
||||
|| m_e==STRING);
|
||||
}
|
||||
int isSloppy() const { // Don't be as anal about width warnings
|
||||
bool isSloppy() const { // Don't be as anal about width warnings
|
||||
return !(m_e==LOGIC || m_e==BIT);
|
||||
}
|
||||
int isBitLogic() const { // Don't be as anal about width warnings
|
||||
bool isBitLogic() const { // Don't be as anal about width warnings
|
||||
return (m_e==LOGIC || m_e==BIT);
|
||||
}
|
||||
int isDpiUnsupported() const {
|
||||
bool isDpiUnsupported() const {
|
||||
return (m_e==LOGIC || m_e==TIME || m_e==REALTIME);
|
||||
}
|
||||
};
|
||||
|
@ -1590,7 +1590,7 @@ struct AstFOpen : public AstNodeStmt {
|
||||
setOp3p(modep);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(FOpen, FOPEN)
|
||||
virtual string verilogKwd() const { return "$fclose"; }
|
||||
virtual string verilogKwd() const { return "$fopen"; }
|
||||
virtual bool isGateOptimizable() const { return false; }
|
||||
virtual bool isPredictOptimizable() const { return false; }
|
||||
virtual bool isSplittable() const { return false; }
|
||||
|
@ -74,6 +74,7 @@ public:
|
||||
void emitVarCtors();
|
||||
bool emitSimpleOk(AstNodeMath* nodep);
|
||||
void emitIQW(AstNode* nodep) {
|
||||
// Other abbrevs: "C"har, "S"hort, "F"loat, "G"double, stri"N"g
|
||||
puts (nodep->isWide()?"W":(nodep->isQuad()?"Q":"I"));
|
||||
}
|
||||
void emitScIQW(AstVar* nodep) {
|
||||
|
@ -82,6 +82,8 @@ module t (/*AUTOARG*/
|
||||
|
||||
con__ascii = "abcdefghijklmnop";
|
||||
if ( con__ascii !== {"abcd","efgh","ijkl","mnop"}) $stop;
|
||||
con__ascii = "abcdefghijklm";
|
||||
if ( con__ascii !== {24'h0,"a","bcde","fghi","jklm"}) $stop;
|
||||
|
||||
if ( 3'dx !== 3'hx) $stop;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user