11 Synchronisation

impulse can handle signal data from multiple inputs. When inputs don't have a common domain base, synchronization may be required.

Port synchronization

Using a multi port adapter, you can combine an unlimited number of different input ports (e.g. a logic analyzer and a log input from a pipe).
As each port has its own domain base by default (the log input uses the application time domain, the log analyzer has its own time domain),
there must be a mean to synchronize these input to get them meaningful displayed.

impulse support the following approaches:

  1. Specify a fixed domain value offset for a given port. This approach make sense in case that the offset is fixed and can be measured by other means.
  2. Calculate a domain value offset for a given port based on the captured signals.

Approach 1 can be seen as subset of 2. Approach 2 is making sense if there are signals from both ports existing that can be set in relation.

Using a synchronization script

No matter if you develop a reader, a recJs script, a search expression or a Signal Script production, impulse provides you always with the same interfaces to read, compare, analyze or generate signal data.

If you open the port adapter dialogue of the log input, you will find the synchronization script field and flag at the bottom of the window. It usually contains this example script:

// base: root cell of type ICell (usually a record cell)
// insertPoint: root cell of this port of type PortScope  
// isync: sync interface of type IPortSync  
// console: console output of type MessageConsoleStream
 
var clk /*:ISamplePointer:*/ = isync.getPointer('wavetest\\clk_s');
if (clk != null && clk.getCount() > 10) {
    console.println("Signals found!");
    clk.goNextEdge(-1);
    clk.goNextEdge(-1);
    clk.goNextEdge(-1);
    clk.goNextEdge(-1);
    var pos = clk.getPosition();
    console.println("clk pos: " + clk.getPosition());
    isync.setSynced(pos);
    console.println("Synced: " + pos);
} else
    console.println("Signals not found!");

The system will call this script continuously while reading the input until the method isync.setSynced(position) is called.

The script first request a pointer to a given signal. If the signal is available, it tries to move the pointer.
If successful, it calls isync.setSynced with the pointer position as argument.


A more complex example

Lets assume the above mentioned logic analyzer reads 2 inputs (Reset / I2C) and the log input contains the application/kernel logs.
To synchronize the log input we may:

  • Detect the time of the first log message
  • Detect the time of the reset inactive change
  • We further assume that the first log is generated t2l=10us after reset
  • Set the domain delta of the log input -> delta=tr-tl+t2l

This case is slightly more complicated and a script would look like this:

var reset = isync.getPointer( 'scope\\reset');
var log = isync.getPointer( 'pipe\\top\\HHShell\\m4_top\\mDist_dsp_access\\#r2_top');
if (reset != null && log!=null){
    if (reset.goNextEdge( 0) && log.getCount()>0){
        var pos = reset.getPosition( ).sub( log.positionAt(0))
            .add(DomainValue.valueOf("10us"));
        console.println( "reset pos: "+reset.getPosition());
        console.println( "log pos: "+log.positionAt(0));
        isync.setSynced(pos);
        console.println( "Synced: "+ pos);
    }else
        console.println( "Sync not found!");
}else
        console.println( "Signals not found!");

The script first request a pointer for the reset and the log signal. If both signals are available, it tries to set the pointer of the reset signal to the next negative edge and checks if the log signal has at least 1 message.. If successful it calculates the delta and calls isync.setSynced.
Here is the result:

	reset pos: 5us
	log pos: 300974ps
	Synced: 14699026ps
toem

technical software and tooling

Company

Contact Us

This email address is being protected from spambots. You need JavaScript enabled to view it.