standard.tcl
2.63 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#
# 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.
#
#####
##### You can pick the amount of detail info to collect by setting the
##### detailLevel variable before you source standard.tcl. The following
##### levels are supported.
#####
##### 0 - no annotations set, translate virtual not done
##### 1 - minimal annotations for process tracking, user anns and bdoor,
##### translate virtual done
##### 2 - level 1 plus modes support for summary and doProfile
##### 3 - level 2 plus kernel stats
##### 4 - level 3 plus sync stats
#####
##### detailLevel defaults to 2
#####
if ![info exists detailLevel] {
set detailLevel 2
}
FileSourced standard.tcl
console "@@@@ standard.tcl: detailLevel=$detailLevel \n"
console "@@@@ TargetOS = $SIMOS(TargetOS)\n"
if {($SIMOS(TargetOS) == "IRIX5.3") ||
($SIMOS(TargetOS) == "IRIX6.2") ||
($SIMOS(TargetOS) == "IRIX6.4") } {
set newPath $simosPath/irix
lappend simosPath $newPath
}
if {$SIMOS(ISA) == "ALPHA"} {
symbol load vmunix $PARAM(ALPHA.Files.Kernel)
source tlaser.tcl
}
###
### translate_virtual.tcl
###
### walks kernel symbol tables to translate faulting address from tcl
### kernel must be loaded into symbols
### exports u variable to be used in symbol exprs
### exports private variable to be used in symbol exprs
### exports K0BASE constant
### exports K2BASE constant
###
if {$detailLevel >= 1} {
source "translate_virtual.tcl"
}
###
### os.tcl
###
### raises the simulators knowledge to the OS level
### kernel must be loaded into symbols
### exports osEvent annotation type
### exports PID variable per cpu
### exports PROCESS variable per cpu
### exports inUserMode proc
###
if {$detailLevel >= 1} {
source "os.tcl"
}
###
### user_anns.tcl
###
### allows annotations to be set on user virtual addresses
### exports registerUserAnns proc
###
if {$detailLevel >= 1} {
source "user_anns.tcl"
}
###
### bdoor.tcl
###
### allows you to run arbitrary tcl from the simulated OS command line
###
if {$detailLevel >= 1} {
source "bdoor.tcl"
}
###
### modes.tcl
###
### basic modes breakdown
###
if {$detailLevel >= 2} {
source "modes.tcl"
}
###
### kernel_stats.tcl
###
if {$detailLevel >= 3} {
source "kernel_stats.tcl"
}
###
### sync_stats.tcl
###
if {$detailLevel >= 4} {
if {$PARAM(CPU.Count) >= 2} {
source "sync_stats.tcl"
}
}
###
### Override Tcl's exit routine with ours so stats come out.
###
if {![info exists noExitOverride]} {
proc exit { } {
simosExit
}
}