Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.270

How to LBIST

In this topic:

Configuration steps

Code example

Debug password protection

 

 

Introduction

This topic describes how to execute LBIST via boot rom (SSW) through user code with code examples. Logical Built-In Self Test (LBIST) is a form of built-in self-test in which the logic inside a chip can be tested on-chip itself.

 

 

Configuration steps

number1

Prepare LBIST Execution.

LBIST can be executed by the application. Below is a simple, working code sample using TASKING Compiler:

 

SCU_LBISTCTRL0.B.LBISTRES = 1;      //Reset LBIST controller        
SCU_LBISTCTRL0.B.PATTERNS = 0x200//Set 80 pattern number    
SCU_LBISTCTRL1.U = 0x54000007;     //Set seed to 7, 7th pattern
SCU_LBISTCTRL2.U = 0x86;            //Set LBIST Maximum Scan-Chain length  
SCU_LBISTCTRL0.B.LBISTREQRED = 1//LBIST execution request (safety double of LBISTREQ)  
SCU_LBISTCTRL0.B.LBISTREQ = 1;      // LBIST execution request (origin)

 

number2

Run the application

When LBIST is finished, the debugger detects an internal AURIX Reset. This special reset is not visible on the debug port. Therefore, the debugger recognizes the lost connection when it periodically (every 500 ms) checks the SoC status. Normally, this check is not performed as often for performance reasons (e.g., Real-Time watches). After losing connection, the debugger needs to re-establish the Debug session, breakpoints, and other settings.

 

Debug status in winIDEA will be          SoC ATTACHING        .

 

Breakpoints are re-established once the Debug connection is valid again. This process takes a significant amount of time while the SoC runs code uncontrolled after the LBIST reset.

 

number3

(optional) Investigate the gap period.

Instrument your code using the example provided below.

 

If the measured gap is too large, use the Hardware | CPU Options | SoC | Quick LBIST detection option. Be aware that having this option enabled will reduce some other metrics of debug performance.

 

Number4

Control the Code Execution.

Use the debug() instruction to stop code execution. This instruction behaves as a nop if the debug system is disabled.

Exit the _debug() loop using the Goto option in the Context menu of the Editor pane.

 

Number5

Instrument code.

Software instrumentation allows you to stop your application at a certain point in code after LBIST execution and continue with debugging and tracing from there. The _debug() instruction is a universal approach to stop within code.

 

 

Code example

volatile unsigned int iCounter, iLBISTExecuted;
// ask if LBIST was done successfully
iLBISTExecuted = SCU_LBISTCTRL0.B.LBISTDONE; //SCU_LBISTCTRL0_LBISTDONE = 1 if LBIST executed

 
// Loop for waiting until Debug connection is re-established, then stop.
//The “iCounter” is for control only.

 
if (iLBISTExecuted)  // LBIST recently executed
{
   while(1)
   {
       iCounter++;
       __debug();
   }
}
 

 
// Invoke LBIST via Code if it was not already executed
if (!iLBISTExecuted)  // no LBIST executed, invoke one via Software
{
   /* LBIST execution */
   SCU_LBISTCTRL0.B.LBISTRES    = 1;         
   //reset LBIST controller-clears results of previous execution and LBISTDONE bit, new LBIST is possible
   SCU_LBISTCTRL0.B.PATTERNS    = 0x200;     
   //set 80 pattern number,number of scan-patterns-scan captures
   SCU_LBISTCTRL1.U             = 0x54000007;
   //set seed to 7, 7th pattern is applied to EDT, SPLITSH = 4, four scan partitions. LBISTFREQU=5
   SCU_LBISTCTRL2.U             = 0x86;     
   //LBIST Maximum Scan-Chain length
   SCU_LBISTCTRL0.B.LBISTREQRED = 1;         
   //LBIST execution request (safety double of LBISTREQ)
   SCU_LBISTCTRL0.B.LBISTREQ    = 1;         
   //LBIST execution request (origin)
}

 

 

Debug password protection

If the chip’ debug peripherals are password-protected, enable Detect application LBIST execution option in Hardware | CPU Options | SoC Advanced.

Because the debug password can only be applied for a short period after the LBIST reset, this option aids winIDEA in detecting the LBIST execution on time. When using this option, one hardware breakpoint will be used to detect application LBIST execution.

 

 

More resources

SoC

Knowledge Base - Troubleshooting tips

 

 

Copyright © 2024 TASKING