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

Undetected multiple drivers on wire when connected to module output port. #2167

Open
laforest opened this issue Feb 12, 2020 · 2 comments
Open

Undetected multiple drivers on wire when connected to module output port. #2167

laforest opened this issue Feb 12, 2020 · 2 comments

Comments

@laforest
Copy link

@laforest laforest commented Feb 12, 2020

This seems related to issue #1184
Given:

parameter WORD_WIDTH = 32; (or any convenient value)
wire [WORD_WIDTH-1:0] foo = 0;

some_module instance_name
(
.output_port (foo)
);

The Verilator linter does not notice the multiple drivers on "foo".
Icarus Verilog raises no warnings, but correctly simulates an X on any bits not set to zero by the module output port.
Vivado synthesis will correctly fail with a multiple drivers error.

This error originated when I changed the type of "foo" from reg to wire, because the driving logic was put into a module, and forgot to remove the intial value.

Perhaps Verilator could check that wires on module output ports do not have any assignments, or that wires with assignments cannot be used to connect to module outputs.

@wsnyder

This comment has been minimized.

Copy link
Member

@wsnyder wsnyder commented Feb 13, 2020

Agreed this should give a MULTIDRIVEN. Took a quick look as thought would be trivial, but there's some complications so will need to get back to it.

@laforest

This comment has been minimized.

Copy link
Author

@laforest laforest commented Feb 13, 2020

Thanks. I appreciate it.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.