Giter VIP home page Giter VIP logo

Comments (21)

poucotm avatar poucotm commented on June 12, 2024

Are you using modified version verilator ?

from sublimelinter-contrib-verilator.

cold3364 avatar cold3364 commented on June 12, 2024

Are you using modified version verilator ?

I've tried both modified version and original version, the problem still exists.
And my config is like below, but it seems that all the 'args' never worked.

    "linters":
    {
        "verilator_bin": {
            "disable": false,
            "env": {"PATH":"~/package/verilator/bin/"},
            // "executable": ["/usr/local/bin/verilator_bin"],
            // "lint_mode": "load_save",
            "lint_mode": "manual",
            "styles" : [
                {
                    "types": ["warning"],
                    "mark_style": "squiggly_underline",
                    "icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png"
                },
                {
                    "types": ["error"],
                    "mark_style": "fill",
                    "icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png"
                }
            ],
            "args": [
                "-I.",
                "--error-limit",
                "500",
                "--default-language",
                "1800-2012",
                "--bbox-sys",
                "--bbox-unsup",
                "-Wall",
                "-Wno-DECLFILENAME",
                "-Wno-IGNINC",
                "-Wno-IGNDEF",
                "-Wno-WIDTH",
                "-Wno-STMTDLY",
                "-Wno-UNDRIVEN",
                "-Wno-PINCONNECTEMPTY",
                "-Wno-INPUTPINEMPTY",
                "-Wno-OUTPUTPINEMPTY"
            ],
            "filter_errors": [
                "Unsupported:",
                "\\[IGNDEF\\]"
            ],
            // additional option to filter file type
            "extension": [
                ".v"
            ],
            // additional option for better highlighting near
            "message_near_map": [
                ["Case values", "case"],
                ["Suggest casez", "casex"]
            ]
        }
    }

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

Please, try to lint manually after turning on debug mode and check the message in the console :

