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

write_smt2: Check for constant bool after fully resolving signal #3953

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

georgerennie
Copy link
Collaborator

@georgerennie georgerennie commented Sep 24, 2023

Fixes #3769.

The issue occured when exporting a bit that is driven through some connections by the output of a cell, but is known to be a constant. This happens with e.g. the following

module top(input wire a, output wire b);
wire [1:0] inner = |a;
assign b = inner[1];
endmodule

where b is always 0, but is driven by the $reduce_or cell.

The previous code would export the $reduce_or just for inner[0]. When exporting b, the sigmap would be unable to map b through to the constant value driving it, so would create a fresh declare-fun for it.

With this change, when exporting b we first ensure that if there is a cell driving b it has been mapped and apply the sigmap. This allows the subsequent code to see that b is constant, and thus emit true/false directly, instead of doing declare-fun.

@georgerennie georgerennie changed the title smt2: Check for constant bool after fully resolving signal write_smt2: Check for constant bool after fully resolving signal Nov 7, 2024
@jix jix merged commit 558b2f9 into YosysHQ:main Nov 11, 2024
15 checks passed
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

Successfully merging this pull request may close these issues.

write_smt2: redundant uninterpreted function
2 participants