Hello
Thanks a lot Evangelos for directing me how to write a script for linux on
sparc. I wanted to share it, for everyone's benefit and probable correction.
(See in the end).

When I execute this file, it generates the flexus_test_warmup easily,
however when I try
./create-initial-flexpoints TraceFlex
it gives the following error.
=======================================================================================
./create-initial-flexpoint TraceFlex
Starting initial flexpoint creation of flexus_test with TraceFlex in
/home/sparsh/cdrive/flexus-3.0.0/flexus-test-app/runs/sparsh-TraceFlex-17Jun09-171712
More than one simulator binary is built. Don't know which one to use.
Launching job
Opening debug output file: debug.out
Opening debug output file: stats.out
Successfully parsed debug configurations from debug.cfg
Initializing Flexus::ConfigurationManager...done
Initializing Flexus::ComponentManager...done
Entered init_local
1 <startup.cpp:110> {0}- Initializing Flexus.

Flexus (C) 2006 The SimFlex Project
Eric Chung, Michael Ferdman, Brian Gold, Nikos Hardavellas, Jangwook Kim,
Ippokratis Pandis, Minglong Shao, Jared Smolens, Stephen Somogyi,
Evangelos Vlachos, Thomas Wenisch, Roland Wunderlich
Anastassia Ailamaki, Babak Falsafi and James C. Hoe.

Flexus Simics simulator - Built as TraceFlex 3.0

2 <ComponentManager.cpp:81> {0}- Instantiating system with a width factor
of: 1
3 <SimicsTracer.cpp:554> {0}- Initializing SimicsTracerManager.
4 <SimicsTracer.cpp:667> {0}- Connecting: cpu0
5 <SimicsTracer.cpp:670> {0}- DecoupledFeeder connects Flexus cpu0 to Simics
object cpu0
6 <SimicsTracer.cpp:689> {0}- Creating DMA map object
7 <SimicsTracer.cpp:697> {0}- Unable to connect DMA because there is no
cpu0_mem.
8 <SimicsTracer.cpp:566> {0}- Done initializing SimicsTracerManager.
9 <BPWarm.hpp:55> {0}- bpwarm port InsnOut is not wired
10 <FastCache.hpp:69> {0}- L1d port SnoopOut is not wired
11 <FastCache.hpp:69> {0}- L1d port Reads is not wired
12 <FastCache.hpp:69> {0}- L1d port Writes is not wired
13 <FastCache.hpp:69> {0}- L1i port SnoopOut is not wired
14 <FastCache.hpp:69> {0}- L1i port Reads is not wired
15 <FastCache.hpp:69> {0}- L1i port Writes is not wired
16 <FastCache.hpp:69> {0}- L2 port Reads is not wired
17 <FastCache.hpp:69> {0}- L2 port Writes is not wired
18 <FastBus.hpp:74> {0}- bus port Writes is not wired
19 <FastBus.hpp:74> {0}- bus port Reads is not wired
20 <FastBus.hpp:74> {0}- bus port Fetches is not wired
21 <FastBus.hpp:74> {0}- bus port Evictions is not wired
22 <FastBus.hpp:74> {0}- bus port Flushes is not wired
23 <FastBus.hpp:74> {0}- bus port Invalidations is not wired
24 <wiring.cpp:81> {0}-  initializing Parameters...
25 <flexus.cpp:377> {0}- Set stat interval to : 10000000
26 <flexus.cpp:397> {0}- Set profile interval to : 10000000
27 <flexus.cpp:402> {0}- Set timestamp interval to : 1000000
Opening debug output file: termination.out
Successfully parsed debug configurations from termination.dbg.cfg
[cpu0 info] Note that on this cpu, instruction-fetch-trace is implemented
using instruction-cache-access-trace with a suitable cache line size.
28 <ConfigurationManager.cpp:100> {0}- WARNING: -feeder:CMPwidth (CMPWidth)
was not set in initializeParameters(), from the command line, or from
Simics.
29 <ComponentManager.cpp:96> {0}- Initalizing components...
30 <SimicsTracer.cpp:597> {0}- NOTE!!! Make sure you use
"instruction-fetch-mode instruction-fetch-trace" in user-postload.simics to
enable Istream tracing.
31 <flexus.cpp:270> {0}- Timestamp: 2009-Jun-17 17:17:14
32 <FastCacheImpl.cpp:123> {0}- Running with MT width 1
33 <SimicsTracer.cpp:387> {0}- unhandled transaction type.  Transaction
follows:
34 <SimicsTracer.cpp:409> {0}- Mem Heir Instr: flush [%l6 + %g0] pc: 4054d4
35 <SimicsTracer.cpp:445> {0}-   Read @c2e8000[8] type=4 no-stall
36 <SimicsTracer.cpp:389> (<undefined>[<undefined>]) {0}- Assertion failed:
((!(false))) : <undefined>
Abort (SIGABRT) in main thread
The simulation state has been corrupted. Simulation cannot continue.
Please restart Simics.
[cpu0] v:0x00000000004054d4 p:0x000004054d4  flush [%l6 + %g0]
simics>

