Event Recorder and Component Viewer  Version 1.5.1
MDK Debugger Views for Status and Event Information
Expressions

The SCVD interpreter has built-in evaluation for expressions that are used in various XML elements and attributes. An expression is a combination of operands and Operators that evaluate to a resulting value where the type of the result is derived from the expression.

An operand may be a numeric constant, a variable, a built-in function, a predefined variable, or an expression. Operators are used to combine and compare operands.

Operators

Operators combine and compare operands. Operators may be unary (requiring one operand) or binary (requiring two operands). The combination of an operator and its operands is an expression. Parentheses can be used in expressions with multiple operators to specify the order of evaluation. If no parentheses are used in an expression, then the operator precedence determines the evaluation order.

Operators Precedence Description
( ) 1 Parentheses can be used to specify the order of evaluation
.member 2 Type member
typedef_name:member:enum 2 Enumerator value; refer to enum
typedef_name:member 2 Type-member selector for use in __Offset_of intrinsic; refer to member
Unary +, Unary — 3 Unary plus or minus applied to the following operand
* / % 4 Multiplication, Division, or Modulo
+ — 5 Addition, Subtraction
<< >> 6 Shift left, Shift right
& | ^ 7 Binary AND, OR, XOR
== != > >= < <= 8 Comparisons
&& || 9 Logical AND, OR
e ? e : e 10 Conditional operator
= |= &= ^= += -= *= /= %= 11 Assignment operators
Note
  • Because the character & is reserved in XML, it is required for logical operations to use &amp; instead.
  • Use &quot; whenever this quote is not part of an XML structure.

Code Examples

<item property="Wait" cond="TCB[i].p_blnk &amp;&amp; TCB[i].State == Thread_CB:State:WaitingSemaphore" value="%S[TCB[i].p_blnk]" />
<item property="Round Robin Timeout" value="%T[((float) (rrobin &amp; 0xFFFF) * (float) clockrate / 1000)] mSec" />
<item property="__Symbol_exists (&quot;os_active_TCB&quot;)" value="%t[__Symbol_exists (&quot;os_active_TCB&quot;) ? &quot;Yes&quot; : &quot;No&quot;]" />

Numeric Constants

Numeric constants are supported in standard 'C' format, for example: 13, 0xF8, 1.5, 1E+10.

Enumerator Values

A symbolic enumerator name (enum) represents a constant value that can be referenced using the syntax :typedef_name:member:enum.

Variables

The SCVD interpreter has the following ways to define local variables that can be used in expressions:

  • Element var in the typedef section defines variables which are used in context with typedef, typically for temporary calculations.
    These are automatically generated with read and readlist.
  • Element var in the objects section defines scalar or array variables.

Predefined Variables

Predefined variables can be used without a declaration or definition.

Predefined Variable Description
__Running Indicates program execution at target: 1=run, 0=stop
_count Counts the number of items in readlist and read elements.
_addr Returns the memory address of a readlist member.