Compare commits

...
3 Commits
Author SHA1 Message Date
Wilson Snyder 53155b3a36 Version bump
git-svn-id: file://localhost/svn/verilator/trunk/verilator@783 77ca24e4-aefa-0310-84f0-b9a241c72d87
2006-09-11 20:44:54 +00:00
Wilson Snyder 12ae70ba95 Prep for removing begin under first generate, but doesn't work. Commentary instead
git-svn-id: file://localhost/svn/verilator/trunk/verilator@782 77ca24e4-aefa-0310-84f0-b9a241c72d87
2006-09-11 20:42:47 +00:00
Wilson Snyder 88809587f9 Fix function references under top inlined module.
git-svn-id: file://localhost/svn/verilator/trunk/verilator@781 77ca24e4-aefa-0310-84f0-b9a241c72d87
2006-09-08 16:16:30 +00:00
8 changed files with 58 additions and 43 deletions
+5 -1
View File
@@ -3,7 +3,11 @@ Revision history for Verilator
The contributors that suggested a given feature are shown in []. [by ...]
indicates the contributor was also the author of the fix; Thanks!
* Verilator 3.601 09/06/2006
* Verilator 3.602 09/11/2006
**** Fix function references under top inlined module. [David Hewson]
* Verilator 3.601 09/06/2006 Beta
*** Added --inhibit-sim flag for environments using old __Vm_inhibitSim.
+22 -4
View File
@@ -1116,10 +1116,25 @@ always @* to prevent these issues.)
Verilator supports dotted references to variables, functions and tasks in
different modules. However, references into named blocks and function-local
variables are not supported. References into generate statements and
arrayed instances are possible, but may use different names from the
Verilog standard; arrayed instances are named {cellName}__{instanceNumber},
while for generates, it's genblk{instanceNumber} or genfor{loopCount}.
variables are not supported. References into arrayed and generated
instances work, but still require some work-arounds in the Verilog code:
References into arrayed instances use different names from the Verilog
standard; arrayed instances are named {cellName}__{instanceNumber}. For
example a[2] is instead a__2. Thus you cannot use a parameter or variable
to select the index number; expand it into a case statement manually.
References into generate statements also use different names from the
Verilog standard; the top level generate, any begin statement, and any
place where there is a implied begin statement (under each generate-if or
generate-case) adds a hierarchy level named genblkI<instanceNumber>. And
each generate-for adds genforI<loopCount>. The best bet is to comment out
the references and run with --debug and look in the at the _begin.tree
file, and see the hierarchy by looking at the names of all of the CELLs in
question. Replace __DOT__ with . in your program. For example most cells
under a for loop would be something like
"genblk__DOT__genfor0__DOT__I<cellname>"; so use genblk.genfor0.I<cellname> to
see inside that cell.
=head2 Latches
@@ -1354,6 +1369,9 @@ For significantly better performance, split this into 2 separate signals:
wire [2:1] x_21 = x[1:0];
wire [0:0] x_0 = shift_in;
This warning may also be due to clock enables. To fix these, use the
clock_enable meta comment described above.
=item UNSIGNED
Warns that you are comparing a unsigned value in a way that implies it is
+1 -29
View File
@@ -49,25 +49,6 @@ private:
string m_beginScope; // Name of begin blocks above us
//int debug() { return 9; }
bool nameMatchesGen(const char* namep, string& numr) {
numr = "";
bool needbar = false;
for (const char* cp=namep; *cp; ) {
if (0==strncmp(cp,"genblk",6) || 0==strncmp(cp,"genfor",6)) {
cp += 6;
} else if (isdigit(*cp)) {
if (needbar) { numr += '_'; needbar = false; }
numr += *cp++;
} else if (*cp=='_') {
cp++;
needbar = true;
} else {
return false; // Not exact match
}
}
return true;
}
// VISITORS
virtual void visit(AstModule* nodep, AstNUser*) {
m_modp = nodep;
@@ -84,15 +65,6 @@ private:
UINFO(8," "<<nodep<<endl);
string oldScope = m_beginScope;
{
//string nameNum;
//string oldNum;
//if (nameMatchesGen(oldScope.c_str(), oldNum/*ref*/)
// && nameMatchesGen(nodep->name().c_str(), nameNum/*ref*/)
// && 0) { // Messes up V3Link
// // Need to leave the dot or we mess up later V3LinkDot
// // gen[blk|for]##_gen[blk|for]## -> gen[blk|for]##__DOT__##...
// m_beginScope = oldScope + "__DOT__"+nameNum;
//UINFO(8,"nname "<<m_beginScope<<endl);
// Create data for dotted variable resolution
string dottedname = nodep->name() + "__DOT__"; // So always found
@@ -100,7 +72,7 @@ private:
while ((pos=dottedname.find("__DOT__")) != string::npos) {
string ident = dottedname.substr(0,pos);
dottedname = dottedname.substr(pos+strlen("__DOT__"));
if (m_beginScope=="") m_beginScope = nodep->name();
if (m_beginScope=="") m_beginScope = ident;
else m_beginScope = m_beginScope + "__DOT__"+ident;
// Create CellInline for dotted resolution
AstCellInline* inlinep = new AstCellInline(nodep->fileline(),
+5 -2
View File
@@ -546,7 +546,8 @@ private:
string baddot;
LinkDotBaseVertex* dotVxp = m_cellVxp; // Start search at current scope
if (nodep->inlinedDots()!="") { // Correct for current scope
dotVxp = m_statep->findDotted(dotVxp, nodep->inlinedDots(), baddot);
string inl = AstNode::prettyName(nodep->inlinedDots());
dotVxp = m_statep->findDotted(dotVxp, inl, baddot);
if (!dotVxp) nodep->v3fatalSrc("Couldn't resolve inlined scope '"<<baddot<<"' in: "<<nodep->inlinedDots());
}
dotVxp = m_statep->findDotted(dotVxp, nodep->dotted(), baddot); // Maybe NULL
@@ -589,7 +590,9 @@ private:
string baddot;
LinkDotBaseVertex* dotVxp = m_cellVxp; // Start search at current scope
if (nodep->inlinedDots()!="") { // Correct for current scope
dotVxp = m_statep->findDotted(dotVxp, nodep->inlinedDots(), baddot);
string inl = AstNode::prettyName(nodep->inlinedDots());
UINFO(8,"\t\tInlined "<<inl<<endl);
dotVxp = m_statep->findDotted(dotVxp, inl, baddot);
if (!dotVxp) nodep->v3fatalSrc("Couldn't resolve inlined scope '"<<baddot<<"' in: "<<nodep->inlinedDots());
}
dotVxp = m_statep->findDotted(dotVxp, nodep->dotted(), baddot); // Maybe NULL
+7 -3
View File
@@ -127,10 +127,14 @@ private:
nodep->iterateChildren(*this);
// After expanding the generate, all statements under it can be moved
// up, and the generate block deleted as it's not relevant
AstNode* stmtsp = nodep->stmtsp()->unlinkFrBackWithNext();
nodep->replaceWith(stmtsp);
if (AstNode* stmtsp = nodep->stmtsp()) {
stmtsp->unlinkFrBackWithNext();
nodep->replaceWith(stmtsp);
if (debug()>=9) stmtsp->dumpTree(cout,"-genout: ");
} else {
nodep->unlinkFrBack();
}
nodep->deleteTree(); nodep=NULL;
if (debug()>=9) stmtsp->dumpTree(cout,"-genout: ");
}
virtual void visit(AstGenIf* nodep, AstNUser*) {
V3Width::widthParams(nodep); // Param typed widthing will NOT recurse the body
+1 -1
View File
@@ -24,7 +24,7 @@
//**********************************************************************
//**** Version and host name
#define DTVERSION "Verilator 3.601 09/06/2006"
#define DTVERSION "Verilator 3.602 09/11/2006"
//**********************************************************************
//**** Functions
+3 -3
View File
@@ -222,7 +222,7 @@ class AstSenTree;
%type<nodep> v2kPort ioDecl varDecl
%type<nodep> modParDecl modParList modParE
%type<nodep> modItem modItemList modItemListOrNone modOrGenItem
%type<nodep> genItem genItemList genItemBegin genItemBlock genItemsBlock genCaseList
%type<nodep> genItem genItemList genItemBegin genItemBlock genTopBlock genCaseList
%type<nodep> dterm
%type<varp> onesig sigId sigIdRange paramId sigList regsig regsigList regSigId
%type<varp> netSig netSigList
@@ -399,7 +399,7 @@ modItemList: modItem { $$ = $1; }
;
modItem: modOrGenItem { $$ = $1; }
| yGENERATE genItemsBlock yENDGENERATE { $$ = new AstGenerate($1, $2); }
| yGENERATE genTopBlock yENDGENERATE { $$ = new AstGenerate($1, $2); }
| ySCHDR { $$ = new AstScHdr(CRELINE(),*$1); }
| ySCINT { $$ = new AstScInt(CRELINE(),*$1); }
| ySCIMP { $$ = new AstScImp(CRELINE(),*$1); }
@@ -437,7 +437,7 @@ genItemBlock: genItem { $$ = new AstBegin(CRELINE(),"genblk",$1); }
| genItemBegin { $$ = $1; }
;
genItemsBlock: genItemList { $$ = new AstBegin(CRELINE(),"genblk",$1); }
genTopBlock: genItemList { $$ = new AstBegin(CRELINE(),"genblk",$1); }
| genItemBegin { $$ = $1; }
;
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("./driver.pl", @ARGV, $0); die; }
# $Id$
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# General Public License or the Perl Artistic License.
compile (
);
# No execute
ok(1);
1;