=======================================================================================

When I compile for x86, everything till run-timing-jobs is fine. I fear that
in prepare-test-app-v9, the file says:
run-command-file "serengeti-6800-system.include" #we have modified this file
and moved it to the local directory

I am not sure, what this modifcation should be for sunfire-6500 case, so I
have directly included the cashew-common.simics (instead of writing three
run-command-file).

Can you kindly help me with this? I am using simics 3.0.31, is it that a
proper version of simics (3.0.27, 3.0.30 etc) is required for -ma to run or
some other error? I will be grateful for the help.
Sparsh





======================================================================

prepare-test-app is this: Running this creates the warmup points.
=====================================================================
#!/bin/bash
USER=`whoami`
ORIGINAL_WD=`pwd`
IS_X86_ARCH=0
IS_V9_ARCH=1
FLEXUS_ROOT="$ORIGINAL_WD/.."

# Extract the Simics path from makefile.defs
SIMICS_BASE=`grep "^SIMICS_PATH" $FLEXUS_ROOT/makefile.defs | sed -e
"s/SIMICS_PATH=//"`
IS_SIMICS_3=`grep USING_SIMICS_3 $FLEXUS_ROOT/makefile.defs | grep -v
SIMICS_INCLUDE | grep "^#"`

USING_SIMICS_3=1
    echo "Launching simulation using Flexus version 3.0.0 (using SIMICS 3
version)"

        $SIMICS_BASE/scripts/start-simics -no-win -x
prepare-test-app-v9sunfirelinux.simics
======================================================================
Here is the file prepare-test-app-v9sunfirelinux.simics
======================================================================
# Redistributions of any form whatsoever must retain and/or include the
# following acknowledgment, notices and disclaimer:
#
# This product includes software developed by Carnegie Mellon University.
#
# Copyright (c) 2005 by Brian Gold, Nikos Hardavellas, Jangwoo Kim,
# Jared Smolens, Stephen Somogyi, Tom Wenisch, Babak Falsafi and
# James C. Hoe for the SimFlex Project, Computer Architecture Lab
# at Carnegie Mellon, Carnegie Mellon University.
#
# For more information, see the SimFlex project website at:
#   http://www.ece.cmu.edu/~simflex
#
# You may not use the name "Carnegie Mellon University" or derivations
# thereof to endorse or promote products derived from this software.
#
# If you modify the software you must place a notice on or within any
# modified version provided or made available to any third party stating
# that you have modified the software.  The notice shall include at least
# your name, address, phone number, email address and the date and purpose
# of the modification.
#
# THE SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER
# EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTY
# THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS OR BE ERROR-FREE AND ANY
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
# TITLE, OR NON-INFRINGEMENT.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
# BE LIABLE FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT,
# SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN
# ANY WAY CONNECTED WITH THIS SOFTWARE (WHETHER OR NOT BASED UPON WARRANTY,
# CONTRACT, TORT OR OTHERWISE).

#-----------------------
#edit @test_app_threads variable to change the number of software threads
#the application should run. This in general should match the number of
processors in the system
@test_app_threads = 1
#...@test_app_threads = 4

@simics_version=SIM_version()

$cpu_class = "ultrasparc-ii"
add-directory "%simics%"
add-directory "checkpoints"

if not defined create_network {$create_network = "yes"}
$disk_size = 8513945600

if `simics_version[7] == '2'` {
   # Simics 2 version

   # set up 1 processor with 256MB
   @boards = {0 : [[0, 1, 256]]}
   # set up 8 processors with 256MB
   #...@boards = {0 : [[0, 4, 256], [1, 4, 0]]}

   @cpu_spaces = 1

   $os = "solaris8"
   add-directory "%simics%/home/sarek"
   run-command-file "sol8-run.simics"

} else {
   # Simics 3 version

   add-directory "%simics%/targets/sunfire"

  run-command-file "cashew-common.simics" # the following lines are the same
as running abisko-common.simics
  }

########################################################################
@global py
@py = SIM_get_object("python")
@global phase
@phase = 0

@from text_console_common import wait_for_string

