veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
247 stars 90 forks source link

Casting a signal that is an output of an AUTOINST instance output seems to prevent AUTOLOGIC from creating declaration #1748

Closed fnJeff closed 2 years ago

fnJeff commented 2 years ago

You should be able to see the problem with the following testcase code. Copying this code into a buffer and updating the AUTOs, you should see that no declaration is created for the "a" output. If you remove the "int'(a)" cast, you will see the declaration for "a" created correctly.

Testcase:

module bug (output [7:0] a); initial begin a = 0; end

always begin

10;

  a += 1;

end endmodule

module top; /AUTOLOGIC/

bug bug (/AUTOINST/ // Outputs .a (a[7:0]));

initial begin

1000;

  if (int'(a) > 5) begin
     $display("Test");
  end

end

endmodule

From verilog mode:

Emacs : GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.14.13) of 2020-12-17 Package: verilog-mode v2019-12-17-ffa2ba5-vpo-GNU

current state: (setq verilog-active-low-regexp nil verilog-after-save-font-hook nil verilog-align-ifelse nil verilog-assignment-delay "" verilog-auto-arg-sort nil verilog-auto-declare-nettype nil verilog-auto-delete-trailing-whitespace nil verilog-auto-endcomments nil verilog-auto-hook nil verilog-auto-ignore-concat nil verilog-auto-indent-on-newline t verilog-auto-inout-ignore-regexp nil verilog-auto-input-ignore-regexp nil verilog-auto-inst-column 40 verilog-auto-inst-dot-name nil verilog-auto-inst-interfaced-ports nil verilog-auto-inst-param-value nil verilog-auto-inst-sort nil verilog-auto-inst-template-numbers nil verilog-auto-inst-vector 'unsigned verilog-auto-lineup 'declarations verilog-auto-newline nil verilog-auto-output-ignore-regexp nil verilog-auto-read-includes nil verilog-auto-reset-blocking-in-non t verilog-auto-reset-widths t verilog-auto-save-policy nil verilog-auto-sense-defines-constant nil verilog-auto-sense-include-inputs nil verilog-auto-star-expand t verilog-auto-star-save nil verilog-auto-template-warn-unused nil verilog-auto-tieoff-declaration "wire" verilog-auto-tieoff-ignore-regexp nil verilog-auto-unused-ignore-regexp nil verilog-auto-wire-type "logic" verilog-before-auto-hook nil verilog-before-delete-auto-hook nil verilog-before-getopt-flags-hook nil verilog-before-save-font-hook nil verilog-cache-enabled t verilog-case-fold t verilog-case-indent 3 verilog-cexp-indent 3 verilog-compiler "verilog " verilog-coverage "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" verilog-delete-auto-hook nil verilog-getopt-flags-hook nil verilog-highlight-grouping-keywords t verilog-highlight-includes t verilog-highlight-modules t verilog-highlight-translate-off nil verilog-indent-begin-after-if t verilog-indent-declaration-macros nil verilog-indent-level 3 verilog-indent-level-behavioral 3 verilog-indent-level-declaration 3 verilog-indent-level-directive 1 verilog-indent-level-module 3 verilog-indent-lists t verilog-library-directories '(".") verilog-library-extensions '(".v" ".va" ".sv") verilog-library-files nil verilog-library-flags '("") verilog-linter "echo 'No verilog-linter set, see \"M-x describe-variable verilog-linter\"'" verilog-minimum-comment-distance 10 verilog-mode-hook 'verilog-set-compile-command verilog-mode-release-emacs t verilog-mode-version "2019-12-17-ffa2ba5-vpo-GNU" verilog-preprocessor "verilator -E FLAGS FILE" verilog-simulator "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" verilog-tab-always-indent t verilog-tab-to-comment nil verilog-typedef-regexp "^\(t.+\|sm[^_]+\)$" verilog-warn-fatal nil )

wsnyder commented 2 years ago

Thanks for the good test case, fixed in git master.

fnJeff commented 1 year ago

Finally had time to update to the latest version. Apologies for the ridiculous delay. Confirmed as fixed.