From 2e67a91982a6a6b980c204804ad1c298fc3fa35f Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 23 Feb 2011 19:04:15 -0500 Subject: [PATCH] Support $bits(data_type), bug327. --- Changes | 4 ++++ src/config_build.h.in | 2 +- src/verilog.y | 1 + test_regress/t/t_enum.v | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 26d7f8124..8bb6ae714 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,10 @@ 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.8**** + +**** Support $bits(data_type), bug327. [Alex Solomatnikov] + * Verilator 3.811 2011/02/14 **** Report errors on duplicated or empty pins, bug321. [Christian Leber] diff --git a/src/config_build.h.in b/src/config_build.h.in index 182b3ef46..7b7469271 100644 --- a/src/config_build.h.in +++ b/src/config_build.h.in @@ -25,7 +25,7 @@ //********************************************************************** //**** Version and host name -#define DTVERSION "Verilator 3.811 2011/02/14" +#define DTVERSION "Verilator 3.811+ devel" //********************************************************************** //**** Functions diff --git a/src/verilog.y b/src/verilog.y index a4ec2dc37..7f91cea22 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -2115,6 +2115,7 @@ system_f_call: // IEEE: system_tf_call (as func) | yaD_DPI '(' exprList ')' { $$ = new AstFuncRef($2,*$1,$3); } // | yD_BITS '(' expr ')' { $$ = new AstAttrOf($1,AstAttrType::EXPR_BITS,$3); } + | yD_BITS '(' data_type ')' { $$ = new AstAttrOf($1,AstAttrType::EXPR_BITS,$3); } | yD_C '(' cStrList ')' { $$ = (v3Global.opt.ignc() ? NULL : new AstUCFunc($1,$3)); } | yD_CLOG2 '(' expr ')' { $$ = new AstCLog2($1,$3); } | yD_COUNTONES '(' expr ')' { $$ = new AstCountOnes($1,$3); } diff --git a/test_regress/t/t_enum.v b/test_regress/t/t_enum.v index a9f1f9aed..a6f4c46d2 100644 --- a/test_regress/t/t_enum.v +++ b/test_regress/t/t_enum.v @@ -48,6 +48,7 @@ module t (/*AUTOARG*/); if (three != 3'b111) $stop; if ($bits(sized_based_on_enum) != 8) $stop; + if ($bits(three_t) != 3) $stop; $write("*-* All Finished *-*\n"); $finish;