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

Redundant Net/Reg Redeclaration #5

Open
awhigham9 opened this issue Mar 24, 2020 · 0 comments
Open

Redundant Net/Reg Redeclaration #5

awhigham9 opened this issue Mar 24, 2020 · 0 comments

Comments

@awhigham9
Copy link
Owner

Currently output ports are converted to wire (if the original is just output) or reg (if the original is output reg) during the inlining process in the method Inliner._instantiation_to_inlined_body. This is done through a simple find and replace mechanism. However, this in Verilog it is typical, though not required, to declare and output and a reg of the same name (which hold the same values). For example:

module Foo;
    output bar;
    reg bar;
    //Code
endmodule;

When this is inlined from its instantiation by the aforementioned method, it will have a declaration of a wire bar and reg bar, which is incorrect. Only the latter declaration should be present.

One solution to this could be creating a new data member within the Module object to store a list of all regs and wires within the module. Alternatively a similar check could be performed at the time an output port is converted.

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