Open togulcan opened 2 years ago
AFAIU this is a bug.
This is indeed an oversight in the implementation of at least the ETISS code generator. CoreDSL type promotion rules are more or less ignored completely in M2-ISA-R as of now, therefore standard C type promotion rules are used in ETISS. I will look into this, but it will probably take a moment to properly fix.
I realized in the below operation wrong return value
Z
is generated during the summation of X and Y:I believe this is due to the fact that
X
andY
are translating to C types (etiss_uint32
) and their summation also returnsetiss_uint32
which drops the overflow value(32nd bit).However when I do casting explicitly as follows:
It works pretty well.
But coredsl2 manual guarantees no dropping is occurring by simply setting the width of the result value to
wr = max(w1 + 1, w2 + 1)
. Should not M2-ISA-R also guarantee this? This is leading to a lot of unexpected behaviors.Thanks a lot!