<textcon>.wait-for-string [-reverse] [-always] [-regexp] "string"
Wait for the output of the text string on the console. This command can only be run from a script branch where it suspends the branch until the string has been found in the output. If -regexp is specified, the breakpoint string will be interpreted as a regular expression (regexp). The regexp syntax follows the common Perl style, as interpreted by the Hyperscan library https://hyperscan.io.
Note that the string is a Simics CLI string, and thus \ has to be escaped as \\ when writing the regexp.
Examples:
- Wait for 3 digits:
$con.wait-for-string -regexp "\\d{3}"
- Wait for a '4' somewhere between square brackets (note that in regular expressions, [] have special meanings, so must be escaped):
$con.wait-for-string -regexp "\\[.*4.*\\]"
- Wait for a 3 characters or 6 curly braces:
$con.wait-for-string -regexp "\\w{3}|[{}]{6}"
For more information about regular expression syntax, see https://perldoc.perl.org/re.html.
The command will by default only wait for events that occur when the simulation is running forward. To wait for events in the reverse direction use the -reverse flag. Similarly, the -always flag tells the command to wait for events in both simulation directions.
textcon
bp.console_string.wait-for,
<break_strings_v2>.bp-break-console-string, bp.console_string.wait-then-write,
script-branch