The contents of this chapter are informative only.
Filtering provides a mechanism to control whether the encoder should produce trace. For example, it may be desirable to trace:
-
When the instruction address is within a particular range;
-
Starting from one instruction address and continuing until a second instruction address;
-
For one or more specified privilege levels;
-
For a particular context or range of contexts;
-
Exception and/or interrupt handlers for specified exception causes or with particular tval values;
-
Based on values applied to the impdef or trigger signals;
-
For a fixed period of time
-
etc.
How this is accomplished is implementation specific.
One suggested implementation partitions the architecture into filters and comparators in order to provide maximum flexibility at low cost. The number of filters and comparators is system dependent.
Each comparator unit is actually a pair of comparators (Primary and Secondary, or P, S) allowing a bounded range to be matched with a single unit if required, and offers:
-
input selected from iaddress, context and tval (and daddress if data trace is supported);
-
A range of arithmetic options (<, >, =, !=, etc) independently selectable for each comparator;
-
Secondary match value may be used as a mask for the primary comparator;
-
The two comparators can be combined in several ways: P, P&&S, !(P&&S), latch (set on P clear on S);
-
Each comparator can also be used to explcitly report a particular instruction address (i.e. generate a watchpoint).
Each filter can specify filtering against instruction and optionally data trace inputs from the HART, and offers:
-
Require up to 3 run-time selectable comparator units to match;
-
Multiple choice selection for priv and cause inputs (and dtype if data trace is supported);
-
Masked matching for interrupt and impdef inputs.
Allowing for up to 3 comparators allows for simultaneous matching on Address, Trap value and context (unlikely, but should not be architecturally precluded).
The filtering configuration fields are detailed in [encoderControl]. These support the architecture described above, though will also support simpler implementations, for example where the comparator function is more tightly coupled with each filter, or where filtering is provided on only some inputs (such as just instruction address).