Fix array selects in sense lists

git-svn-id: file://localhost/svn/verilator/trunk/verilator@865 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2007-01-03 03:01:36 +00:00
parent b5b1d94d4a
commit 58dc91605b
2 changed files with 10 additions and 3 deletions

View File

@ -100,7 +100,7 @@ private:
virtual void visit(AstSenItem* nodep, AstNUser*) {
// Remove bit selects, and bark if it's not a simple variable
nodep->iterateChildren(*this);
if (AstSel* selp = nodep->sensp()->castSel()) {
while (AstNodeSel* selp = nodep->sensp()->castNodeSel()) {
AstNode* fromp = selp->fromp()->unlinkFrBack();
selp->replaceWith(fromp); selp->deleteTree(); selp=NULL;
}

View File

@ -27,6 +27,13 @@ module t (/*AUTOARG*/
end
end
reg [7:0] memory8_16_4;
reg [7:0] memory8_16_5;
always @ (memory8_16[4] or memory8_16[5]) begin
memory8_16_4 = memory8_16[4];
memory8_16_5 = memory8_16[5];
end
always @ (posedge clk) begin
m_we <= 0;
if (cyc!=0) begin
@ -47,8 +54,8 @@ module t (/*AUTOARG*/
m_data <= 16'h0bad;
end
if (cyc==5) begin
if (memory8_16[4] != 8'h44) $stop;
if (memory8_16[5] != 8'h55) $stop;
if (memory8_16_4 != 8'h44) $stop;
if (memory8_16_5 != 8'h55) $stop;
if (memory8_16[6] != 8'hfe) $stop;
if (memory8_16[7] != 8'h77) $stop;
$write("*-* All Finished *-*\n");