user_exit.tcl
865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Copyright (C) 1996-1998 by the Board of Trustees
# of Leland Stanford Junior University.
#
# This file is part of the SimOS distribution.
# See LICENSE file for terms of the license.
#
#
# user_exit.tcl
#
# Kill the simulator after a certain number of user instructions have
# been executed. Note that the count is not exact. It will exit on the
# first kernel
#
# $Author: blythe $
# $Date: 2002/05/29 01:09:09 $
annotation set osEvent startUser {
set userInstsStart($CPU) $INSTS
}
annotation set osEvent endUser {
global userExitInsts
set instsExecuted [expr $INSTS - $userInstsStart($CPU)]
set remaining [expr $userExitInsts - $instsExecuted]
if {$remaining < 0} {
console "USER_EXIT: leaving with $remaining remaining instructions\n"
simosExit
} else {
set userExitInsts $remaining
}
}