Yosys pass opt_expr performing unexpected simplification of ternary condition. #4331
Unanswered
vcanumalla
asked this question in
Q&A
Replies: 1 comment 2 replies
-
That optimization is quite correct,
So they can only have the values 0 or 1. This would correspond to these enum values:
But the ones being compared against are |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following verilog file, a modified version of a DSP simulation model link here.
In particular, I've made a number of modifications to this file to make it compatible with a series of Yosys passes that the tool I'm using performs, the one that might immediately relevant to my problem is that I've converted string values to variants in an enum.
On line 1171 I have the following block, which details the multiply functionality of the DSP.
The parameters of this DSP say that use_mult and use_simd must be certain values to use the multiplier, and this ternary as such follows these semantics: the multiplier is only when its a one lane adder, and use_mult is activated.
However, when running a series of Yosys passes, this assign is being simplified to
assign mult_o = 48'0
.I've narrowed down the specific pass that does this simplification to
opt_expr
, and the issue can be replicated using the following commandyosys -p "read_verilog -sv DSP48E1.v; hierarchy -simcheck -top DSP48E1; debug opt_expr; write_verilog output/tmpoutputv.sv" > output.log
.Here are some relevant lines from
output.log
:I'd appreciate some help in understanding why opt_expr is performing this simplification: I'm not able to convince myself that its always true.
Please let me know if any other info would be useful, and thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions