forked from github/verilator
Fix parameter pin vs. normal pin error, bug704.
This commit is contained in:
parent
00724597f4
commit
5d233b8c09
2
Changes
2
Changes
@ -11,6 +11,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||
|
||||
**** Fix some delayed assignments of typedefed unpacked arrays.
|
||||
|
||||
**** Fix parameter pin vs. normal pin error, bug704. [Alex Solomatnikov]
|
||||
|
||||
|
||||
* Verilator 3.854 2013-11-26
|
||||
|
||||
|
@ -1273,17 +1273,18 @@ private:
|
||||
int m_pinNum; // Pin number
|
||||
string m_name; // Pin name, or "" for number based interconnect
|
||||
AstVar* m_modVarp; // Input/output this pin connects to on submodule.
|
||||
bool m_param; // Pin connects to parameter
|
||||
bool m_svImplicit; // Pin is SystemVerilog .name'ed
|
||||
public:
|
||||
AstPin(FileLine* fl, int pinNum, const string& name, AstNode* exprp)
|
||||
:AstNode(fl)
|
||||
,m_name(name), m_svImplicit(false) {
|
||||
,m_name(name), m_param(false), m_svImplicit(false) {
|
||||
m_pinNum = pinNum;
|
||||
m_modVarp = NULL;
|
||||
setNOp1p(exprp);
|
||||
}
|
||||
AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp)
|
||||
:AstNode(fl), m_svImplicit(false) {
|
||||
:AstNode(fl), m_param(false), m_svImplicit(false) {
|
||||
m_name = varname->name();
|
||||
m_pinNum = pinNum;
|
||||
m_modVarp = NULL;
|
||||
@ -1300,7 +1301,9 @@ public:
|
||||
AstNode* exprp() const { return op1p()->castNode(); } // op1 = Expression connected to pin, NULL if unconnected
|
||||
AstVar* modVarp() const { return m_modVarp; } // [After Link] Pointer to variable
|
||||
void modVarp(AstVar* varp) { m_modVarp=varp; }
|
||||
bool svImplicit() const { return m_svImplicit; }
|
||||
bool param() const { return m_param; }
|
||||
void param(bool flag) { m_param=flag; }
|
||||
bool svImplicit() const { return m_svImplicit; }
|
||||
void svImplicit(bool flag) { m_svImplicit=flag; }
|
||||
};
|
||||
|
||||
|
@ -300,6 +300,7 @@ private:
|
||||
if (pinp->name()=="") pinp->name("__pinNumber"+cvtToStr(pinp->pinNum()));
|
||||
}
|
||||
for (AstPin* pinp = nodep->paramsp(); pinp; pinp=pinp->nextp()->castPin()) {
|
||||
pinp->param(true);
|
||||
if (pinp->name()=="") pinp->name("__paramNumber"+cvtToStr(pinp->pinNum()));
|
||||
}
|
||||
if (nodep->modp()) {
|
||||
|
@ -1419,21 +1419,22 @@ private:
|
||||
if (!m_pinSymp) nodep->v3fatalSrc("Pin not under cell?\n");
|
||||
VSymEnt* foundp = m_pinSymp->findIdFlat(nodep->name());
|
||||
AstVar* refp = foundp->nodep()->castVar();
|
||||
const char* whatp = nodep->param() ? "parameter pin" : "pin";
|
||||
if (!refp) {
|
||||
if (nodep->name() == "__paramNumber1" && m_cellp->modp()->castPrimitive()) {
|
||||
// Primitive parameter is really a delay we can just ignore
|
||||
nodep->unlinkFrBack()->deleteTree(); nodep=NULL;
|
||||
return;
|
||||
}
|
||||
nodep->v3error("Pin not found: "<<nodep->prettyName());
|
||||
nodep->v3error(LinkDotState::ucfirst(whatp)<<" not found: "<<nodep->prettyName());
|
||||
} else if (!refp->isIO() && !refp->isParam() && !refp->isIfaceRef()) {
|
||||
nodep->v3error("Pin is not an in/out/inout/param/interface: "<<nodep->prettyName());
|
||||
nodep->v3error(LinkDotState::ucfirst(whatp)<<" is not an in/out/inout/param/interface: "<<nodep->prettyName());
|
||||
} else {
|
||||
nodep->modVarp(refp);
|
||||
if (refp->user5p() && refp->user5p()->castNode()!=nodep) {
|
||||
nodep->v3error("Duplicate pin connection: "<<nodep->prettyName()<<endl
|
||||
nodep->v3error("Duplicate "<<whatp<<" connection: "<<nodep->prettyName()<<endl
|
||||
<<refp->user5p()->castNode()->warnMore()
|
||||
<<"... Location of original pin connection");
|
||||
<<"... Location of original "<<whatp<<" connection");
|
||||
} else {
|
||||
refp->user5p(nodep);
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ compile (
|
||||
'%Error: t/t_lint_pindup_bad.v:\d+: Duplicate pin connection: i
|
||||
%Error: t/t_lint_pindup_bad.v:\d+: ... Location of original pin connection
|
||||
%Error: t/t_lint_pindup_bad.v:\d+: Pin not found: __pinNumber4
|
||||
%Error: t/t_lint_pindup_bad.v:\d+: Duplicate pin connection: P
|
||||
%Error: t/t_lint_pindup_bad.v:\d+: ... Location of original pin connection
|
||||
%Error: t/t_lint_pindup_bad.v:\d+: Duplicate parameter pin connection: P
|
||||
%Error: t/t_lint_pindup_bad.v:\d+: ... Location of original parameter pin connection
|
||||
%Error: Exiting due to.*',
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user