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

Continuous assign drives right-hand side #4893

Open
rantvm opened this issue Feb 11, 2025 · 0 comments
Open

Continuous assign drives right-hand side #4893

rantvm opened this issue Feb 11, 2025 · 0 comments
Labels
pending-verification This issue is pending verification and/or reproduction

Comments

@rantvm
Copy link

rantvm commented Feb 11, 2025

Version

Yosys 0.49+29 (git sha1 ce5ad2a, clang++ 18.1.8 -fPIC -O3)

On which OS did this happen?

Linux

Reproduction Steps

The following Verilog exhibits the unexpected behaviour. Note, in particular, that top.first_delay is only present on the right-hand side of a continuous assign.

module top
(
  input wire clock,
  input wire signal,
  output wire first_delay,
  output wire second_delay
);

  wire delay;
  dff dff1(clock, signal, delay);
  dff dff2(clock, delay, second_delay);
  
  assign second_delay = first_delay;
endmodule


module dff
(
  input wire c,
  input wire d,
  output reg q
);

  always @(posedge c)
    q <= d;

endmodule

Then synthesize using yosys -p 'read_verilog top.v; synth; show top'

Expected Behavior

top.first_delay should float. Diagnostic should be issued for top.second_delay being doubly-driven.

Actual Behavior

top.second_delay is driven onto top.first_delay. No diagnostic is issued.

Synthesis result illustrated in the following diagram produced by show -format svg top.

Image

@rantvm rantvm added the pending-verification This issue is pending verification and/or reproduction label Feb 11, 2025
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