In settings --------------------------
{
"debug": true,
"no_column_highlights_line": true,
"linters":
{
"verilator": {
"lint_mode":....

The console message ---------------

SublimeLinter: #3 linter.py:1576 Running ...

D:\Temp\temp (working dir)

D:\Program\verilator\verilator_bin.exe --lint-only --error-limit 500 --default-language 1364-2005 --bbox-sys --bbox-unsup -Wall -Wno-DECLFILENAME -Wno-IGNINC -Wno-IGNDEF -Wno-WIDTH -Wno-STMTDLY -Wno-UNDRIVEN -Wno-PINCONNECTEMPTY -Wno-INPUTPINEMPTY -Wno-OUTPUTPINEMPTY c:/users/pouco/appdata/local/temp/tmp_05slj.v c:/users/pouco/appdata/local/temp/tmpm7ewvx.v

SublimeLinter: #3 linter.py:1155 verilator: output:
%Error-PROCASSWIRE: c:/users/pouco/appdata/local/temp/tmp_05slj.v:34: Procedural assignment to wire, perhaps intended var (IEEE 2017 6.5): out
%Warning-UNUSED: c:/users/pouco/appdata/local/temp/tmp_05slj.v:18: Signal is not used: in2
... Use "/* verilator lint_off UNUSED */" and lint_on around source to disable this message.
%Warning-UNUSED: c:/users/pouco/appdata/local/temp/tmp_05slj.v:19: Signal is not used: mux
%Warning-UNUSED: c:/users/pouco/appdata/local/temp/tmp_05slj.v:25: Signal is not used: internal_reg
%Error: Exiting due to 1 error(s), 3 warning(s)
... See the manual and http://www.veripool.org/verilator for more assistance.

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

I am having the same problem, and debug = true yields 0.0 console output.

Has there been any resolution?
I am using original verilator (on purpose), but I supply all my search paths in the settings.

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd, the problem you mentioned is related with 8192 bit width?
Have you tried with the modified version?

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

yes. it makes no difference.

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd , Could you let me know the verilog codes having errors?

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd, You don't look like to use "-Wno-WIDTH" option or it doesn't work. Did you turn off the option on purpose ?

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

Yes, turned off on purpose, I of course wish to have WIDTH checking, why else would I use a linter?

Try instantiating:

module sync #(
  parameter RST_VAL = 1'b0
) (
  input logic clk_i,
  input logic rst_an_i,
  input logic d_i,
  output logic d_o
);

  //declarations
  logic d0_r;
  logic d1_r;

  //business logic
  always_ff @(posedge clk_i or negedge rst_an_i) begin : sync_proc
    if (rst_an_i == 1'b0) begin
      d0_r <= RST_VAL;
      d1_r <= RST_VAL;
    end else begin
      d0_r <= d_i;
      d1_r <= d0_r;
    end
  end

  assign d_o = d1_r;

endmodule

Settings used:

"linters":
	{
		"verilator":
		{
			"args":
			[
				"--error-limit",
				"500",
				"--default-language",
				"1800-2017",
				"--bbox-sys",
				"--bbox-unsup",
				"-Wall",
                                "-Iclk_lib",
			],
			"extension":
			[
				".v",
                               ".sv",
			],
			"filter_errors":
			[
				"Unsupported:",
				"\\[IGNDEF\\]"
			],
			"lint_mode": "load_save",
			"message_near_map":
			[
				[
					"Case values",
					"case"
				],
				[
					"Suggest casez",
					"casex"
				]
			],
			"styles":
			[
				{
					"icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png",
					"mark_style": "squiggly_underline",
					"types":
					[
						"warning"
					]
				},
				{
					"icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png",
					"mark_style": "fill",
					"types":
					[
						"error"
					]
				}
			]
		}
	},
	"no_column_highlights_line": true,

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd, As written in README, this package is made to lint based on single file. If an instantiated module is defined in an external file, the bits of ports are unknown. To ignore that, the package makes dummy modules with ports having 8192 bits. That is because you can see that warning without Wno-WIDTH. There is a simple workaround not to use Wno-WIDTH. Just add to filter_errors in the settings like this :

            "filter_errors": [
                "Unsupported:",
                "\\[IGNDEF\\]",
                "expects 8192 bits"
            ],

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

I understand that.
But in my args I provide the necessary search paths for the 'full-blown' verilator, so it should be able to pick up the missing module and lint for correct port width.

In fact in my project I do use verilator for actual simulation as well and it works.

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd, I've added the option - "verilator_direct" : true for you (v2.6.0). When it is true, the package calls verilator directly without a wrapper which has dummy modules.

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

oh thanks a lot.
So the dummy modules were part of this plugin and not a special verilator? I misunderstood this then

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

installed, 2.6.0 just now, but I am still getting the messages after adding the option and restarting sublime.

],
	"linters":
	{
		"verilator":
		{
			"args":
			[
				"--error-limit",
				"500",
				"--default-language",
				"1800-2017",
				"--bbox-sys",
				"--bbox-unsup",
				"-Wall",
                "-Iclk_lib",
                "-Ififo_lib",
			],
			"extension":
			[
				".v",
                ".sv",
			],
			"filter_errors":
			[
			],
			"lint_mode": "load_save",
			"verilator_direct" : true,
			"message_near_map":
			[
				[
					"Case values",
					"case"
				],
				[
					"Suggest casez",
					"casex"
				]
			],
			"styles":
			[
				{
					"icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png",
					"mark_style": "squiggly_underline",
					"types":
					[
						"warning"
					]
				},
				{
					"icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png",
					"mark_style": "fill",
					"types":
					[
						"error"
					]
				}
			]
		}

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd ,
The followings are example test files. Two files are in the same directory. The pictures below show each case.

module abc;
	wire	[3:0]	out;
	sync inst_sync (.out(out));
endmodule : abc
module sync(
  output wire [5:0] out
);
endmodule
  1. modified verilator version without Wno-WIDTH, verilator_direct : false

image

  1. modified verilator version without Wno-WIDTH, verilator_direct : true

image

  1. original verilator version without Wno-WIDTH, verilator_direct : true

image

  1. original verilator version, verilator_direct : true, sync.v is not in the same directory

image

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

Is my config correct?

It still does not work for me...still getting the 8k port width messages.

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd , I don't know well... This is the result with your settings.
image

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

I found the issue I believe.

I have the linters:
section in my sublime-project file.

It seems it is not being picked up there. If I put it into my sublime linter user settings it works.

You have an idea on how to put this into the project file for all devs to share it?

Also there is one weird thing:

grafik

Why is the filename such a mish-mash?
I mean I can live with turning that off, but checking module against filename is actually a favorable thing to do.
(and recommended practice)

from sublimelinter-contrib-verilator.

poucotm avatar poucotm commented on June 12, 2024

@markusdd, I've newly added two options - 'use_multiple_source', 'search_project_path' (v2.8.0). 'verilator_direct' was deprecated. You can add multiple paths in a .sublime-project file as the following:

"sources" : [ "path2", "path2", ... ]

If a window has a project file, the package checks "sources" setting.

About tmp file name, SublimeLinter uses tmp files instead of original files for some kind of safe calling issue. So, I put Wno-DECLFILENAME by default.

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

I do not quite get it: what do the new options do (are sources folders or files? I just pass search paths)
The verilator_direct option actually worked well now.

I did figure out how to put it into the project file, everything needs to be prefixed and put into a settings section:

"settings":
	{
		"translate_tabs_to_spaces": true,
		"trim_trailing_white_space_on_save": true,
		"SublimeLinter.linters.verilator.args":
		[
			"--error-limit",
			"500",
			"--default-language",
			"1800-2017",
			"--bbox-sys",
			"--bbox-unsup",
			"-Wall",
            "-Isvb_clk_lib",
            "-Isvb_fifo_lib",
            "-Isvb_mem_lib",
            "-Isvb_tb_lib",
		],
		"SublimeLinter.linters.verilator.extension":
		[
			".v",
            ".sv",
		],
		"SublimeLinter.linters.verilator.filter_errors":
		[
		],
		"SublimeLinter.linters.verilator.lint_mode": "load_save",
		"SublimeLinter.linters.verilator.verilator_direct" : true,
		"SublimeLinter.linters.verilator.message_near_map":
		[
			[
				"Case values",
				"case"
			],
			[
				"Suggest casez",
				"casex"
			]
		],
		"SublimeLinter.linters.verilator.styles":
		[
			{
				"icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png",
				"mark_style": "squiggly_underline",
				"types":
				[
					"warning"
				]
			},
			{
				"icon": "Packages/SublimeLinter/gutter-themes/Default/cog.png",
				"mark_style": "fill",
				"types":
				[
					"error"
				]
			}
		]
	}

from sublimelinter-contrib-verilator.

markusdd avatar markusdd commented on June 12, 2024

ok using the multiple_source option works.

I will just keep added the -I paths to the args option, that works well

Thanks a lot for looking into all this.

(can be closed from my view)

from sublimelinter-contrib-verilator.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.