See the specification of scf.while. The first region calculates the while condition, and the second region is the loop body.
The implementation is similar to make_if, which requires moving the condition inside the region. Since A[i] < 10 in Python is evaluated first before calling the function hcl.while_, it may be built outside the region. Thus, the correct way is to remove the original A[i] < 10 and rebuild a new one inside the region.
See the specification of
scf.while
. The first region calculates the while condition, and the second region is the loop body.The implementation is similar to
make_if
, which requires moving the condition inside the region. SinceA[i] < 10
in Python is evaluated first before calling the functionhcl.while_
, it may be built outside the region. Thus, the correct way is to remove the originalA[i] < 10
and rebuild a new one inside the region.