11 Synchronisation

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

This article is based on impulse 1.8.

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.

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

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.

Open JavaDoc Reference Show Synchronisation examples

More about scripting impulse

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 reset<:ISamplePointer:> = isync.getPointer( 'wavetest\\reset_s');
if (reset != null){
    if (reset.goNextEdge( 0)){
        console.println( "Synced: "+reset.getPosition());
        console.println( "Sync not found!");
        console.println( "Signal 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 set the pointer to the next negative edge.
If successful it calls isync.setSynced with the pointer position as argument.
After enabling synchronization and re-loading we find that the default script is not working for us. This is shown in the log and the signal area (pipe input not synchronized).
in fact our case is slightly more complicated and would look like this:

var reset<:ISamplePointer:> = isync.getPointer( 'scope\\reset');
var log<:ISamplePointer:> = 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))
        console.println( "reset pos: "+reset.getPosition());
        console.println( "log pos: "+log.positionAt(0));
        console.println( "Synced: "+ pos);
        console.println( "Sync not found!");
        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


User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive