Skip to content

Bug: ports mentioned in verilog file are taken as declaration. #135

New issue

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

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

Already on GitHub? # to your account

Open
rahultanwar10 opened this issue Jan 30, 2025 · 0 comments
Open

Comments

@rahultanwar10
Copy link

There are two types of coding style in module's ports declaration.

FIRST:
module module_name (
input in1,
input in2,
output out1);

In ast output this is what i get:
Description
ModuleDef (name: module_name)
Paramlist
Portlist
Ioport
Input (name: in1)
Ioport
Input (name: in2)
Ioport
Output (name: out1)

SECOND:
module module_name (in1, in2, out1);
input in1;
input in2;
output out1;

In ast output this is what i get:
Description
ModuleDef (name: module_name)
Paramlist
Portlist
Port (name: in1)
Port (name: in2)
Port (name: out1)
Decl
Input (name: in1)
Decl
Input (name: in2)
Decl
Output (name: out1)

Now, I am working on some project in which i need to extract the port name and its direction. I have used the portlist class to find its direction (input or output or inout). So FIRST method works fine for me. But in SECOND case, i get the port names but not the direction. Direction is mentioned in the Decl class not in the Portlist class. So, my code is breaking. I have done a workaround in my project but i strongly feel that information about ports should be in Portlist class instead of Decl class. That's why i am opening this issue. If there is something that i am understanding wrong then please let me know.

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

No branches or pull requests

1 participant