Filter Rules

Filters operate only on the level of individual signals or pins. Bus signals or bus pins are never taken into account while filtering. For example: the Add Signal dialog contains a bus named ABUS, with elements BIN and BIN1. If a filter A is set for signal names, the bus is not displayed. On the other hand, if a filter B is set, the bus is displayed.

Filters are not case sensitive by default, but case sensitivity may be selected in the Setup > Settings + Filters dialog, by checking the Case sensitive option in the Filter Settings group.

Filters may contain special characters, which, for instance, allow construction of a filter for displaying only pins which Function contains the text VREF. The following sections describe Wildcard Filters, and Regular Expression Filters in detail.

Wildcard Filters

Wildcard filters use special characters such as * in a similar way to filename wildcards. Wildcard filters are treated as if they had * character appended at the end, for example, filter A is the same as A*, and matches strings beginning with the letter A.

The following characters are treated special in wildcard filters:

Table 13-1. Wildcard Filters

?

Matches any single character.

*

Matches any number (including zero) of any characters.

[ ]

Characters inside square brackets are called character classes.

Character class matches any single character included in the class.

For example, [abc] matches any of the letters a, b, c.

-

This character is treated specially in character classes. It is used to denote ranges. For example, [a-z] matches any letter. A character class may contain several ranges, so e.g., [a-z0-9] matches any letter or digit.

^

This character used immediately after opening square bracket negates the character classes, e.g., [^a-z] matches any character except letters.


Regular Expression Filters

Regular expression filters use the popular regular expression syntax known in many programs such as grep, Perl, etc. providing a more powerful filtering method than wildcards.

In order to use regular expressions in filters, they must be enabled. Select Setup > Settings + Filters and check the Regular expressions option.

The following characters are treated as special in regular expression filters:

Table 13-2. Regular Expression Filters 

.

 

Matches any character.

^

 

Matches the beginning of the string.

$

 

Matches the end of the string.

\

 

The meaning depends on the character that follows \ . See Table  below.

[ ]

 

Characters inside square brackets are called character classes. Character class matches any single character included in the class. For example, [abc] matches any of the letters a, b, c.

-

 

The character - is treated specially in character classes. It is used to denote ranges. For example, [a-z] matches any letter. A character class may contain several ranges, so [a-z0-9] matches any letter or digit.

^

 

The character ^ used immediately after opening square bracket negates the character class, so [^a-z] matches any character except for letters.

( )

 

Parentheses are used to group elements. Grouping elements of a regular expression is useful for using ? not for a single letter, but a longer expression instead.

?

 

Matches zero or one occurrence of the preceding expression (i.e., single character, character class, or grouped elements).

+

 

Matches one or more occurrences of the preceding expression.

*

 

Matches zero or more occurrences of the preceding expression.

{ }

 

Notation {n,m} matches at least n, and at most m occurrences of the preceding expression. There are shortcut forms:

{n} means {n,n};

{n,} means {n,max};

{,m} means {0,m}.


The backslash \ character is used to construct further special constructs, which are listed below.

Table 13-3. Backslash Character Filters 

\d

Matches a single digit, so it is the same as [0-9]

\D

Matches non-digits, so it is the same as [^0-9]

\s

Matches whitespace.

\S

Matches non-whitespace.

\w

Matches a word character.

\W

Matches a non-word character.


Regular expression filters do not need to match the entire string to succeed. For instance, while wildcard filter A* matches any string beginning with the letter A, the regular expression filter A.* matches any string containing the letter A. This feature does not limit expressiveness of regular expression filters, since the two special characters ^ $ may be used to force matching of the whole string. In short, the regular expression equivalent to wildcard filter A* is ^A.*$.

Custom Filters

In Setup > Settings + Filters, you can alter default filter settings for named groups of signals or pins such as I/O, clock, and differential. You can also define new custom filters that suit your specific needs. You can use a custom pin filter with a custom signal filter to display only those pins on a device that have that signal.

Creating Custom Filters

To create a custom filter:

  1. Select Setup > Settings.
  1. In the Settings Dialog, under Filters, select Signals or Pins to open the Signals or Pins section of the Settings Dialog.
  1. In the Signals or Pins section, click Add below the Filter subsection to create a new entry. The new entry is highlighted, and reads <Please edit filter name>, as shown in Figure 13-1.

Figure 13-1. Adding Custom Filter

  1. Enter an appropriate name for the filter in place of <Please edit filter name>. For example, if you want to filter the ALU signals you could name the filter ALU. (If you inadvertently click elsewhere before entering a name, double- or triple-click <Please edit filter name> to re-highlight it, then enter the name of the signals or pins to filter.)
  1. Click Add below the Column | Expression subsection. A default entry, PCB Name for a signal filter, or Signal for a pin filter, appears under Column.
  1. Double click on the default entry under Column to open a dropdown list of available Signals or Pins table columns, and select the column you want to sort on.
  1. Double click in the Expression column, just to the right of the Column entry, and enter the filter string. For example, ALU.
  1. Click Apply and then OK at the bottom of the Settings Dialog.
  1. Click the arrow at the right side of the Signals or Pins entry boxes to select the custom filters you created from the dropdown list at the top of the Signals or Pins table, as shown in Figure 13-2.

Figure 13-2. Selecting Custom Filter from Dropdown List