Skip to content

opt_clean reverses some connections #3426

@georgerennie

Description

@georgerennie

Steps to reproduce the issue

read_verilog <<EOT
module top(
	input wire in,
	output wire out1, out2
);

wire int1, int2;
assign int1 = in;
assign out1 = in;
assign out2 = int2;

endmodule
EOT

dump
opt_clean
dump

Expected behavior

Both dump outputs should contain

  connect \int1 \in
  connect \out1 \in
  connect \out2 \int2

Actual behavior

Second dump output instead contains

  connect \int2 \out2
  connect \int1 \in
  connect \out1 \in

Notably, the connection between out2 and int2 has been reversed. I played around with connecting a few different types of signals and only saw this occur for an undriven signal driving an output wire.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions