diff --git a/Makefile b/Makefile index a6f4235d7..4a966a5c7 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ ifeq ($(OS), Haiku) CXXFLAGS += -D_DEFAULT_SOURCE endif -YOSYS_VER := 0.52+137 +YOSYS_VER := 0.52+139 YOSYS_MAJOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f1) YOSYS_MINOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f2) YOSYS_COMMIT := $(shell echo $(YOSYS_VER) | cut -d'.' -f3) diff --git a/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h b/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h index 886d033cb..9b4f5774f 100644 --- a/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h +++ b/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h @@ -1769,7 +1769,7 @@ value shr_uu(const value &a, const value &b) { template CXXRTL_ALWAYS_INLINE value shr_su(const value &a, const value &b) { - return a.shr(b).template scast(); + return a.template scast().shr(b); } template diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index fe86626b8..9d0956c8e 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -2249,7 +2249,8 @@ cell_parameter: node->children.push_back($1); } | '.' TOK_ID '(' ')' { - // just ignore empty parameters + // delete unused TOK_ID + delete $2; } | '.' TOK_ID '(' expr ')' { AstNode *node = new AstNode(AST_PARASET); diff --git a/tests/verilog/param_default.ys b/tests/verilog/param_default.ys new file mode 100644 index 000000000..59023c477 --- /dev/null +++ b/tests/verilog/param_default.ys @@ -0,0 +1,24 @@ +logger -expect-no-warnings +read_verilog << EOF +module bar ( + input portname +); + parameter paramname = 7; +endmodule + +module empty ( +); + bar #() barinstance (); +endmodule + +module implicit ( +); + bar #(.paramname()) barinstance (.portname()); +endmodule + +module explicit ( + input a +); + bar #(.paramname(3)) barinstance (.portname(a)); +endmodule +EOF