Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| language:langs:chp [2025/05/01 17:04] – [Debugging during simulation] rajit | language:langs:chp [2025/11/17 18:26] (current) – [Debugging and other support functions for simulation] rajit |
|---|
| <code act> | <code act> |
| [ v = 0 -> x := x - v | [ v = 0 -> x := x - v |
| [] ( [] i : 3 : v = i+2 -> x := x + i | [] ( [] i : 3 : v = i+2 -> x := x + i ) |
| ] | ] |
| </code> | </code> |
| where ''N'' is the number of channels in the ''I'' array. This approach ensures that index for the array ''I[]'' is always a constant. | where ''N'' is the number of channels in the ''I'' array. This approach ensures that index for the array ''I[]'' is always a constant. |
| |
| ===== Debugging during simulation ===== | ===== Debugging and other support functions for simulation ===== |
| |
| When running CHP simulations, it is often helpful to print debugging output during CHP development. To support this, the CHP language includes the ''log()'' command. | When running CHP simulations, it is often helpful to print debugging output during CHP development. To support this, the CHP language includes the ''log()'' command. |
| </code> | </code> |
| |
| Booleans are displayed as integers, with ''0'' corresponding to false, ''1'' corresponding to true. Integers can also be displayed in hexadecimal, binary, or decimal (the default). The integer display mode can be changed with a prefix in a string, as shown in the example above. | Booleans are displayed as integers, with ''0'' corresponding to false, ''1'' corresponding to true. Integers can also be displayed in hexadecimal, binary, or decimal (the default). The integer display mode can be changed with a prefix in a string, as shown in the example above. Other modifiers are ''%u'' for unsigned integers, and ''%d'' for signed integers. |
| |
| Other support functions of this type are: | Other support functions of this type are: |