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

[BUG] localparams added as params in module instance #102

Closed
markusdd opened this issue May 8, 2020 · 6 comments
Closed

[BUG] localparams added as params in module instance #102

markusdd opened this issue May 8, 2020 · 6 comments
Labels

Comments

@markusdd
Copy link

markusdd commented May 8, 2020

Describe the bug
A clear and concise description of what the bug is.

Environment (please complete the following information):

  • OS: macOS catalina
  • VS Code version 1.45
  • Extension version 1.0.6

Steps to reproduce
create a simple module using a localparam
instantiate this module using the instantiate module command

Expected behavior
localparams are not added to instantiation

Actual behavior
localparams are added to instantiation, which is syntactically and semantically wrong

@markusdd markusdd added the bug label May 8, 2020
@markusdd
Copy link
Author

markusdd commented May 9, 2020

grafik

The problem is most likely here. Constants also incorporante localparams und specparams.

The fix would be to quickly parse the actual string that ctags gives and check if the definition actually starts with 'parameter'

@markusdd
Copy link
Author

Parsing that out of ctags is currently tedious.
I ahve opened an upstream issue to provide a cleaner way of seperating defines, localparams, parameters and specparams:
universal-ctags/ctags#2537

@hirooih
Copy link
Contributor

hirooih commented Jul 11, 2023

Note that Universal Ctags fixed the issue in Oct. 2020, universal-ctags/ctags#2537 (comment).

@Mightlaus
Copy link

Mightlaus commented Dec 3, 2023

Sorry, I still don't know how to correctly configure ctags to ignore localparam when instantiating.

I've tried adding --fields-Verilog=+{parameter} arguments, but it seems to result in opposite effect -- Only the parameter constants are being ignored, while all other localparam constants persist when instantiating.

This is my plugin setting:
image
This is the instantiation results:
image

Environment::
OS: Windows 10 22H2
Ctags: v6.0.0-x64
VScode: v1.84.2
Plugin: v1.13.0

hirooih added a commit to hirooih/vscode-verilog-hdl-support that referenced this issue Dec 10, 2023
By adding `--fields-SystemVerilog=+{parameter}` option uctag,
it emits the 6th field, `parameter:`.

When `parameter:` is emitted, this fix override type as `parameter`.

Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
@hirooih
Copy link
Contributor

hirooih commented Dec 10, 2023

@Mightlaus

I added a new feature to Universal Ctags to fix this issue three years ago. I am disappointed to know that it has not been used.

Although I have little experience for typescript programming, I made a fix and sent a PR (#457).
As I wrote in the PR, the fix is not tested, because I don't have environment to test VS code extension.

I hope this helps this project.

mshr-h added a commit that referenced this issue Jan 15, 2024
use uctag parameter field option for module instantiation (#102)
@mshr-h mshr-h closed this as completed Jan 15, 2024
@RickyTino
Copy link

Hi, I am quite sure this untested fix has caused #479 , which occurs on v1.13.1 but not seen on v1.13.0.
Until now ctags still recognizes all kind of params as 'constant' but not 'parameter’
image

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

5 participants