We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 31918

10.1 EDK - "MicroBlaze FSL get instructions may cause the subsequent instruction to use an incorrect register value"


Keywords: fast, simplex, link, custom, peripheral, pcore

The error only occurs under the following circumstances:
- MicroBlaze is configured for performance (C_AREA_OPTIMIZED = 0).
- MicroBlaze is not using extended FSL (C_USE_EXTENDED_FSL_INSTR = 0).
- MicroBlaze is executing an FSL get instruction, and the succeeding instruction uses the same register that the FSL get instruction is modifying.
- The instruction preceding the FSL get instruction is stalling the pipeline at the same time that the FSL get instruction is executing.
- These instructions are all FPU instructions; integer divide instructions and load/store with waitstates.

This problem affects all MicroBlaze versions v5.00a and newer.


There are several possible work-arounds:
- Set C_USE_FSL_EXTENDED = 1, the error can only occur when C_USE_FSL_EXTENDED = 0


- Make sure that all FSL get instructions are either preceded or followed by a NOP instruction.
If the application is using the EDK provided macros for the FSL instructions, they can be modified in the following manner:

Current definition of "getfsl"
#define getfsl(val, id) asm volatile ("get\t%0,rfsl" stringify(id) : "=d" (val))

Change it to:
#define getfsl(val, id) asm volatile ("nop; get\t%0,rfsl" stringify(id) : "=d" (val))

The same modification has to be done for the ngetfsl, cgetfsl, and ncgetfsl macros. These macros are defined in the "mb_interface.h" file, which is copied from the EDK installation to the local project every time libgen is executed. The modification of "mb_interface.h" can either be performed in the EDK installation or in the local project. The EDK installation path is for example, "sw/lib/bsp/standalone_v2_00_a/src/microblaze", when using standalone library version v2_00_a. The project file path is "<microblaze_instance_name>/include".

NOTE: If the project local file is modified, it will be overwritten when libgen is executed.
Fixed in: In the next MicroBlaze version to be released in EDK 11.1.
AR# 31918
Date Created 11/17/2008
Last Updated 11/17/2008
Status Active
Type General Article