Skip to content
Merged
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
28 changes: 7 additions & 21 deletions src/verilog/verilog_synthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,7 @@ void verilog_synthesist::assignment_rec(

if(it->type().id()==ID_bool)
{
exprt bit_extract(ID_extractbit, it->type());
bit_extract.add_to_operands(rhs);
bit_extract.add_to_operands(offset_constant);
exprt bit_extract = extractbit_exprt{rhs, offset_constant};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason not to use

Suggested change
exprt bit_extract = extractbit_exprt{rhs, offset_constant};
extractbit_exprt bit_extract{rhs, offset_constant};

instead? Equally applies to all changes below.

++offset;

assignment_rec(*it, bit_extract, blocking);
Expand Down Expand Up @@ -771,18 +769,12 @@ exprt verilog_synthesist::assignment_rec(const exprt &lhs, const exprt &rhs)
{
exprt offset = from_integer(i - from, integer_typet());

exprt rhs_extractbit(ID_extractbit, bool_typet());
rhs_extractbit.reserve_operands(2);
rhs_extractbit.add_to_operands(rhs);
rhs_extractbit.add_to_operands(std::move(offset));
exprt rhs_extractbit = extractbit_exprt{rhs, std::move(offset)};

exprt count = from_integer(i, integer_typet());

exprt new_rhs(ID_with, lhs_src.type());
new_rhs.reserve_operands(3);
new_rhs.add_to_operands(synth_lhs_src);
new_rhs.add_to_operands(std::move(count));
new_rhs.add_to_operands(std::move(rhs_extractbit));
exprt new_rhs =
with_exprt{synth_lhs_src, std::move(count), std::move(rhs_extractbit)};

// do the value
exprt new_value = assignment_rec(lhs_src, new_rhs); // recursive call
Expand Down Expand Up @@ -851,18 +843,12 @@ exprt verilog_synthesist::assignment_rec(const exprt &lhs, const exprt &rhs)
{
exprt offset = from_integer(i - index, integer_typet());

exprt rhs_extractbit(ID_extractbit, bool_typet());
rhs_extractbit.reserve_operands(2);
rhs_extractbit.add_to_operands(rhs);
rhs_extractbit.add_to_operands(std::move(offset));
exprt rhs_extractbit = extractbit_exprt{rhs, std::move(offset)};

exprt count = from_integer(i, integer_typet());

exprt new_rhs(ID_with, lhs_src.type());
new_rhs.reserve_operands(3);
new_rhs.add_to_operands(synth_lhs_src);
new_rhs.add_to_operands(std::move(count));
new_rhs.add_to_operands(std::move(rhs_extractbit));
exprt new_rhs =
with_exprt{synth_lhs_src, std::move(count), std::move(rhs_extractbit)};

// do the value
exprt new_value = assignment_rec(lhs_src, new_rhs); // recursive call
Expand Down
Loading