init.tksimos.sample 3.34 KB
#
# 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. 
#
# TkSimOS checks for files to source in three different places:
# 1) .tksimosrc in your home directory
# 2) init.tksimos in the CWD
# 3) Any files specified on the TkSimOS command line

# Automatically update veriables every 5 seconds
set varUpdatePeriod 5

# Update modes breakdown every 5 seconds
set modesUpdatePeriod 5

# List of hosts to appear in the host selection menu
set hostlist { sim sparcplug1 }

# Default hostname and port for SimOS connection
set hostname sim
set visualPort 5105


# Number of ticks in the variable charts and modes breakdown stripchart
set chartEntries 50

# Function called by TkSimOS immediately after it connects to SimOS
proc connectHook {} {
}

# Function called by TkSimOS upon opening the variable table
proc varTableHook {} {
    # Add some variables to the initial variable table display
    varDisplay CYCLES; varFormat CYCLES dec
    varDisplay pc;     varFormat pc     hex
    varDisplay KHz;    varFormat KHz    flt.1
}

# Define some derived variables
varDefine time { clock clicks }

varDefine KHz {
    expr 1024.0 * [var CYCLES periodic] * [var PARAM(CPU.Count)] /  \
        [var time periodic]
}

# The foreground and background colors of the modes breakdown may be changed
#set modes_bg wheat3
#set modes_fg black

# Defining strip charts:
# The definition contains a name for the chart, and a list of fields
# for the chart.  Each field definition is composed of a field name, the
# expression used to compute the value of the field, and the color used 
# to represent the field (optional: the default is black).

chartDefine Profile {
    { Kernel {
        expr 256 * [bucket kernel,cycleSample] + [bucket kernel,instrCount] - \
            [bucket kernel,dStall]
    } green }
    { KernelLocalStall {
        expr [bucket kernel,dStall] - [bucket kernel,dL2RemoteStall]
    } yellow }
    { KernelRemoteStall {
        bucket kernel,dL2RemoteStall
    } orange }
    { Sync {
        expr 256 * [bucket sync,cycleSample] + [bucket sync,instrCount] - \
            [bucket sync,dStall]
    } red }
    { SyncStall {
        bucket sync,dStall
    } purple }
    { User {
        expr 256 * [bucket ROOT,cycleSample] + [bucket ROOT,instrCount] - \
            [bucket ROOT,dStall]
    } aquamarine }
    { UserLocalStall {
        expr [bucket ROOT,dStall] - [bucket ROOT,dL2RemoteStall]
    } blue }
    { UserRemoteStall {
        bucket ROOT,dL2RemoteStall
    } DarkSlateGray }
    { Idle {
        expr 256 * [bucket idle,cycleSample] + [bucket idle,instrCount]
    } white }
}

chartDefine StallTime {
    { Local {
        expr [bucket kernel,dStall] + [bucket sync,dStall] + \
            [bucket ROOT,dStall] + [bucket idle,dStall] - \
            [bucket kernel,dL2RemoteStall] - [bucket sync,dL2RemoteStall] - \
            [bucket ROOT,dL2RemoteStall] - [bucket idle,dL2RemoteStall]
    } aquamarine }
    { Remote {
        expr [bucket kernel,dL2RemoteStall] + [bucket sync,dL2RemoteStall] + \
            [bucket ROOT,dL2RemoteStall] + [bucket idle,dL2RemoteStall]
    } cornflowerblue }
}

chartDefine KHz {
    { KHz {
        expr 1024.0 * [var CYCLES periodic] * [var PARAM(CPU.Count)] / \
            [expr [var time periodic] + .0000001]
   } }
}