AR# 24999

9.1i EDK - MicroBlaze v5/v6.0a integer divide generates incorrect results


MicroBlaze hardware integer division generates incorrect results for certain operands, for example 0x633b6b00 / 0xde713373. The problem occurs in MB v5 and v6.00.a.


The error is due to the IDIV instruction on MB.

For MB v.5.00x, you can work around this issue by using the FDIV instruction instead. If you need to perform integer divisions, you can write the code as follows:

i3 = (unsigned int) ((float) i1 / (float) i2) ;

i4 = (unsigned int) ((float) i2 / (float) i1) ;

For MB v6.00a, the same work-around applies. You can also work around it by setting the parameter C_AREA_OPTIMIZED to "1" in your MB instantiation.

This problem has been fixed in MB v6.00.b in the latest EDK 9.1i Service Pack, available at:
The first service pack containing the fix is EDK 9.1i Service Pack 1.

AR# 24999
日期 12/15/2012
状态 Active
Type 综合文章