3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-05-05 23:05:47 +00:00

Merge upstream

This commit is contained in:
Akash Levy 2025-02-03 09:33:16 -08:00
commit 993b23e747
6 changed files with 52 additions and 24 deletions

View file

@ -2936,7 +2936,10 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
lsb_expr->children[stride_ix]->detectSignWidth(stride_width, stride_sign);
max_width = std::max(i_width, stride_width);
// Stride width calculated from actual stride value.
stride_width = std::ceil(std::log2(std::abs(stride)));
if (stride == 0)
stride_width = 0;
else
stride_width = std::ceil(std::log2(std::abs(stride)));
if (i_width + stride_width > max_width) {
// For (truncated) i*stride to be within the range of dst, the following must hold: