Skip to content

Commit

Permalink
mambo: Add util function for breaking on console output
Browse files Browse the repository at this point in the history
Mambo can execute a trigger when certain output appears on the console.
You can run any tcl function when the trigger fires, but the simplest
thing to use it for is stopping the simulation.

Add a helper to do that, break_on_console(), and a matching function to
clear the trigger, clear_console_break().

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
mpe authored and stewartsmith committed Apr 7, 2017
1 parent 1a7bd4b commit 8c9b253
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions external/mambo/mambo_utils.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ proc b { addr } {
puts "breakpoint set at $at"
}

# Run until $console_string appears on the Linux console
#
# eg.
# break_on_console "Freeing unused kernel memory:"
# break_on_console "buildroot login:"

proc break_on_console { console_string } {
mysim trigger set console "$console_string" "just_stop"
}

proc clear_console_break { console_string } {
mysim trigger clear console "$console_string"
}

proc wr { start stop } {
mysim trigger set memory system w $start $stop 0 "just_stop"
}
Expand Down

0 comments on commit 8c9b253

Please sign in to comment.