Tuesday, February 3, 2015

Use SDL on Palladium - Trigger when a signal stays for a while

State Description Language(SDL) is a run-time debugging feature on Palladium that can control several aspects of the run such as when to stop, or when to capture probed data(tracing). More details can be referred to Ref[1]

Here is a very quick guide on how to use SDL. 

1. Support SDL at Compilation stage
To use SDL, the database may need to be compiled with some options. Here is an example of compilation options used for a SDL program with four sdl instances.
compilerOption -add {sdlInstances 4}
compilerOption -add{sdlDisplayWidth 1222}
compilerOption -add {sdlTraceDepth 4M}

2. Use SDL and direct output of SDL program to a file. An example of SDL program is here.
sdl -setFile test.tdf
sdl -enable 
sdl -display  -console 0 /* Turn off console output */
sdl -display -file  test.log

I hit a situation that IO hang when running Palladium database and noticed a signal stays with a value without changing whenever IO hang. The signal represents a state in a state machine. This means the state machine somehow cannot progress. So it seems that the signal could be the clue why IO hang. And I need to find out what 
happened that caused the state machine hang. SDL seems to be a good choice to do this. Here is the SDL program
that I wrote to trigger and probe data(tracing). It is based on one example in the section of SDL Program Examples in Ref[1].

State One
{
    if (state_signal[38:0] == 'h0000080000) // wait until the specific state is entered 
    {
          load counter1 32000;
          goto Two;
    }
}

State Two
{
    if (counter1 <=0)    // if state not changed for 32000 FCLKs, state machine hang. So trigger at this time. 
        trigger;
    if (state_signal[38:0] != 'h0000080000)     //if state changed, no hang, start over again
        goto One;
}

Then I set the trigger position to 50% and a capture period of 320000 FCLKs, execute "run /nowait". This way I captured some data right before the state machine  to analyze why the state machine hang.


Reference
------------
1. UXE User Guide (Cadence), Chapter Controlling the Run with SDL. 


No comments:

Post a Comment