Skip to content

fix for netlist conversion #675

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

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions regression/ebmc/netlist/netlist-conversion1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CORE
netlist-conversion1.v
--bound 1 --aig
^EXIT=10$
^SIGNAL=0$
10 changes: 10 additions & 0 deletions regression/ebmc/netlist/netlist-conversion1.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module main(input clk);

reg [0:0] q;

always @(posedge clk)
q[0] <= q[0];

always assert p1: q[0];

endmodule
5 changes: 5 additions & 0 deletions src/trans-netlist/trans_to_netlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,11 @@ void convert_trans_to_netlistt::convert_lhs_rec(
// default
forall_operands(it, expr)
{
// natural/integer-typed expressions do not contain symbols, and hence,
// do not need to be recursed into.
if(it->type().id() == ID_natural || it->type().id() == ID_integer)
continue;
Comment on lines +598 to +599
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious/would appreciate a comment in the code: Why is "ignore this" the right way to go here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done -- this whole function should be replaced by a proper dependency graph, which could be reused elsewhere.


std::size_t width=boolbv_width(it->type());

if(width==0)
Expand Down