@def fix_memory_spaces_for_Simics3():
    version = SIM_version()

    if version[7] == '3':
   #Fix for memory spaces in Simics 3.0.X
      cpulist = SIM_get_all_processors()
      for cpu in cpulist:
       cpu_name = SIM_get_attribute(cpu,"name")
       memory_object = SIM_get_attribute(cpu,"physical_memory")
       memory_name = SIM_get_attribute(memory_object,"name")
       new_memory_object = pre_conf_object(cpu_name +
"_mem_indirection",'memory-space')
       new_memory_object.map = [[0x0, memory_object, 0, 0,
0xffffffffffffffff]]
       new_memory_object.default_target = [memory_object, 0, 0,
memory_object]
       SIM_add_configuration([new_memory_object], None)
       SIM_set_attribute(cpu,"physical_memory", new_memory_object)
       io_object = SIM_get_attribute(cpu,"physical_io")
       io_name = SIM_get_attribute(io_object,"name")
       new_io_object = pre_conf_object(cpu_name +
"_io_indirection",'memory-space')
       new_io_object.map = [[0x0, io_object, 0, 0, 0xffffffffffffffff]]
       new_io_object.default_target = [io_object, 0, 0, io_object]
       SIM_add_configuration([new_io_object], None)
       SIM_set_attribute(cpu,"physical_io", new_io_object)

@def do_at_prompt():
    global phase, test_app_threads
    fix_memory_spaces_for_Simics3()
    wait_for_string(conf.con0, "#")
    conf.con0.input = "\n"
    wait_for_string(conf.con0, "#")
    conf.con0.input = "mount /host\n"
    wait_for_string(conf.con0, "#")
    conf.con0.input = "mkdir temp\n"
    wait_for_string(conf.con0, "#")
    conf.con0.input = "cd temp\n"
    wait_for_string(conf.con0, "#")
    conf.con0.input = "cp
/host/home/sparsh/cdrive/flexus-3.0.0/flexus-test-app/src/filter_new.c . \n"
    wait_for_string(conf.con0, "#")
    conf.con0.input = "gcc filter_new.c -o filter\n"
    wait_for_string(conf.con0, "#")
    conf.con0.input = "./filter\n"
    phase = 100
    SIM_break_simulation("")

@def call_back_Warmup(cpu):
    global phase
    phase = 1
    pr("Warmup start call back triggered\n")
    ### change switch cpu time to (1)
    sim_commands.cpu_switch_time_cmd((cli.int_t,1))
    SIM_break_simulation("")

@def call_back_StartParallel(cpu):
    global phase
    phase = 2
    pr("Parallel phase start call back triggered\n")
    SIM_break_simulation("")

@def call_back_EndParallel(cpu):
    global phase
    phase = 3
    pr("Parallel phase end call back triggered\n")
    SIM_break_simulation("")

@def call_back_Iteration(cpu):
    pr("Iteration call back triggered\n")

@def hap_core_simulation_stopped_callback(data, obj, exc, str):
    global phase
    if phase == 0:
        print "Who is calling?"
    elif phase == 1:
        phase = 0
        pr("Warmup start call back executed\n")
        py.execute_string = "write-configuration
checkpoints/flexus-test-warmup"
        SIM_quit(0)
    elif phase == 2:
        phase = 0
        pr("Parallel phase start call back executed\n")
        py.execute_string = "write-configuration
checkpoints/flexus-test-start-parallel"
        SIM_continue(0)
    elif phase == 3:
        phase = 0
        pr("Parallel phase end call back executed\n")
    elif phase == 4:
        phase = 0
        pr("Iteration call back executed\n")
        SIM_continue(0)
    elif phase == 100:
        phase = 0
        pr("Prompt reached\n")
        SIM_continue(0)
    else:
        print "Unknown callback, arg is", arg
        SIM_break_simulation("snore")

@def hap_magic_callback(dummy, cpu, arg):
    if arg == 1:
        call_back_Warmup(cpu)
    elif arg == 2:
        call_back_StartParallel(cpu)
    elif arg == 3:
        call_back_EndParallel(cpu)
    elif arg == 4:
        call_back_Iteration(cpu)
    elif arg == 0x666:
        phase = 0
    elif arg == 0x667:
        phase = 0
    elif arg == 0x668:
        phase = 0
    elif arg == 0x669:
        phase = 0
    elif arg == 0x670:
        phase = 0
    else:
        print "Unknown callback, arg is", arg, ". Ignoring..."

@def Register_Callbacks():
    if simics_version[7] == '2':
        SIM_hap_register_callback("Core_Magic_Instruction",
hap_magic_callback, None)
        SIM_hap_register_callback("Core_Simulation_Stopped",
hap_core_simulation_stopped_callback, None)
    else:
        SIM_hap_add_callback("Core_Magic_Instruction", hap_magic_callback,
None)
        SIM_hap_add_callback("Core_Simulation_Stopped",
hap_core_simulation_stopped_callback, None)


@Register_Callbacks()
@start_branch(do_at_prompt)

run
=============================================================

--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://sos.ece.cmu.edu/pipermail/simflex/attachments/20090617/c76c9425/attachment-0001.html>

Reply via email to