AR# 15433

|

5.1i iMPACT - A STAPL file causes an integer overflow if the erase process does not work

Description

General Description: 

My STAPL player reports an error and an integer overflow.  

 

This problem is seen when an XC9500 device with a STAPL file is erased -- the procedures that adjust the programming delay instruct the STAPL player to multiply by 25 and divide by 100, which can cause an integer overflow on certain STAPL players, as follows: 

 

PROCEDURE ADJUST_DELAY USES TMPDATA, MAINDATA; 

TMP_DELAY = DELAY * 25; 

TMP_DELAY = TMP_DELAY / 100; 

DELAY = DELAY + TMP_DELAY; 

ENDPROC;

Solution

You can resolve this problem by changing the delay to /4 rather than (25/100): 

 

PROCEDURE ADJUST_DELAY USES TMPDATA, MAINDATA; 

TMP_DELAY = TMP_DELAY / 4; 

DELAY = DELAY + TMP_DELAY; 

ENDPROC;

AR# 15433
Date 05/14/2014
Status Archive
Type General Article
People Also Viewed