Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
language:langs:chp [2025/05/01 17:01] – [Debugging during simulation] rajitlanguage:langs:chp [2025/05/01 17:04] (current) – [Debugging during simulation] rajit
Line 331: Line 331:
 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.
Line 360: Line 360:
  
 Other support functions of this type are: Other support functions of this type are:
-  * ''warn'' : displays a warning +  * ''warn(string)'' : displays a warning 
-  * ''assert'' : the first argument has to be an expression, and if it is non-zero then an assertion failed message is displayed.+  * ''assert(expr,string)'' : the first argument has to be an expression, and if it is non-zero then an assertion failed message is displayed.
   * In the standard ''log'', a single line is displayed based on the items in the argument list. To split this into multiple ''log'' commands, use:   * In the standard ''log'', a single line is displayed based on the items in the argument list. To split this into multiple ''log'' commands, use:
      * ''log_st()'' : start a log message      * ''log_st()'' : start a log message
-     * ''log_p(): append to the output message+     * ''log_p(item,item,item...)'' : append to the output message, with the same syntax as the ''log()'' command.
      * ''log_nl()'' : new line      * ''log_nl()'' : new line