Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iverilog linter does not work on macos with vscode 1.76.2 #407

Closed
devindang opened this issue Mar 11, 2023 · 48 comments
Closed

iverilog linter does not work on macos with vscode 1.76.2 #407

devindang opened this issue Mar 11, 2023 · 48 comments
Assignees
Labels

Comments

@devindang
Copy link

devindang commented Mar 11, 2023

Describe the bug
iverilog linter does not work on macos with vscode 1.76.2

Environment (please complete the following information):

  • OS: macOS 13.2.1
  • Chip: Apple silicon M1 pro
  • VS Code version: 1.76.2
  • Extension version: I didn't see any version information but the newest
  • color themes, lint tools, etc.
    -- color themes: GitHub dark corlorblind
    -- lint tools: iverilog, 11.0

Steps to reproduce
Steps to reproduce the behavior:

  1. Well installed iverilog and added it to envirionment variable.
  2. Run "iverilog" command both in macOS terminal and vscode terminal to make sure it get effected.
  3. Go to vscode-verilog-hdl-support extension settings.
  4. Configure verilog>linting>linter to "iverilog".
  5. Configure verilog>linting>path to "iverilog".
  6. And the other settings keep defaults.
  7. Modified .v file to wrong syntax, and save file with command+s.
  8. Nothing happened. See the error.

Log
Attach the log generated while following the above steps

Expected behavior
A clear and concise description of what you expected to happen.

Actual behavior
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@devindang devindang added the bug label Mar 11, 2023
@devindang
Copy link
Author

devindang commented Mar 15, 2023

[EDITED]
I found the issue for windows.
If iverilog is already in PATH, DO NOT set verilog.linting.path, after clear verilog.linting.path, it get worked.
It's not suit for macOS.

@Sen-Yao
Copy link

Sen-Yao commented Mar 16, 2023

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

@devindang
Copy link
Author

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

Make sure you have added the installation path of iverilog to PATH if you are using windows.

@Sen-Yao
Copy link

Sen-Yao commented Mar 16, 2023

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

Make sure you have added the installation path of iverilog to PATH if you are using windows.

I'm using macOS. And I have set "Verilog > Linting: Path" to "iverilog". Is that the right PATH ?

@devindang
Copy link
Author

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

Make sure you have added the installation path of iverilog to PATH if you are using windows.

I'm using macOS. And I have set "Verilog > Linting: Path" to "iverilog". Is that the right PATH ?

Sorry, I made a mistake, it's clear "verilog.lingting.path" instead of "verilog.linting.linter"

@Sen-Yao
Copy link

Sen-Yao commented Mar 16, 2023

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

Make sure you have added the installation path of iverilog to PATH if you are using windows.

I'm using macOS. And I have set "Verilog > Linting: Path" to "iverilog". Is that the right PATH ?

Sorry, I made a mistake, it's clear "verilog.lingting.path" instead of "verilog.linting.linter"

草,你也是中国大学生,直接用中文吧,我现在"verilog.lingting.path" 是空的,然后 "verilog.linting.linter" 是 "iverilog",是这样配置的吗

@devindang
Copy link
Author

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

Make sure you have added the installation path of iverilog to PATH if you are using windows.

I'm using macOS. And I have set "Verilog > Linting: Path" to "iverilog". Is that the right PATH ?

Sorry, I made a mistake, it's clear "verilog.lingting.path" instead of "verilog.linting.linter"

草,你也是中国大学生,直接用中文吧,我现在"verilog.lingting.path" 是空的,然后 "verilog.linting.linter" 是 "iverilog",是这样配置的吗

我的mac也不行,,同样的配置,windows就修复了,我以为mac也可以。怎样配置路径都不可以

@Sen-Yao
Copy link

Sen-Yao commented Mar 16, 2023

I have the same issue, I tried to clear "verilog.linting.linter" but it still doesn't works. Can you please give me any other possible solutions?

Make sure you have added the installation path of iverilog to PATH if you are using windows.

I'm using macOS. And I have set "Verilog > Linting: Path" to "iverilog". Is that the right PATH ?

Sorry, I made a mistake, it's clear "verilog.lingting.path" instead of "verilog.linting.linter"

