Fix misc string handling issues.
This commit is contained in:
parent
2e5f5010f7
commit
ce4dfb4296
|
|
@ -2219,6 +2219,7 @@ private:
|
||||||
TREEOPV("AstExtend {$lhsp.castExtend}", "replaceExtend(nodep, nodep->lhsp()->castExtend()->lhsp())");
|
TREEOPV("AstExtend {$lhsp.castExtend}", "replaceExtend(nodep, nodep->lhsp()->castExtend()->lhsp())");
|
||||||
TREEOPV("AstExtendS{$lhsp.castExtendS}", "replaceExtend(nodep, nodep->lhsp()->castExtendS()->lhsp())");
|
TREEOPV("AstExtendS{$lhsp.castExtendS}", "replaceExtend(nodep, nodep->lhsp()->castExtendS()->lhsp())");
|
||||||
TREEOPV("AstReplicate{$lhsp, $rhsp.isOne, $lhsp->width()==nodep->width()}", "replaceWLhs(nodep)"); // {1{lhs}}->lhs
|
TREEOPV("AstReplicate{$lhsp, $rhsp.isOne, $lhsp->width()==nodep->width()}", "replaceWLhs(nodep)"); // {1{lhs}}->lhs
|
||||||
|
TREEOPV("AstReplicateN{$lhsp, $rhsp.isOne, $lhsp->width()==nodep->width()}", "replaceWLhs(nodep)"); // {1{lhs}}->lhs
|
||||||
// Next rule because AUTOINST puts the width of bits in
|
// Next rule because AUTOINST puts the width of bits in
|
||||||
// to pins, even when the widths are exactly the same across the hierarchy.
|
// to pins, even when the widths are exactly the same across the hierarchy.
|
||||||
TREEOPV("AstSel{operandSelExtend(nodep)}", "DONE");
|
TREEOPV("AstSel{operandSelExtend(nodep)}", "DONE");
|
||||||
|
|
|
||||||
|
|
@ -1392,9 +1392,6 @@ void EmitCImp::emitVarResets(AstNodeModule* modp) {
|
||||||
if (varp->isIO() && modp->isTop() && optSystemC()) {
|
if (varp->isIO() && modp->isTop() && optSystemC()) {
|
||||||
// System C top I/O doesn't need loading, as the lower level subinst code does it.
|
// System C top I/O doesn't need loading, as the lower level subinst code does it.
|
||||||
}
|
}
|
||||||
else if (varp->basicp() && varp->basicp()->keyword() == AstBasicDTypeKwd::STRING) {
|
|
||||||
// Constructor deals with it
|
|
||||||
}
|
|
||||||
else if (varp->isParam()) {
|
else if (varp->isParam()) {
|
||||||
if (!varp->valuep()) nodep->v3fatalSrc("No init for a param?");
|
if (!varp->valuep()) nodep->v3fatalSrc("No init for a param?");
|
||||||
// If a simple CONST value we initialize it using an enum
|
// If a simple CONST value we initialize it using an enum
|
||||||
|
|
@ -1413,6 +1410,9 @@ void EmitCImp::emitVarResets(AstNodeModule* modp) {
|
||||||
varp->v3fatalSrc("InitArray under non-arrayed var");
|
varp->v3fatalSrc("InitArray under non-arrayed var");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (varp->basicp() && varp->basicp()->keyword() == AstBasicDTypeKwd::STRING) {
|
||||||
|
// Constructor deals with it
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
int vects = 0;
|
int vects = 0;
|
||||||
// This isn't very robust and may need cleanup for other data types
|
// This isn't very robust and may need cleanup for other data types
|
||||||
|
|
|
||||||
|
|
@ -708,7 +708,9 @@ private:
|
||||||
// However a later operation may have changed the node->signed w/o changing
|
// However a later operation may have changed the node->signed w/o changing
|
||||||
// the number's sign. So we don't: nodep->dtypeChgSigned(nodep->num().isSigned());
|
// the number's sign. So we don't: nodep->dtypeChgSigned(nodep->num().isSigned());
|
||||||
if (vup && vup->c()->prelim()) {
|
if (vup && vup->c()->prelim()) {
|
||||||
if (nodep->num().sized()) {
|
if (nodep->num().isString()) {
|
||||||
|
nodep->dtypeSetString();
|
||||||
|
} else if (nodep->num().sized()) {
|
||||||
nodep->dtypeChgWidth(nodep->num().width(), nodep->num().width());
|
nodep->dtypeChgWidth(nodep->num().width(), nodep->num().width());
|
||||||
} else {
|
} else {
|
||||||
nodep->dtypeChgWidth(nodep->num().width(), nodep->num().widthMin());
|
nodep->dtypeChgWidth(nodep->num().width(), nodep->num().widthMin());
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,9 @@ class WidthCommitVisitor : public AstNVisitor {
|
||||||
public:
|
public:
|
||||||
// METHODS
|
// METHODS
|
||||||
static AstConst* newIfConstCommitSize (AstConst* nodep) {
|
static AstConst* newIfConstCommitSize (AstConst* nodep) {
|
||||||
if ((nodep->dtypep()->width() != nodep->num().width())
|
if (((nodep->dtypep()->width() != nodep->num().width())
|
||||||
|| !nodep->num().sized()) { // Need to force the number rrom unsized to sized
|
|| !nodep->num().sized())
|
||||||
|
&& !nodep->num().isString()) { // Need to force the number rrom unsized to sized
|
||||||
V3Number num (nodep->fileline(), nodep->dtypep()->width());
|
V3Number num (nodep->fileline(), nodep->dtypep()->width());
|
||||||
num.opAssign(nodep->num());
|
num.opAssign(nodep->num());
|
||||||
num.isSigned(nodep->isSigned());
|
num.isSigned(nodep->isSigned());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue