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

re_require_port_interface doesn't work with corresponding rules for inout, input, and output #284

Open
Binvention opened this issue Apr 4, 2024 · 0 comments

Comments

@Binvention
Copy link

Binvention commented Apr 4, 2024

with the re_required_port rules interfaces get mistaken for inout, input, or output depending on which was the last used. This makes it impossible to use the rules at the same time especially if different regex is used for each. For example the module

module test_module
(
    I.i    test_bad_if_1,
    input wire i_input_test,
    I.i    test_bad_if_2,
    output wire o_output_test,
    I.i    test_bad_if_3,
    inout wire io_inout_test,
    I.i    test_bad_if_4
);

endmodule : test_module

with the regex rules
re_required_port_interface = "^[a-z]+[a-z0-9_]$"
re_required_port_inout = "^[iov?[A-Za-z]+[A-Za-z0-9]
$"
re_required_port_input = "^[iv?[A-Za-z]+[A-Za-z0-9]$"
re_required_port_output = "^[ov?[A-Za-z]+[A-Za-z0-9]
$"

throws an error on all interfaces in the module but it does it for the inout rule on the first one, input rule on the second one, output rule on the third one, and inout rule on the 4th one. If the port name for the interface is changed to not match the regex it still throws the interface rule error but it also throws the other error as well.

Looking through the source code it looks like it is because the rules for inout, input, and output have checks in place for if the previous port direction was an input, output, inout, or ref but not a check for if it is an interface. (see re_required_port_inout.rs lines 28-44 as an example compare with re_require_port_interface.rs lines 26-34). I'm not familiar enough with the source code yet to know for sure or to fix it but that is what I was able to find

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

No branches or pull requests

1 participant