草,你也是中国大学生,直接用中文吧,我现在"verilog.lingting.path" 是空的,然后 "verilog.linting.linter" 是 "iverilog",是这样配置的吗

我的mac也不行,,同样的配置,windows就修复了,我以为mac也可以。怎样配置路径都不可以

谢谢兄弟,学电信的用macOS太折磨了 :( 我用英文反馈一下 bug 吧。

@Sen-Yao
Copy link

Sen-Yao commented Mar 16, 2023

Unfortunately, linter still doesn't work on macOS. No matter what configuration is. According to @ @devindang , Windows users can try the solution he said. But linter on macOS still doesn't work.

I guess there is a bug for macOS :(

@devindang
Copy link
Author

Unfortunately, linter still doesn't work on macOS. No matter what configuration is. According to @ @devindang , Windows users can try the solution he said. But linter on macOS still doesn't work.

I guess there is a bug for macOS :(

use Teros HDL instead. The linting works fine with Icarus Verilog.

@mshr-h
Copy link
Owner

mshr-h commented Mar 17, 2023

verilog.lingting.path is a path to a directory where iverilog binary is located.
If your iverilog binary is /opt/homebrew/bin/iverilog, then you have to set verilog.lingting.path to /opt/homebrew/bin.
If iverilog is in the PATH, you don't need to set verilog.lingting.path. It can be empty.

Maybe we need to change the description text of verilog.lingting.path to be more clear.

@devindang
Copy link
Author

verilog.lingting.path is a path to a directory where iverilog binary is located. If your iverilog binary is /opt/homebrew/bin/iverilog, then you have to set verilog.lingting.path to /opt/homebrew/bin. If iverilog is in the PATH, you don't need to set verilog.lingting.path. It can be empty.

Maybe we need to change the description text of verilog.lingting.path to be more clear.

Is the following configuration correct?

  1. verilog.linting.linter -> iverilog
  2. verilog.linting.path -> /opt/homebrew/Cellar/icarus-verilog/11.0/bin/
    The other options keep default. In that path, there is an "exec" file named "iverilog".

Even I configured CTAGS paths, it does still not work.
But if I change to use Teros HDL, I don't need to configure any PATHs(iverilog is already in PATH, but the extension we are taking about seems ignored it).

@devindang
Copy link
Author

verilog.lingting.path is a path to a directory where iverilog binary is located. If your iverilog binary is /opt/homebrew/bin/iverilog, then you have to set verilog.lingting.path to /opt/homebrew/bin. If iverilog is in the PATH, you don't need to set verilog.lingting.path. It can be empty.

Maybe we need to change the description text of verilog.lingting.path to be more clear.

Teros HDL extension is too bloated, I don't want to use it. So could you please help me to configure it correctly? thanks very much.

@mshr-h
Copy link
Owner

mshr-h commented Mar 22, 2023

What do you see in the Output Window when you execute the below process?

  1. Open language_examples/systemverilog/property_1.sv in this repo. The file has 2 warnings.
  2. Open the Output Window (You can open it by typing Ctrl+K, Ctrl+H)
  3. Run Verilog: Rerun lint tool->iverilog

For my environment, I can see

2023-03-22 17:52:32.837 [info] [iverilog-lint] Execute
2023-03-22 17:52:32.837 [info] [iverilog-lint]   command: iverilog -t null -g2012  /home/ubuntu/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv
2023-03-22 17:52:32.837 [info] [iverilog-lint]   cwd    : /home/ubuntu/workspace/mshr-h/vscode-verilog-hdl-support
2023-03-22 17:52:32.852 [info] [iverilog-lint] 2 errors/warnings returned

@mshr-h
Copy link
Owner

mshr-h commented Mar 22, 2023

Is the following configuration correct?

  1. verilog.linting.linter -> iverilog
  2. verilog.linting.path -> /opt/homebrew/Cellar/icarus-verilog/11.0/bin/
    The other options keep default. In that path, there is an "exec" file named "iverilog".

I think it's correct.

@mshr-h
Copy link
Owner

mshr-h commented Mar 22, 2023

  • Do you use Apple Silicon's icarus-verilog?
  • What do you get when you run which iverilog in the terminal?

@devindang
Copy link
Author

devindang commented Mar 22, 2023

  • Do you use Apple Silicon's icarus-verilog?
  • What do you get when you run which iverilog in the terminal?
  • I installed icarus-verilog by brew install icarus-verilog, and I browsed icarus-verilog repo just now, there seems no special release for apple silicon.

  • When I run which iverilog, I get /opt/homebrew/bin/iverilog, it's not my path for iverilog, and I browsed that path, it is a link to '/opt/homebrew/Cellar/icarus-verilog/11.0/bin/iverilog', which is a unix executable file.

@devindang
Copy link
Author

  • Do you use Apple Silicon's icarus-verilog?
  • What do you get when you run which iverilog in the terminal?

And I tried to set verilog.linting.path to /opt/homebrew/Cellar/icarus-verilog/11.0/bin/iverilog or /opt/homebrew/Cellar/icarus-verilog/11.0/bin/, it still doesn't work.

@devindang
Copy link
Author

What do you see in the Output Window when you execute the below process?

  1. Open language_examples/systemverilog/property_1.sv in this repo. The file has 2 warnings.
  2. Open the Output Window (You can open it by typing Ctrl+K, Ctrl+H)
  3. Run Verilog: Rerun lint tool->iverilog

For my environment, I can see

2023-03-22 17:52:32.837 [info] [iverilog-lint] Execute
2023-03-22 17:52:32.837 [info] [iverilog-lint]   command: iverilog -t null -g2012  /home/ubuntu/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv
2023-03-22 17:52:32.837 [info] [iverilog-lint]   cwd    : /home/ubuntu/workspace/mshr-h/vscode-verilog-hdl-support
2023-03-22 17:52:32.852 [info] [iverilog-lint] 2 errors/warnings returned

I didn't find "Output Window" where I can input something, but when I open command panel by Command+Shift+P, and run Verilog: return lint tool, I got an error:

Command "Verilog: Return lint tool" cause an error
command 'verilog.lint' not found

@mshr-h
Copy link
Owner

mshr-h commented Mar 22, 2023

You can see Output Window like this. It's in the same pane as the integrated terminal.
image

Command "Verilog: Return lint tool" cause an error
command 'verilog.lint' not found

haven't seen similar error before.
guess you misconfigured something.
can you share your entire config file if possible?

@mshr-h
Copy link
Owner

mshr-h commented Mar 22, 2023

  • I installed icarus-verilog by brew install icarus-verilog, and I browsed icarus-verilog repo just now, there seems no special release for apple silicon.
  • When I run which iverilog, I get /opt/homebrew/bin/iverilog, it's not my path for iverilog, and I browsed that path, it is a link to '/opt/homebrew/Cellar/icarus-verilog/11.0/bin/iverilog', which is a unix executable file.

Both are same as my mac.

@devindang
Copy link
Author

You can see Output Window like this. It's in the same pane as the integrated terminal. image

Command "Verilog: Return lint tool" cause an error
command 'verilog.lint' not found

haven't seen similar error before. guess you misconfigured something. can you share your entire config file if possible?

I have tried this in my windows and got a similar output as yours.

It asked me to choose a lint tool after executing Verilog: return lint tool, but I just got an error in my mac.

Besides, where can I find the config file? Do you mean the config file of the Verilog extension?

@mshr-h
Copy link
Owner

mshr-h commented Mar 22, 2023

Besides, where can I find the config file? Do you mean the config file of the Verilog extension?

Open the settings tab and click "Open Settings (JSON)" in the top right corner.
image

@devindang
Copy link
Author

This is my settings json

{
    "workbench.preferredDarkColorTheme": "GitHub Dark Colorblind (Beta)",
    "workbench.preferredLightColorTheme": "GitHub Light Colorblind (Beta)",
    "git.openRepositoryInParentFolders": "always",
    "verilog.linting.linter": "iverilog",
    "php.validate.run": "onType",
    // "workbench.colorCustomizations": {
    //     "editor.selectionBackground": "#898900",
    //     "editor.selectionHighlightBackground": "#c5293e"
    // },
    "workbench.iconTheme": "vscode-icons-mac",
    "matlab.mlintpath": "/Applications/MATLAB_R2022b.app/bin/maci64/mlint",
    "verilog.ctags.path": "",
    "verilog.linting.path": "/opt/homebrew/Cellar/icarus-verilog/11.0/bin/",
    "workbench.colorTheme": "GitHub Dark Colorblind (Beta)",
    "window.autoDetectColorScheme": true
}

This is my settings json

{
    "workbench.preferredDarkColorTheme": "GitHub Dark Colorblind (Beta)",
    "workbench.preferredLightColorTheme": "GitHub Light Colorblind (Beta)",
    "git.openRepositoryInParentFolders": "always",
    "verilog.linting.linter": "iverilog",
    "php.validate.run": "onType",
    // "workbench.colorCustomizations": {
    //     "editor.selectionBackground": "#898900",
    //     "editor.selectionHighlightBackground": "#c5293e"
    // },
    "workbench.iconTheme": "vscode-icons-mac",
    "matlab.mlintpath": "/Applications/MATLAB_R2022b.app/bin/maci64/mlint",
    "verilog.ctags.path": "",
    "verilog.linting.path": "/opt/homebrew/Cellar/icarus-verilog/11.0/bin/",
    "workbench.colorTheme": "GitHub Dark Colorblind (Beta)",
    "window.autoDetectColorScheme": true
}

@mshr-h
Copy link
Owner

mshr-h commented Mar 23, 2023

seems ok to me.
I've applied your Verilog config to my mac and it works correctly.
I have no idea...

@devindang
Copy link
Author

seems ok to me. I've applied your Verilog config to my mac and it works correctly. I have no idea...

Can you find the reason for the following behavior? What does 'verilog.lint' refer to?

run Verilog: return lint tool, I got an error:
Command "Verilog: Return lint tool" cause an error
command 'verilog.lint' not found

@mshr-h
Copy link
Owner

mshr-h commented Mar 23, 2023

Can you find the reason for the following behavior? What does 'verilog.lint' refer to?

I couldn't find why it happens.
The Verilog: Rerun lint tool command is defined here. And it invokes verilog.lint function defined here.

I guess the extension initialization process has some problem.

Did you try to reinstall the extension?

@devindang
Copy link
Author

seems ok to me. I've applied your Verilog config to my mac and it works correctly. I have no idea...

Can you find the reason of the following behavior? What does 'verilog.lint' refer to?

run Verilog: return lint tool, I got an error:
Command "Verilog: Return lint tool" cause an error
command 'verilog.lint' not found

Can you find the reason for the following behavior? What does 'verilog.lint' refer to?

I couldn't find why it happens. The Verilog: Rerun lint tool command is defined here. And it invokes verilog.lint function defined here.

I guess the extension initialization process has some problem.

Did you try to reinstall the extension?

Yes, I have tried to reinstall the extension, but it did not work.

@mshr-h
Copy link
Owner

mshr-h commented Mar 23, 2023

I can't think of any good ideas for investigating.
Sorry for that...

@devindang
Copy link
Author

I can't think of any good ideas for investigating.
Sorry for that...

Don't feel sorry. I tried to reinstall the extension, now it can execute "Verilog: Return lint tool", and ask me to choose a linter tool.

If I choose "iverilog", I get an error:

CleanShot 2023-03-23 at 12 45 32@2x

Does this tip help you find the cause of the issue?

@mshr-h
Copy link
Owner

mshr-h commented Mar 24, 2023

Do you see any text in the Output Window when you execute "Verilog: Return lint tool"?

@devindang
Copy link
Author

devindang commented Mar 24, 2023 via email

@mshr-h
Copy link
Owner

mshr-h commented Mar 24, 2023

What do you see when you execute "Verilog: Rerun lint tool" on a non-Verilog/SystemVerilog file such as text, python or javascript?
For my mac, I see the error "Verilog-HDL/SystemVerilog: No document opened".

@mshr-h
Copy link
Owner

mshr-h commented Mar 24, 2023

What do you see when you execute "Verilog: Rerun lint tool" on a non-Verilog/SystemVerilog file?
For my mac, I see the error "Verilog-HDL/SystemVerilog: No document opened".

Ah, never mind. You must see "Verilog-HDL/SystemVerilog: No document opened".

@mshr-h
Copy link
Owner

mshr-h commented Mar 24, 2023

The error happens between LintManager.ts#L128 and IcarusLinter.ts#L60.
I'll add some logging messages.

@devindang
Copy link
Author

What do you see when you execute "Verilog: Rerun lint tool" on a non-Verilog/SystemVerilog file?
For my mac, I see the error "Verilog-HDL/SystemVerilog: No document opened".

Ah, never mind. You must see "Verilog-HDL/SystemVerilog: No document opened".

Yes, I saw "Verilog-HDL/SystemVerilog: No document opened".

@devindang
Copy link
Author

The error happens between LintManager.ts#L128 and IcarusLinter.ts#L60.
I'll add some logging messages.

Well, thanks a lot

@mshr-h
Copy link
Owner

mshr-h commented Mar 24, 2023

Released v1.11.2 with more logging messages.
Please try it and share Output Window when you execute "Verilog: Rerun lint tool".

For my mac, I got this

2023-03-24 18:29:02.117 [info] [lint-manager] Executing LintManagerrunLintTool()
2023-03-24 18:29:02.118 [info] [lint-manager] document.languageId = systemverilog
2023-03-24 18:29:02.314 [info] [lint-manager] linterStr = {"label":"iverilog","description":"Icarus Verilog"}
2023-03-24 18:29:02.315 [info] [lint-manager] linter = {"diagnosticCollection":{"d":"generated_diagnostic_collection_name#4","e":"generated_diagnostic_collection_name#4","f":1000,"c":false},"name":"iverilog","logger":{"name":"Verilog","logLevel":3},"linterInstalledPath":"","configuration":{"arguments":"","includePath":[],"verilogHDL":{"standard":"Verilog-2005"},"systemVerilog":{"standard":"SystemVerilog2012"},"runAtFileLocation":false},"arguments":"","includePath":[],"standards":{},"runAtFileLocation":false}
2023-03-24 18:29:02.315 [info] [lint-manager] vscode.window.activeTextEditor.document = {"uri":{"$mid":1,"fsPath":"/Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","external":"file:///Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","path":"/Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","scheme":"file"},"fileName":"/Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","isUntitled":false,"languageId":"systemverilog","version":1,"isClosed":false,"isDirty":false,"eol":1,"lineCount":7}
2023-03-24 18:29:02.315 [info] [iverilog-lint] Executing IcarusLinter.lint()
2023-03-24 18:29:02.315 [info] [iverilog-lint] iverilog binary path: iverilog
2023-03-24 18:29:02.315 [info] [iverilog-lint] Execute
2023-03-24 18:29:02.315 [info] [iverilog-lint] command: iverilog -t null -g2012 /Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv
2023-03-24 18:29:02.315 [info] [iverilog-lint] cwd : /Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support
2023-03-24 18:29:02.334 [info] [iverilog-lint] 2 errors/warnings returned

@mshr-h mshr-h self-assigned this Mar 24, 2023
@devindang
Copy link
Author

Released v1.11.2 with more logging messages. Please try it and share Output Window when you execute "Verilog: Rerun lint tool".

For my mac, I got this

2023-03-24 18:29:02.117 [info] [lint-manager] Executing LintManagerrunLintTool()
2023-03-24 18:29:02.118 [info] [lint-manager] document.languageId = systemverilog
2023-03-24 18:29:02.314 [info] [lint-manager] linterStr = {"label":"iverilog","description":"Icarus Verilog"}
2023-03-24 18:29:02.315 [info] [lint-manager] linter = {"diagnosticCollection":{"d":"generated_diagnostic_collection_name#4","e":"generated_diagnostic_collection_name#4","f":1000,"c":false},"name":"iverilog","logger":{"name":"Verilog","logLevel":3},"linterInstalledPath":"","configuration":{"arguments":"","includePath":[],"verilogHDL":{"standard":"Verilog-2005"},"systemVerilog":{"standard":"SystemVerilog2012"},"runAtFileLocation":false},"arguments":"","includePath":[],"standards":{},"runAtFileLocation":false}
2023-03-24 18:29:02.315 [info] [lint-manager] vscode.window.activeTextEditor.document = {"uri":{"$mid":1,"fsPath":"/Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","external":"file:///Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","path":"/Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","scheme":"file"},"fileName":"/Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv","isUntitled":false,"languageId":"systemverilog","version":1,"isClosed":false,"isDirty":false,"eol":1,"lineCount":7}
2023-03-24 18:29:02.315 [info] [iverilog-lint] Executing IcarusLinter.lint()
2023-03-24 18:29:02.315 [info] [iverilog-lint] iverilog binary path: iverilog
2023-03-24 18:29:02.315 [info] [iverilog-lint] Execute
2023-03-24 18:29:02.315 [info] [iverilog-lint] command: iverilog -t null -g2012 /Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support/language_examples/systemverilog/property_1.sv
2023-03-24 18:29:02.315 [info] [iverilog-lint] cwd : /Users/mshr-h/workspace/mshr-h/vscode-verilog-hdl-support
2023-03-24 18:29:02.334 [info] [iverilog-lint] 2 errors/warnings returned

I got this, and see the picture

2023-03-24 18:23:52.008 [info] Hover requested
2023-03-24 18:23:54.224 [info] [lint-manager] Executing LintManagerrunLintTool()
2023-03-24 18:23:54.224 [info] [lint-manager] document.languageId = verilog
2023-03-24 18:23:56.298 [info] [lint-manager] linterStr = {"label":"iverilog","description":"Icarus Verilog"}
2023-03-24 18:23:56.298 [info] [lint-manager] linter = {"diagnosticCollection":{"d":"generated_diagnostic_collection_name#0","e":"generated_diagnostic_collection_name#0","f":1000,"c":false},"name":"iverilog","logger":{"name":"Verilog","logLevel":3},"linterInstalledPath":"/opt/homebrew/Cellar/icarus-verilog/11.0/bin/","configuration":{"arguments":"","includePath":[],"verilogHDL":{"standard":"Verilog-2005"},"systemVerilog":{"standard":"SystemVerilog2012"},"runAtFileLocation":false},"arguments":"","includePath":[],"standards":{},"runAtFileLocation":false}
2023-03-24 18:23:56.298 [info] [lint-manager] vscode.window.activeTextEditor.document = {"uri":{"$mid":1,"fsPath":"/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","external":"file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","path":"/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","scheme":"file"},"fileName":"/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","isUntitled":false,"languageId":"verilog","version":1,"isClosed":false,"isDirty":false,"eol":1,"lineCount":189}
2023-03-24 18:23:56.298 [info] [iverilog-lint] Executing IcarusLinter.lint()
2023-03-24 18:23:56.298 [info] [iverilog-lint] iverilog binary path: /opt/homebrew/Cellar/icarus-verilog/11.0/bin/iverilog

CleanShot 2023-03-24 at 18 24 05@2x

@mshr-h
Copy link
Owner

mshr-h commented Mar 24, 2023

Thanks.
Can you try with this extension.
I added more logging messages. It's not officially released.
The source code is at https://github.com/mshr-h/vscode-verilog-hdl-support/tree/debug-407.

@devindang
Copy link
Author

Thanks.
Can you try with this extension.
I added more logging messages. It's not officially released.
The source code is at https://github.com/mshr-h/vscode-verilog-hdl-support/tree/debug-407.

Yes, the following is the result.

2023-03-24 19:14:26.184 [info] mshr-h.veriloghdl is now active.
2023-03-24 19:14:26.184 [info] [Ctags] ctags manager configure
2023-03-24 19:14:26.184 [info] [lint-manager] Using linter: iverilog
2023-03-24 19:14:26.184 [info] [iverilog-lint] Executing IcarusLinter.lint()
2023-03-24 19:14:26.184 [info] [iverilog-lint] iverilog binary path: iverilog
2023-03-24 19:14:26.184 [info] [iverilog-lint] doc.languageId = verilog
2023-03-24 19:14:26.184 [info] [iverilog-lint] includePath = []
2023-03-24 19:14:26.184 [info] [iverilog-lint] arguments = ""
2023-03-24 19:14:26.184 [info] [iverilog-lint] doc.uri.fsPath = "/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v"
2023-03-24 19:14:26.184 [info] [iverilog-lint] args: ["-t null","-g2005","","/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v"]
2023-03-24 19:14:26.184 [info] [iverilog-lint] Execute
2023-03-24 19:14:26.184 [info] [iverilog-lint] command: iverilog -t null -g2005 /Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-24 19:14:26.184 [info] [VerilogSymbol] Symbols Requested: file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-24 19:14:26.184 [info] [Ctags] indexing...
2023-03-24 19:14:26.184 [info] [Ctags] executing ctags
2023-03-24 19:14:26.184 [info] [VerilogSymbol] Symbols Requested: file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-24 19:14:26.184 [info] [Ctags] indexing...
2023-03-24 19:14:26.184 [info] [Ctags] executing ctags
2023-03-24 19:14:26.184 [info] [VerilogSymbol] Symbols Requested: file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-24 19:14:26.184 [info] [Ctags] indexing...
2023-03-24 19:14:26.184 [info] [Ctags] executing ctags

CleanShot 2023-03-24 at 19 16 25@2x

@mshr-h
Copy link
Owner

mshr-h commented Mar 25, 2023

I see.
Can you try this?
Added more log messages.

@devindang
Copy link
Author

This is the outputs:

2023-03-25 15:30:16.282 [info] mshr-h.veriloghdl is now active.
2023-03-25 15:30:16.282 [info] [lint-manager] Using linter: iverilog
2023-03-25 15:30:16.282 [info] [iverilog-lint] Executing IcarusLinter.lint()
2023-03-25 15:30:16.282 [info] [iverilog-lint] iverilog binary path: iverilog
2023-03-25 15:30:16.282 [info] [iverilog-lint] doc.languageId = verilog
2023-03-25 15:30:16.282 [info] [iverilog-lint] includePath = []
2023-03-25 15:30:16.282 [info] [iverilog-lint] arguments = ""
2023-03-25 15:30:16.282 [info] [iverilog-lint] doc.uri.fsPath = "/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v"
2023-03-25 15:30:16.282 [info] [iverilog-lint] args: ["-t null","-g2005","","/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v"]
2023-03-25 15:30:16.282 [info] [iverilog-lint] Execute
2023-03-25 15:30:16.282 [info] [iverilog-lint] command: iverilog -t null -g2005 /Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-25 15:30:16.282 [info] [iverilog-lint] runAtFileLocation = false
2023-03-25 15:30:16.282 [info] [iverilog-lint] doc.uri = {"$mid":1,"fsPath":"/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","external":"file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","path":"/Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v","scheme":"file"}
2023-03-25 15:30:16.282 [info] [iverilog-lint] vscode.workspace.workspaceFolders = undefined
2023-03-25 15:30:16.282 [info] [VerilogSymbol] Symbols Requested: file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-25 15:30:16.282 [info] [VerilogSymbol] Symbols Requested: file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-25 15:30:16.282 [info] [VerilogSymbol] Symbols Requested: file:///Users/devin/Documents/workspace/amba/ahb2apb/ahb_to_apb.v
2023-03-25 15:30:31.589 [info] Hover requested
2023-03-25 15:30:31.785 [info] Hover requested
2023-03-25 15:30:34.310 [info] Hover requested

@mshr-h
Copy link
Owner

mshr-h commented Mar 25, 2023

I could reproduce the problem on Windows.
image

The error happens around IcarusLinter.ts#L70.

When you don't open the workspace folder and you try to run lint, then you get the error.
If the runAtFileLocation option is false, then cwd (working directory of iverilog process) will be the path of the workspace folder but you didn't open it. So cwd will be undefined.

You need to open the folder when you run lint.

@mshr-h
Copy link
Owner

mshr-h commented Mar 25, 2023

I'm not going to solve the problem soon because I don't use it in such a way. I always open the workspace folder.
But PR is welcome.

@mshr-h
Copy link
Owner

mshr-h commented Mar 26, 2023

The problem might be solved by enabling "runAtFileLocation" option. It forces to use the file location as the cwd.

mshr-h added a commit that referenced this issue Mar 27, 2023
@mshr-h mshr-h mentioned this issue Mar 27, 2023
@mshr-h mshr-h closed this as completed in f5179c3 Mar 27, 2023
@mshr-h
Copy link
Owner

mshr-h commented Mar 27, 2023

The problem may have been fixed in v1.11.3.
You need to uninstall the extension and install it from the marketplace.
If you still have the problem, please reopen the issue.

@devindang
Copy link
Author

The problem may have been fixed in v1.11.3.
You need to uninstall the extension and install it from the marketplace.
If you still have the problem, please reopen the issue.

Thank you, it gets worked now when I just open a file without opening a folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants