From 2062f7e97bb1b4f9ec518a59907e9741db81e8e8 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 22 Jul 2015 19:52:11 -0400 Subject: [PATCH] Fix hashed error with typedef inside block, bug948. --- Changes | 2 ++ src/V3Hashed.cpp | 1 + test_regress/t/t_typedef.v | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/Changes b/Changes index 0182adc5f..36e384be9 100644 --- a/Changes +++ b/Changes @@ -17,6 +17,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix $fopen with SV string, bug947. [Sven Stucki] +**** Fix hashed error with typedef inside block, bug948. [Sven Stucki] + * Verilator 3.874 2015-06-06 diff --git a/src/V3Hashed.cpp b/src/V3Hashed.cpp index 9f3449a1a..02a6d59cd 100644 --- a/src/V3Hashed.cpp +++ b/src/V3Hashed.cpp @@ -89,6 +89,7 @@ private: //-------------------- // Default: Just iterate virtual void visit(AstVar*, AstNUser*) {} + virtual void visit(AstTypedef*, AstNUser*) {} virtual void visit(AstNode* nodep, AstNUser*) { nodeHashIterate(nodep); } diff --git a/test_regress/t/t_typedef.v b/test_regress/t/t_typedef.v index b29da6aff..58ccd88bd 100644 --- a/test_regress/t/t_typedef.v +++ b/test_regress/t/t_typedef.v @@ -25,6 +25,13 @@ program t; //reg [SIZE-1:0] a; initial a =0; //reg [SIZE-1:0] b; initial b =0; + initial begin + typedef logic [3:0][7:0] instr_mem_t; + instr_mem_t a; + a[0] = 8'h12; + if (a[0] != 8'h12) $stop; + end + integer j; initial begin for (j=0;j<=(1<