Example #1
0
def cmd_set_bookmark(name):
    def get_bookmark_names():
        return [x[0] for x in re.obj.bookmarks]

    if not VT_hindsight_license_check():
        print "Command requires hindsight license."
        SIM_command_has_problem()
        return

    # throw an exception if no processors are present
    current_processor()

    if name is not None:
        if name in get_bookmark_names():
            re.obj.delete_bookmark = name
            print "bookmark %s moved to current time" % name
    else:
        bookmark_num = len(get_bookmark_names())
        while ("bookmark%d" % bookmark_num) in get_bookmark_names():
            bookmark_num += 1
        name = "bookmark%d" % bookmark_num
        print "bookmark %s set current time" % name

    output.divert(re.obj.state_level)
    re.obj.add_bookmark = name
    output.undivert()
Example #2
0
def cmd_unstep(count):
    if SIM_simics_is_running():
        raise CliError, "Simics is already running"
    if not VT_hindsight_license_check():
        print "Command requires hindsight license."
        SIM_command_has_problem()
        return

    pt = ptime()
    backer.rewind(pt - count, current_processor())
    output.divert(re.obj.state_level)
    VT_save_micro_checkpoint("<unstep-mark>", Sim_MC_ID_Tmp | Sim_MC_Persistent)
    output.undivert()

    output.separator()
    count = pt - ptime()
    if count > 0:
        eval_cli_line("si %d" % count)
    output.undivert()

    output.divert(re.obj.state_level)
    restore_state_with_id(Sim_MC_ID_Tmp)
    delete_state(0)
    output.undivert()