#!/bin/bash


###################################################################
#  Naked Checkpoint Configuration 
#     The following options are for the 'naked' checkpoints.
#     These checkpoints are taken immediately after logging in to 
#     a simulated system and are used as the base for future 
#     workload checkpoints.  
###################################################################

# NAKED_CHECKPOINT_FAMILY_NAME
#  This is a name indicating a family of checkpoints that share a common configuration.
#  The checkpoint family should uniquely represent the OS type and the configuration of 
#  a target machine (indicated by the parameters in the 'Operating System Configuration' 
#  and 'Target Machine Configuration' sections below)
#
#  Within a given checkpoint family, many different processor/memory configurations are made.
#
#  The checkpoint family name determines how various files that will be generated are named.    
#
NAKED_CHECKPOINT_FAMILY_NAME=platinum

# NAKED_CHECKPOINT_DIR
#  This is the location that you will store the naked checkpoints and disk images for the 
#  famliy indicated by NAKED_CHECKPOINT_FAMILY_NAME
#
#
NAKED_CHECKPOINT_DIR=/p/multifacet/projects/nobackup5/platinum

# NAKED_CHECKPOINT_COMMON_FILE
#  This is the location of a file used by all naked checkpoints created for the 
#  family corresponding to NAKED_CHECKPOINT_FAMILY_NAME
#
#  ***You should only change this if you REALLY know what you're doing.***
#
#  This file is expected to be located in the GEMS_ROOT/checkpoints/simics_scripts directory 
#
NAKED_CHECKPOINT_COMMON_FILE=naked-common.simics

# NAKED_CHECKPOINT_RUN_FILE
#  This is the simics file used to create the naked checkpoints
#
#  ***You should not change this unless you really know what you're doing.***
#
#  This file is expected to be located in the GEMS_ROOT/checkpoints/simics_scripts directory 
#
NAKED_CHECKPOINT_RUN_FILE=naked-run.simics

###################################################################
#  Target Machine Configuration 
#     The following options determine how the simulated system will 
#     be configured.  
###################################################################

# TARGET_CPU_FREQ_MHZ
#  Specifies the clock speed for the simulated processors, in MHz.
#  This should be kept artifically low to reduce simulation time.
#  Ruby/Opal report statistics based on their own internal clock 
#  speed.
#
TARGET_CPU_FREQ_MHZ=75

# TARGET_DISK_SIZE_BYTES, TARGET_DISK_CYLINDERS, TARGET_DISK_HEADS, TARGET_DISK_TRACKS
#  These configurations collectively determine the layout of the target machine main 
#  disk that will hold the OS and binaries.
#
#  Combinations known to work in Simics are:
#    (size,       cylinders, heads, tracks)
#    (8513945600, 10940,     19,    80)
#    (4290969600,  5470,     19,    80)
#    (2145484800,  2735,     19,    80)
#
TARGET_MAIN_DISK_SIZE_BYTES=8513945600
TARGET_MAIN_DISK_CYLINDERS=10940
TARGET_MAIN_DISK_HEADS=19
TARGET_MAIN_DISK_TRACKS=80

# TARGET_ETHERNET_ADDRESS
#  This is the MAC address that the simulated network card will broadcast
#
TARGET_ETHERNET_ADDRESS=10:10:10:10:10:24

# TARGET_NI_IP_ADDRESS
#  This is the IP address the network interface card will be configured at
#
TARGET_NI_IP_ADDRESS=10.10.0.11

# TARGET_NETMASK
#  This is the subnet mask the host will use
#
TARGET_NETMASK=255.255.255.0

# TARGET_HOSTNAME
#  This is the hostname of the simulated system
#
TARGET_HOSTNAME=sarek.network.sim

# TARGET_ROUTER_IP_ADDRESS
#  This is the ip address of the system's router
#
TARGET_ROUTER_IP_ADDRESS=10.10.0.1

#################################################################
#  Operating System Configuration
#   These parameters guide the installation of the operating
#   system on the simulated machine.  For a given naked 
#   checkpoint family, the OS will only be installed once.
#################################################################

# OS_NAME
#  The name of the OS you will be using.  
#  Valid values are:
#     SolarisExpress
#     Solaris10
#     Solaris9
#     Solaris8
#
OS_NAME=SolarisExpress

