Allow isolate_assignments on task input/outputs

git-svn-id: file://localhost/svn/verilator/trunk/verilator@880 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2007-01-26 21:53:03 +00:00
parent eb2eb14297
commit f1a2ee3273
5 changed files with 27 additions and 8 deletions

View File

@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix isolate_assignments when many signals per always. [Mike Shinkarovsky] **** Fix isolate_assignments when many signals per always. [Mike Shinkarovsky]
**** Fix isolate_assignments across task temporaries. [Mike Shinkarovsky]
* Verilator 3.632 1/17/2007 * Verilator 3.632 1/17/2007
*** Add /*verilator isolate_assignments*/ attribute. [Mike Shinkarovsky] *** Add /*verilator isolate_assignments*/ attribute. [Mike Shinkarovsky]

View File

@ -382,6 +382,14 @@ private:
//nodep->v3warn(GENCLK,"Signal unoptimizable: Generated clock: "<<nodep->prettyName()); //nodep->v3warn(GENCLK,"Signal unoptimizable: Generated clock: "<<nodep->prettyName());
} else if (nodep->varp()->isSigPublic()) { } else if (nodep->varp()->isSigPublic()) {
nodep->v3warn(UNOPT,"Signal unoptimizable: Feedback to public clock or circular logic: "<<nodep->prettyName()); nodep->v3warn(UNOPT,"Signal unoptimizable: Feedback to public clock or circular logic: "<<nodep->prettyName());
if (!nodep->fileline()->warnIsOff(V3ErrorCode::UNOPT)) {
nodep->fileline()->warnOff(V3ErrorCode::UNOPT, true); // Complain just once
// Give the user an example.
bool tempWeight = (edgep && edgep->weight()==0);
if (tempWeight) edgep->weight(1); // Else the below loop detect can't see the loop
m_graph.reportLoops(&OrderEdge::followComboConnected, vertexp); // calls OrderGraph::loopsVertexCb
if (tempWeight) edgep->weight(0);
}
} else { } else {
// We don't use UNOPT, as there are lots of V2 places where it was needed, that aren't any more // We don't use UNOPT, as there are lots of V2 places where it was needed, that aren't any more
// First v3warn not inside warnIsOff so we can see the suppressions with --debug // First v3warn not inside warnIsOff so we can see the suppressions with --debug

View File

@ -306,6 +306,7 @@ private:
AstVar* newvarp = new AstVar (invarp->fileline(), AstVarType::BLOCKTEMP, AstVar* newvarp = new AstVar (invarp->fileline(), AstVarType::BLOCKTEMP,
name, invarp); name, invarp);
newvarp->funcLocal(false); newvarp->funcLocal(false);
newvarp->propagateAttrFrom(invarp);
m_modp->addStmtp(newvarp); m_modp->addStmtp(newvarp);
AstVarScope* newvscp = new AstVarScope (newvarp->fileline(), m_scopep, newvarp); AstVarScope* newvscp = new AstVarScope (newvarp->fileline(), m_scopep, newvarp);
m_scopep->addVarp(newvscp); m_scopep->addVarp(newvscp);
@ -628,7 +629,7 @@ private:
if (!funcp) nodep->v3fatalSrc("unlinked"); if (!funcp) nodep->v3fatalSrc("unlinked");
// Inline func refs in the function // Inline func refs in the function
iterateIntoFTask(funcp); iterateIntoFTask(funcp);
// Create output variabls // Create output variable
string namePrefix = "__Vfunc_"+funcp->shortName()+"__"+cvtToStr(m_modNCalls++); string namePrefix = "__Vfunc_"+funcp->shortName()+"__"+cvtToStr(m_modNCalls++);
AstVarScope* outvscp = createVarScope (funcp->fvarp()->castVar(), AstVarScope* outvscp = createVarScope (funcp->fvarp()->castVar(),
namePrefix+"__out"); namePrefix+"__out");

View File

@ -54,7 +54,7 @@ module t (/*AUTOARG*/
$write("*-* All Finished *-*\n"); $write("*-* All Finished *-*\n");
$write("[%0t] cyc==%0d crc=%x %x\n",$time, cyc, crc, sum); $write("[%0t] cyc==%0d crc=%x %x\n",$time, cyc, crc, sum);
if (crc !== 64'hc77bb9b3784ea091) $stop; if (crc !== 64'hc77bb9b3784ea091) $stop;
if (sum !== 64'he281f003f6dd16b2) $stop; if (sum !== 64'h649ee1713d624dd9) $stop;
$finish; $finish;
end end
end end
@ -90,15 +90,23 @@ module file (/*AUTOARG*/
d = {crc[15:0],~c[31:16]}; d = {crc[15:0],~c[31:16]};
end end
default: begin default: begin
b = ~crc; set_b_d(crc, c);
set_d(~c); // d = ~c;
end end
endcase endcase
end end
task set_d; task set_b_d;
input [31:0] to; `ifdef ISOLATE
d = to; input [31:0] t_crc /* verilator isolate_assignments*/;
input [31:0] t_c /* verilator isolate_assignments*/;
`else
input [31:0] t_crc;
input [31:0] t_c;
`endif
begin
b = {t_crc[31:16],~t_crc[23:8]};
d = {t_crc[31:16], ~t_c[23:8]};
end
endtask endtask
always @* begin always @* begin

View File

@ -14,7 +14,7 @@ compile (
); );
if ($Last_Self->{v3}) { if ($Last_Self->{v3}) {
file_grep ($Last_Self->{stats}, qr/Optimizations, isolate_assignments blocks\s+1/i); file_grep ($Last_Self->{stats}, qr/Optimizations, isolate_assignments blocks\s+3/i);
} }
execute ( execute (