The Find dialogue helps you to find signal patterns. It behaves like the standard find dialogue of the text editors. You type in a find expression, select if you want to search forwards or reverse, with or without wrapping and then click find. The active cursor will be placed at the found position.
To start searching, select the signals to search and press Ctrl-f. The Find dialogue pops up with a predefined expression. This expression contains all selected signals and compares them with the values at the active cursor position.
Modify the expression to your needs and press find. The active cursor will be placed at the found position. Click Reverse to do reverse searching, or Wrap to move from the end of the signal to its beginning.
If the expression has an error, you will get a message in the status log below.
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.
The signal variables s1,s2,… are of the type ISamplePointer. For each search step, the sample pointers are adjusted to the new position and the expression is evaluated. Returning a Boolean true means that the search was successful; false means that the search need to continue.
Usually all statements of an expression are within the context of the current domain position. If you wish to compare relative positions, then you can use the relative method to obtain a relative pointer.
s0.isEdge(1) && s1.relative("-10ns").fhex()=='x2521'
The expression above returns true at the current position, if s0 has a positive edge and s1's value was 'x2521' 10 ns 'before'.
Logic signal expressions are made easier by using the format methods. There are fbin,fhex,foct and fdec.
s0.fbin()=='b1' && s1.fbin()=='b0' && s2.fbin()=='b0' && s3.fhex()=='x2521'
Instead of the conversion routines, you can test logic signals with isEdge,isHigh and isLow. These methods have optional parameters for edge detection that can be left empty.
s0.isEdge(1) && // 1: rising edge -1: falling edge s1.fbin()=='b1' && s2.isHigh()
Use the val method to get the native current value. You can compare it with usual js methods.
s0.val()>4.0 && s1.val()==0.0 && s2.val()
You might use the val or stringValue method to get the current value.
s0.stringValue()=='Stop' && s1.stringValue()=='0'
The struct access members xxxxOf({member}) allows you to compare all members of a struct. Here the method stringValueOf is used:
s0.stringValueOf('Level')=='WARN' && s0.stringValueOf('Message') .indexOf("version") >=0