# OS_INSTALL_CD_1(2) 
#   This is the path to the first and second OS install CDs.  
#   Only the first two CD images of Solaris Express are needed.
#   You should provide the location of the unzipped iso images.
#
#   NOTE: The CD images are NOT included with the GEMS release.  
#   Images can be aquired from Sun's website.
#
OS_INSTALL_CD_1=/p/multifacet/users/drh5/checkpoints/sol-nv-b64a-sparc-v1.iso
OS_INSTALL_CD_2=/p/multifacet/users/drh5/checkpoints/sol-nv-b64a-sparc-v2.iso

# OS_AUTO_PROMPT
#  A true/false value indicating whether or not to automatically enter prompt values during the OS install.
#  If set to true, the Simics disk image will be created without any user interaction.
#  You can use this parameter to debug when the installation script fails.
#
#  Under normal conditions, this should be set to true
#
OS_AUTO_PROMPT=true

# OS_LANGUAGE
#  The language that the OS will be configured under. This parameter is a number corresponding to the following:
#    1 - English
#    2 - French
#    3 - German
#    4 - Italian
#    5 - Japanese
#    6 - Korean
#    7 - Simplified Chinese
#    8 - Spanish
#    9 - Swedish
#   10 - Traditional Chinese
#
OS_LANGUAGE=1

##################################################################
#  Simics Configuration
##################################################################

# SIMICS_VERSION
#  The Simics version you are creating a checkpoint for.
#  This script is only tested on version 2.2.19.  Additional 
#  version support will be added soon.
#
SIMICS_VERSION=2.2.19

# SIMICS_DIR
#  Points to the location on the host disk of the top level Simics directory 
#  of the release you want to use (and that corresponds to SIMICS_VERSION above)
#
SIMICS_DIR=/p/multifacet/projects/xfdr/simics_2.2.19

# SIMICS_MEMORY_LAYOUT
#  This parameter affects how the simulated Simics machine will attempt
#  to distribute main memory.
#  Choices are: S-NUMA, Greedy
#
#  S-NUMA spreads memory out evenly over all processor boards (like static NUMA)
#  Greedy places memory top-heavy in the system (as much as possible in the lowest numbered boards)
#
#  As of this release, Solaris is incabable of doing NUMA-aware memory
#  allocation in a Simics environment.  Thus, for now you should keep this 
#  set to greedy to keep the memory footprint of Ruby small
#
SIMICS_MEMORY_LAYOUT=Greedy

# SIMICS_HOST_MACHINE_TYPE
#  This is the type of machine that you will be running Simics on.
#  (i.e. the machine you run the workload creation script from)
#  Valid values are x86-linux, amd64-linux, v9-sol8-, etc...
#
SIMICS_HOST_MACHINE_TYPE=amd64-linux


###############################################################
##        DO NOT MODIFY ANYTHING BELOW THIS LINE            ###
##                                                          ### 
###############################################################

# set up parameters specific to the simics version number
if [ ${SIMICS_VERSION:0:1} = "2" ]; then
    SIMICS_MAJOR_VERSION=2
elif [ ${SIMICS_VERSION:0:1} = "3" ]; then
    SIMICS_MAJOR_VERSION=3
else
    echo "The Simics version you specified ($SIMICS_VERSION) is unsupported"
    exit
fi

NAKED_CHECKPOINT_CONF=${NAKED_CHECKPOINT_FAMILY_NAME}-${TARGET_NUM_PROCS}p-${TARGET_MEM_SIZE_MB}mb

if [ ${OS_NAME} = "SolarisExpress" ];then 
    SIMICSFS_VERSION=simicsfs-sol10
    CD_INSTALL_1_SCRIPT=solarisexpress-cd-install-1.simics
    CD_INSTALL_2_SCRIPT=solarisexpress-cd-install-2.simics
elif [ ${OS_NAME} = "Solaris10" ]; then
    SIMICSFS_VERSION=simicsfs-sol10
    CD_INSTALL_1_SCRIPT=sol10-cd-install-1.simics
    CD_INSTALL_2_SCRIPT=sol10-cd-install-2.simics
elif [ ${OS_NAME} = "Solaris9" ]; then
    SIMICSFS_VERSION=simicsfs-sol9
    CD_INSTALL_1_SCRIPT=sol9-cd-install-1.simics
    CD_INSTALL_2_SCRIPT=sol9-cd-install-2.simics
elif [ ${OS_NAME} = "Solaris8" ]; then
    SIMICSFS_VERSION=simicsfs-sol8
    CD_INSTALL_1_SCRIPT=sol8-cd-install-1.simics
    CD_INSTALL_2_SCRIPT=sol8-cd-install-2.simics
else
    echo "Invalid OS_NAME: ${OS_NAME}"
    exit
fi
