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

Yosys does not accept module port lists with .port_identifier #4708

Open
ldoolitt opened this issue Nov 5, 2024 · 1 comment
Open

Yosys does not accept module port lists with .port_identifier #4708

ldoolitt opened this issue Nov 5, 2024 · 1 comment
Labels
pending-verification This issue is pending verification and/or reproduction

Comments

@ldoolitt
Copy link
Contributor

ldoolitt commented Nov 5, 2024

Version

Yosys 0.46 (git sha1 e97731b, g++ 12.2.0-14 -fPIC -O3)

On which OS did this happen?

Linux

Reproduction Steps

cat > same_port.v << EOT
module same_port (.a(i), .b(i)); // Name 'i' is declared inside the
                    // module as a inout port. Names 'a' and 'b' are
                    // defined for port connections.
inout i;
wire i;
endmodule
EOT
yosys -p "read_verilog same_port.v"

Expected Behavior

No crash.
IEEE Std 1354-2001 Version C gives the following BNF:

port ::=
  [ port expression ]
  | .port_identifier([port_expression])

and the same_port.v example file above is straight from the standard, p.187,
with the last three lines to complete the picture.

Vivado and iverilog both handle this case correctly.

Actual Behavior


 /----------------------------------------------------------------------------\
 |  yosys -- Yosys Open SYnthesis Suite                                       |
 |  Copyright (C) 2012 - 2024  Claire Xenia Wolf <claire@yosyshq.com>         |
 |  Distributed under an ISC-like license, type "license" to see terms        |
 \----------------------------------------------------------------------------/
 Yosys 0.46 (git sha1 e97731b9d, g++ 12.2.0-14 -fPIC -O3)

-- Running command `read_verilog same_port.v' --

1. Executing Verilog-2005 frontend: same_port.v
Parsing Verilog input from `same_port.v' to AST representation.
same_port.v:1: ERROR: syntax error, unexpected TOK_ID, expecting '.'
@ldoolitt ldoolitt added the pending-verification This issue is pending verification and/or reproduction label Nov 5, 2024
@ldoolitt
Copy link
Contributor Author

ldoolitt commented Nov 5, 2024

Verilator also fails this test.
See its issue 5588 verilator/verilator#5588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-verification This issue is pending verification and/or reproduction
Projects
None yet
Development

No branches or pull requests

1 participant