Commit graph

68 commits

Author SHA1 Message Date
Nathan Binkert ee96799519 Initial cleanup pass of lisa's function call tracking
code.

base/statistics.hh:
    We're getting rid of FS_MEASURE, but for now, we're going
    to still use a compile time flag to turn on and off binning
    of statistics.  (The flag is STATS_BINNING)
cpu/exec_context.cc:
cpu/exec_context.hh:
kern/tru64/tru64_system.cc:
    get rid of FS_MEASURE
cpu/simple_cpu/simple_cpu.cc:
    yank the function call tracking code out of the cpu and move
    it into the software context class itself.
kern/tru64/tru64_system.hh:
    get rid of FS_MEASURE
    move all of the tacking stuff to the same place.
sim/system.hh:
    cleanup

--HG--
extra : convert_revision : 73d3843afe1b3ba0d5445421c39c1148d3f4e7c0
2004-02-29 20:22:32 -05:00
Nathan Binkert 31f82cef41 Make the progress event work even after restoring from a checkpoint
--HG--
extra : convert_revision : 80e31eb26250700ebe3ce5848e570068cc76ef47
2004-02-29 18:49:44 -05:00
Nathan Binkert e067bc751b Change order of serialization
sim/sim_object.cc:
    serialize objects in the reverse order of their creation.
    This causes a SimObject that is dependent on another
    to be serialized first.  For example, the ethernet device
    writes back some data to physical memory while serializing,
    so this will cause the physical memory to be serialized
    after that, preserving the data written back.

--HG--
extra : convert_revision : f9a37b63ce777df1cfecefa80f94f8fc69e42448
2004-02-21 10:46:31 -05:00
Nathan Binkert a1259a4fcf Add a simple event wrapper class that takes a class pointer
and member function and will schedule it for the future.

--HG--
extra : convert_revision : f5c5a8df0839e1e10716850c2086862c4a5bc499
2004-02-20 15:24:21 -05:00
Steve Reinhardt d38f995aee Fixes for Linux syscall emulation.
arch/alpha/alpha_linux_process.cc:
    Fixes for Linux emulation:
    - stat struct alignment
    - osf_{get,set}sysinfo return values
    - additional syscall numbers
    - initialize $r0 to 0
sim/syscall_emul.cc:
    brk(0) just returns brk value (don't update it!)

--HG--
extra : convert_revision : 78e22458321c81e81540d101c9e65e2e4b0ad117
2004-02-10 21:43:57 -08:00
Steve Reinhardt 730296f7f9 Results of automatic (yet incomplete) merge.
--HG--
extra : convert_revision : 3ad9a929051bfe111a1e10618c8595acbbade542
2004-02-09 00:30:16 -08:00
David Oehmke 95c248c213 Modify the emulated system calls to support running the SPEC Int
benchmarks for alpha-linux.

arch/alpha/alpha_linux_process.cc:
    Added some more ioctl commands to ignore.
    Set unlink and rename to the new functions.
    Ignore setrlimit, times and rt_sigaction.
    Should eventually provide a function for times.
arch/alpha/alpha_tru64_process.cc:
    Added some more ioctl commands to ignore.
    Set unlink and rename to the new functions.
    Ignore setrlimit.
sim/syscall_emul.cc:
    Added implementations for unlink and rename.
sim/syscall_emul.hh:
    Added unlink and rename functions.
    Added a couple more ioctl requests to ignore.
    Print out the PC of any ioctl commands that fail.

--HG--
extra : convert_revision : 8af21c7fa7d0645d3f9324c9ce70ad33590c3c8e
2004-02-05 12:16:17 -05:00
Steve Reinhardt b6ff600bca Add support for "serializing" instructions that flush
execution pipeline (Alpha trapb & excb).

Add support for write memory barriers (mostly impacts
store buffer).

Add StaticInst flag to indicate memory barriers, though
this is not modeled in the pipeline yet.

arch/alpha/isa_desc:
    Implement trapb, excb, mb, and wmb as insts with
    no execution effect (empty execute() function) but
    with flags that indicate their side effects.

    Also make sure every instruction that needs to go to
    the execute stage has a real opClass value, since we
    are now using No_OpClass to signal insts that can get
    dropped at dispatch.

    StaticInst::branchTarget() is now a const method.
cpu/static_inst.hh:
    Add flags to indicate serializing insts (trapb, excb) and
    memory and write barriers.

    Also declare some StaticInst methods as const methods.
dev/etherlink.hh:
sim/eventq.hh:
sim/serialize.cc:
sim/serialize.hh:
sim/sim_object.hh:
    Make name() return value const.

--HG--
extra : convert_revision : 39520e71469fa20e0a7446b2e06b494eec17a02c
2004-02-04 21:42:00 -08:00
Steve Reinhardt 98948b2e57 More reformatting of reference parameter declarations.
The last change only caught the ones with types that
started with capitals.  This pass catches the rest
(mostly STL and uint*_t types).

base/cprintf_formats.hh:
cpu/simple_cpu/simple_cpu.cc:
sim/serialize.cc:
sim/serialize.hh:
    Change "foo_t& foo" to "foo_t &foo".

--HG--
extra : convert_revision : fc7f7425db2aef33e490f952b5ce74c8c36d0d41
2004-02-04 11:16:30 -08:00
Steve Reinhardt 548b4a1cb0 Change "Foo& foo" declarations to "Foo &foo".
This primarily to be internally consistent (sometimes we used one,
sometimes the other, even within the same line of code!).
I picked the latter to be symmetric with "Foo *foo".

base/cprintf_formats.hh:
base/range.hh:
base/refcnt.hh:
base/res_list.hh:
base/statistics.hh:
base/str.hh:
cpu/exec_context.hh:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
sim/serialize.cc:
sim/serialize.hh:
sim/syscall_emul.hh:
    Change "Foo& foo" declarations to "Foo &foo".

--HG--
extra : convert_revision : ca1b0e85a578b539214bda3b8d61ac23792f2e87
2004-02-02 15:55:35 -08:00
Nathan Binkert 639037d127 remove #include of nonexistent file
sim/universe.cc:
    oops.  this doesn't exist

--HG--
extra : convert_revision : 2cfb3680e4ebe3f27f22a79f853d4d6df445e65a
2004-01-29 10:32:01 -05:00
Nathan Binkert 2db1b6ea1b provide an output stream for simulator output. (This takes place of the
statStream catchall that we had before)
Also provide an optional output directory that multiple simulator output
files can be written to.
Make most output files use the output directory

base/misc.cc:
    send warnings to the outputStream as well
base/trace.cc:
    dprintf_stream defaults to cerr
dev/console.cc:
    use the output directory for the console output if it exists
dev/etherdump.cc:
    dump to the output directory if it exists
sim/builder.cc:
sim/builder.hh:
    move constructor and destructor to .cc file
    use a function to get the stream that the builder dumps its
    output to, and create a separate file in the output directory
    if able
sim/main.cc:
    statStream -> outputStream
sim/serialize.cc:
    dump checkpoints to the output directory if specified
sim/universe.cc:
    provide an output stream for simulator output.  (This takes place of the
    statStream catchall that we had before)
    Also provide an optional output directory that multiple simulator output
    files can be written to.

--HG--
extra : convert_revision : 03abce20edbbf7ec19c9ddd8d69ec8485c383532
2004-01-29 00:38:18 -05:00
Nathan Binkert 801c46d250 a bunch of warning fixes
arch/alpha/isa_desc:
    don't say warn: Warning:
base/misc.cc:
    avoid printing two newlines in a row
sim/main.cc:
    print out a message just before we enter the event queue

--HG--
extra : convert_revision : 2a824d4b67661903fc739a0fb0759aa91d72382c
2004-01-27 17:56:23 -05:00
Nathan Binkert 5d7224cc92 Setup initialization callbacks
--HG--
extra : convert_revision : ec56a839a0489c5494bfcd9ead0fc3866f1e8ac2
2004-01-14 02:00:20 -05:00
Steve Reinhardt 510eef0fa0 Modify handling of serialize:dir parameter to make it more useful.
Move global checkpoint-related functions and vars into Checkpoint class (as statics).

arch/alpha/pseudo_inst.cc:
dev/disk_image.cc:
    Move global checkpoint-related functions and vars
    into Checkpoint class (as statics).
sim/serialize.cc:
    Move global checkpoint-related functions and vars
    into Checkpoint class (as statics).

    Checkpoint constructor now takes checkpoint directory name instead
    of file name.

    Make serialize:dir parameter actually set checkpoint directory name
    instead of directory in which checkpoint directory is created.  If
    the value contains a '%', the curTick value is sprintf'd into the
    format to create the directory name.  The default is backwards compatible
    with the old fixed name ("m5.%012d").
sim/serialize.hh:
    Move global checkpoint-related functions and vars
    into Checkpoint class (as statics).

    Checkpoint constructor now takes checkpoint directory name instead
    of file name.

--HG--
extra : convert_revision : d0aa87b62911f405a4f5811271b9e6351fdd9fe4
2004-01-11 15:24:18 -08:00
Nathan Binkert ef659565ff Clean up time handling code
base/str.hh:
    this should really be inline
base/time.cc:
base/time.hh:
    clean up how the time class works.  Export only one, and let
    people calculate their own elapsed times, etc.
sim/main.cc:
    sim/sim_time.X -> base/time.X

--HG--
rename : sim/sim_time.cc => base/time.cc
rename : sim/sim_time.hh => base/time.hh
extra : convert_revision : f3888fe3a1fdd1022084c282b58407c631a6d9a0
2003-12-15 18:23:48 -05:00
Steve Reinhardt 7c708c8d1b - Switch events to use a priority enum instead of integers.
This lets us centralize priorities so we can see what's going on.
- Shift serialize & cpu-switch events to happen before CPU ticks (to be
consistent with starting new CPU on same cycle instead of next cycle).
- Get rid of unnecessary bus stats reset callback.

cpu/simple_cpu/simple_cpu.cc:
sim/debug.cc:
sim/eventq.hh:
sim/serialize.cc:
sim/sim_events.cc:
sim/sim_events.hh:
    Switch events to use a priority enum instead of integers.
    This lets us centralize priorities so we can see what's going on.

--HG--
extra : convert_revision : 510d79b43c0a1c97a10eb65916f7335b1de8b956
2003-12-11 08:29:52 -08:00
Steve Reinhardt 777c1ebfab Stats & serialization tweaks & cleanup. Unserializing from
a checkpoint now gives identical results to running from scratch
and doing at switchover at the same cycle!
- CPUs start at cycle 0 again, not cycle 1.
- curTick is now serialized & unserialized.
- Stats get reset in main (before event loop).  Since this is done
after curTick is unserialized, simTicks gets set correctly for
running from a checkpoint.
- Simplify serialization to happen in a single pass.
- s/Serializeable/Serializable/

arch/alpha/isa_traits.hh:
dev/etherlink.hh:
sim/eventq.cc:
sim/eventq.hh:
    s/Serializeable/Serializable/
kern/tru64/tru64_system.cc:
sim/process.cc:
    Make initial CPU activation on cycle 0 again (not 1).
sim/main.cc:
    Reset stats before getting started.
    Make error message on falling out of event loop
    more meaningful.
sim/serialize.cc:
sim/serialize.hh:
    Get rid of now-useless initial pass; serialization is
    done in a single pass now.
    Serialize & unserialize curTick.
    Wrap curTick and mainEventQueue in a "globals" Serializable object.
    s/Serializeable/Serializable/
sim/sim_object.cc:
    Add static function to serialize all SimObjects.
sim/sim_object.hh:
    Add static function to serialize all SimObjects.
    s/Serializeable/Serializable/

--HG--
extra : convert_revision : 9dcc411d0009b54b8eb61c3a509680b81b9f6f68
2003-12-11 00:16:46 -08:00
Steve Reinhardt 7e6dcd812c Rename RegResetCallback to registerResetCallback().
Add reset callback for bus (to fix idle cycles computation).

base/statistics.cc:
base/statistics.hh:
sim/sim_object.cc:
    Rename RegResetCallback to registerResetCallback().

--HG--
extra : convert_revision : c886c98143d4851f709ef95de3120b4494f8e4d2
2003-12-10 17:49:41 -08:00
Steve Reinhardt 4ce6118fda Factor ExecContext::setStatus(), BaseCPU::execCtxStatusChange(),
and SimpleCPU::setStatus() into separate functions.  For example,
setStatus(Active) is now activate().

--HG--
extra : convert_revision : 4392e07caf6c918db0b535f613175109681686fe
2003-12-10 17:47:28 -08:00
Steve Reinhardt db6038937d Minor fixes. Somehow do-tests.pl suddenly started failing
on test5 because of a wrong exit code; fixed that.

sim/main.cc:
    No need to ignore SIGPIPE, as far as I know.
sim/sim_events.cc:
    A CountedExitEvent is a normal termination, so
    should have an exit code of 0.

--HG--
extra : convert_revision : 8b5072aca54f3ca08b2815b73ac01c00e4da49b6
2003-12-09 20:25:52 -08:00
Steve Reinhardt 37a718e45e Various cleanup. Mostly forcing initialization of some fields...
I noticed that checkpoints dumped from m5.debug and m5.opt had
differences, which is no longer the case (other than addresses
encoded in names).

cpu/full_cpu/smt.hh:
    Get rid of unused SMT_MAX_CPUS.
sim/debug.cc:
    Use AutoDelete for DebugBreakEvent.
sim/serialize.cc:
sim/serialize.hh:
    Move constructor & destructor to header so they can be inlined.

--HG--
extra : convert_revision : bc68c2c9b053b1de0d655ed555734419fafd0b83
2003-12-06 09:57:59 -08:00
Steve Reinhardt 9984b2bd6c Formatting & doxygen docs for new syscall emulation code.
arch/alpha/alpha_linux_process.cc:
arch/alpha/alpha_linux_process.hh:
arch/alpha/alpha_tru64_process.cc:
arch/alpha/alpha_tru64_process.hh:
sim/syscall_emul.cc:
sim/syscall_emul.hh:
    Formatting & doxygen.

--HG--
extra : convert_revision : 4f07dd37e254120800dd0d5c0eb47acc9c00cb3f
2003-12-01 22:39:27 -08:00
Steve Reinhardt 745f0044cd Merge zizzer:/bk/m5 into isabel.reinhardt.house:/z/stever/bk/m5
--HG--
extra : convert_revision : d66ebc598fdcfc9477ea5a1e455b21d7b9e56936
2003-12-01 19:34:51 -08:00
Steve Reinhardt 7976794aad Restructuring of LiveProcess etc. to support multiple emulated OS syscall
interfaces, and specific support for Alpha Linux.  Split syscall emulation
functions into several groups, based on whether they depend on the specific
OS and/or architecture (and all combinations of above), including the use of
template functions to support syscalls with slightly different constants
or interface structs.

arch/alpha/alpha_tru64_process.cc:
    Incorporate full Tru64 object definition here, including structure and constant definitions.
    This way we can wrap all of the functions inside the object, and not worry about namespace
    conflicts because no one outside this file will ever see it.
base/loader/aout_object.cc:
base/loader/aout_object.hh:
base/loader/ecoff_object.cc:
base/loader/ecoff_object.hh:
base/loader/elf_object.cc:
base/loader/elf_object.hh:
base/loader/object_file.cc:
base/loader/object_file.hh:
    Add enums to ObjectFile to indicate the object's architecture and operating system.
cpu/exec_context.cc:
    prog.hh is now process.hh
cpu/exec_context.hh:
    prog.hh is now process.hh
    move architecture-specific syscall arg accessors into ExecContext
cpu/simple_cpu/simple_cpu.cc:
    No need to include prog.hh (which has been renamed)
sim/process.cc:
sim/process.hh:
    LiveProcess is now effectively an abstract base class.
    New LiveProcess::create() function takes an object file and dynamically picks the
    appropriate subclass of LiveProcess to handle the syscall interface that file expects
    (currently Tru64 or Linux).

--HG--
rename : arch/alpha/fake_syscall.cc => arch/alpha/alpha_tru64_process.cc
rename : sim/prog.cc => sim/process.cc
rename : sim/prog.hh => sim/process.hh
extra : convert_revision : 4a03ca7d94a34177cb672931f8aae83a6bad179a
2003-12-01 19:34:38 -08:00
Nathan Binkert d1e12b57ce We only need to choose that we do want binning, or we don't.
no need for multiple bin classes.  If multiple bins are needed, we
can always do it with ini type config instead.

kern/tru64/tru64_events.hh:
sim/system.cc:
sim/system.hh:
    No more GenBin always use MainBin

--HG--
extra : convert_revision : 8c466f302324c33b59d47d0da04583b2517fc72c
2003-11-22 15:07:53 -05:00
Nathan Binkert 123d0294b5 Make it so that we create a directory for each checkpoint so that
there aren't so many files littering your directory

dev/disk_image.cc:
    Checkpoints now in a directory
sim/serialize.hh:
    Make it so that we create a directory for each checkpoint so that
    there aren't so many files littering your directory.
    Remove unused variable

--HG--
extra : convert_revision : 261824eee62f7b68f6ae6e3dbd49ad5128ced148
2003-11-14 01:19:16 -05:00
Nathan Binkert 655e9ef3de Little fixes to make more of the stats reset correctly.
base/statistics.cc:
    formatting
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
    Make numInsts reset by adding a resetStats function
sim/sim_object.cc:
    Register the reset callback in a slightly cleaner way to avoid
    potential static member constructor ordering issues

--HG--
extra : convert_revision : 408073b4b0397fbf9dfd9c548a313f1c8c3fc031
2003-11-06 00:41:14 -05:00
Nathan Binkert f2881c752e Ok, actually call resetStats on all stats
minor gratuitous cleanup in printAllExtraOutput.
(only create one end iterator)

Fix average stats reset

base/statistics.hh:
    Shouldn't reset average stats this way.  The current stat value
    should stay the same.
sim/sim_object.cc:
    Ok, actually call resetStats on all stats
    minor gratuitous cleanup in printAllExtraOutput.
    (only create one end iterator)

--HG--
extra : convert_revision : 13090ebe490a93757b8eb7d7c6a9697983095e41
2003-11-05 21:17:13 -05:00
Nathan Binkert b064b8a6fd Add a virtual function resetStats() that any SimObject can inherit
from that will get called any time stats are reset.

sim/sim_object.cc:
sim/sim_object.hh:
    add a virtual function resetStats that any simObject can reset
    when a statistics reset is initiated

--HG--
extra : convert_revision : fdad673142f6ff811f84c246d80e5d41e3c9d4d1
2003-11-05 18:21:18 -05:00
Nathan Binkert 9471a4d20f Fix stats reset
make SIGUSR2 dump and reset stats
Make resetting time work

base/statistics.cc:
    Fix statistics reset so that it works again, and correctly
    reset bins as well.  (The old code wouldn't reset if you didn't
    have any bins, and then would actually only reset the first
    bin)
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
    convert idleCycles/idleFraction into a single Average stat
    to make reset work more simply
sim/main.cc:
    handle SIGUSR2 to dump and reset stats
    (SIGUSR1 only dumps them)
sim/sim_time.cc:
sim/sim_time.hh:
    Add support for resetting the time

--HG--
extra : convert_revision : ea43e03c50c0a4bb826dc0842a8c4fa1a9289e0a
2003-11-05 17:57:41 -05:00
Lisa Hsu 921b1ee87b Add the ability to track stats in user defined sets of function calls. code can be generated via the base/instrum_codegen.pl script to easily change the functions being tracked. the only thing the user needs to do is add code in tru64System to change how the callerMap is populated.
command line:

m5.* <config file> <args> --server.system:bin=true to track function calls in the server
m5.* <config file> <args> --client.system:bin=true to track function calls in the client

base/statistics.cc:
    make an adjustment to the way stats are printed for FS_MEASURE
base/statistics.hh:
    add a name() virtual function to GenBin.  add a debug printf for activate().
    add amake MainBin the default bin when FS_MEASURE.
cpu/exec_context.cc:
    initialize swCtx to null upon creation of an xc
cpu/exec_context.hh:
    add a SWContext pointer to every execution context.
cpu/simple_cpu/simple_cpu.cc:
    process calls and returns for FS_MEASURE
cpu/simple_cpu/simple_cpu.hh:
    add this so idleCycles will not be accessed before all stats are constructed
kern/tru64/tru64_events.cc:
    add a FnEvent that fires whenever a function we're tracking is called.  implement the process() virtual function for it.
kern/tru64/tru64_events.hh:
    add FnEvent
kern/tru64/tru64_system.cc:
    send bin parameter to System constructor.  add bin parameter to Tru64System object.  initialize all the FnEvent and MainBin members of Tru64system.  also, populate the calling map that indicates whether a function call is on the path we're tracking.
kern/tru64/tru64_system.hh:
    modify the Tru64System class to support FS_MEASURE
sim/system.cc:
    add a bin parameter to System class.  initialize a MainBin to hold the stats for nonPath.
sim/system.hh:
    add a map of to match bins to function names.  add a swCtx map to map pcb addresses to SWContext *s.  Add some supporting functions.

--HG--
extra : convert_revision : af3eadd798cb2d2aed9b54e1059dcedf244dd526
2003-11-04 15:15:12 -05:00
Steve Reinhardt 2ac054386d Print a warning rather than failing if we're unserializing and there's an
object in the config that was not in the checkpointed config.
This code compiles, but I haven't tested it... I'm committing it so Ron
can have it.  Should not effect anything that currently works.

base/inifile.cc:
base/inifile.hh:
    Add sectionExists() method so you can query whether a section exists
    without knowing any of the entry names that would be in it.
sim/serialize.cc:
sim/serialize.hh:
    Add Checkpoint::sectionExists() (pass through to IniFile).

--HG--
extra : convert_revision : 905db122afdfe55946ab8493ccac0b1e715bc7c6
2003-11-02 21:49:15 -08:00
Nathan Binkert d76445f9f3 Move the m5 pseudo instructions into their own file
arch/alpha/isa_desc:
    Move the pseudo instructions out of the isa_desc, into their own
    file and call out to them when they're to be accessed
sim/sim_events.cc:
sim/sim_events.hh:
sim/sim_exit.hh:
    move SimExit to sim_exit.cc

--HG--
extra : convert_revision : 1c393adb1c18bd0fef065057d7f4e9cf60ac4197
2003-11-02 20:43:39 -05:00
Nathan Binkert 667cbb6690 Implement more m5 pseduo opcodes:
resetstats
dumpstats
dumpresetstats
m5checkpoint

Lots of cleanup of serialization and stats dumping/resetting to
work with these new instructions

arch/alpha/isa_desc:
    Implement more m5 pseduo opcodes:
    resetstats
    dumpstats
    dumpresetstats
    m5checkpoint

    All of these functions take two optional parameters, the first is a delay,
    and the second is a period.  The delay tells the simulator to wait the
    specified number of nanoseconds before triggering the event, the period
    tells the simulator to repeat the event with a specified frequency
base/statistics.cc:
base/statistics.hh:
    regReset RegResetCallback
dev/disk_image.cc:
    serializeFilename -> CheckpointFile()
sim/debug.cc:
    Move this debugging statement to sim_stats.cc
sim/eventq.cc:
    Don't AutoDelete an event if it is scheduled since the process()
    function could potentially schedule the event again.
sim/main.cc:
    DumpStatsEvent is now Statistics::SetupEvent(Dump, curTick)
sim/serialize.cc:
    Change the serialize event so that it's possible to cause the
    event to repeat.  Also make the priority such that the event
    happens just before the simulator would exit if both events
    were scheduled for the same cycle.

    get rid of the serializeFilename variable and provide a CheckpointFile()
    function.  This function takes a basename that is set in the
    configuration, and appends the current cycle to the name so that
    multiple checkpoints can be dumped from the same simulation.

    Also, don't exit the simulation when a checkpoint file is dumped.
sim/serialize.hh:
    serializeFilename -> CheckpointFile()
    SetupCheckpoint function to tell the simulator to prepare
    to checkpoint at a certain time with a certain period
sim/sim_events.cc:
    DumpStatsEvent stuff gets move to sim_stats.(cc|hh)
    The context stuff gets moved into the already existing
    stats context in stat_context.cc
sim/sim_events.hh:
    DumpStatsEvent stuff gets move to sim_stats.(cc|hh)
sim/universe.cc:
    Provide some simple functions for converting times into
    ticks.  These use floating point math to get as close as
    possible to the real values.  Multipliers are set up ahead
    of time

--HG--
extra : convert_revision : d06ef26a9237529a1e5060cb1ac2dcc04d4ec252
2003-11-02 18:02:58 -05:00
Nathan Binkert c7d6745b07 deprecate the m5exit instruction and rename it to m5exit_old
Implement a new m5exit instruction with an optional delay

arch/alpha/isa_desc:
    move m5exit to m5exit old.  The old version of the
    instruction is now deprecated

    Implement the new exit instruction with the optional delay
sim/sim_events.cc:
sim/sim_events.hh:
    Make SimExit take a cycle
sim/universe.cc:
    provide ticksPerMS, ticksPerUS, and ticksPerNS so we don't
    have to do math during the cycle

--HG--
extra : convert_revision : e2ed47a2e5cfcd57c82086c6fcb4a28bf801c214
2003-11-02 02:07:31 -05:00
Andrew Schultz 59eeb1bb52 eventq.cc, eventq.hh:
Cleaned up serialization

sim/eventq.hh:
sim/eventq.cc:
    Cleaned up serialization

--HG--
extra : convert_revision : b75696d75f1aee16ebca2076fdd3cd4913593762
2003-10-31 22:09:18 -05:00
Andrew Schultz 2ab51fbcdb Changed the naming of Serializeable derived objects. Serializeable no longer has
objName as a member, instead it has the pure virtual function name().  SimObject
now has a objName member, and all classes derived directly from Serializeable
have to implement a name() function (which now makes them unique by pointer value)

cpu/simple_cpu/simple_cpu.cc:
    Change initialization of Event to get rid of Serializeable naming
dev/etherlink.cc:
dev/etherlink.hh:
    Seralizeable derived naming changes
sim/eventq.cc:
    Serializeable derived naming changes, also changed serialization process so it
    doesn't need to use nameChildren
sim/eventq.hh:
    Serializeable derived naming changes, remove constructor for specifying event name
sim/serialize.cc:
    Serializeable derived naming changes, remove setName function and the child naming
    pass for serialization
sim/serialize.hh:
    Serializeable derived naming changes, removed nameChildren, setName
sim/sim_object.cc:
sim/sim_object.hh:
    Serializeable derived naming changes

--HG--
extra : convert_revision : 67bcc275b6c210f7049f98a1ad0d22e8f5596a63
2003-10-31 17:32:04 -05:00
Steve Reinhardt 2f8d858e13 Get rid of lots of obsolete mentions of stat_sdb_t.
base/predictor.hh:
base/sat_counter.hh:
sim/param.hh:
    Get rid of spurious references to stat_sdb_t.

--HG--
extra : convert_revision : 0018a940c69b6e31b85fd85354b9d5ce2fd0aa6f
2003-10-29 22:22:03 -08:00
Steve Reinhardt 5a1eb9049d Support for Serializable non-SimObject things like events.
Can now serialize & unserialize DmaRequestEvents and DmaTransferEvents.
Also support serialize/unserialize of pointers to SimObjects and
other Serializable objects.

arch/alpha/alpha_memory.cc:
arch/alpha/alpha_memory.hh:
arch/alpha/isa_traits.hh:
cpu/exec_context.cc:
cpu/exec_context.hh:
cpu/simple_cpu/simple_cpu.hh:
dev/alpha_access.h:
dev/alpha_console.cc:
dev/alpha_console.hh:
dev/console.cc:
dev/console.hh:
    unserialize() now takes a Checkpoint* instead of an IniFile*.
cpu/simple_cpu/simple_cpu.cc:
    unserialize() now takes a Checkpoint* instead of an IniFile*.
    Put ExecContext in its own section so its _status fields doesn't conflict.
sim/eventq.cc:
sim/eventq.hh:
    unserialize() now takes a Checkpoint* instead of an IniFile*.
    Events get serialized by the event queue only if they're marked
    as AutoSerialize... others are assumed to be serialized by something
    else (e.g. an owning SimObject) or to not matter.
sim/param.cc:
    Shift 'const' in case T is a ptr type.
sim/serialize.cc:
sim/serialize.hh:
    Define Checkpoint object to encapsulate everything you need to know
    about a checkpoint.  Use it to allow lookups of named Serializable
    objects (and SimObjects) during unserialization.
    unserialize() now takes a Checkpoint* instead of an IniFile*.

--HG--
extra : convert_revision : 8e6baab32405f8f548bb67a097b2f713296537a5
2003-10-29 21:45:39 -08:00
Steve Reinhardt af5277a678 Serialization support for Alpha TLBs, PhysicalMemory, and SimpleCPU.
arch/alpha/alpha_memory.cc:
arch/alpha/alpha_memory.hh:
    Serialize TLB contents.
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
    Complete serialization of SimpleCPU (including owned events).
sim/eventq.cc:
sim/eventq.hh:
    Basic serialization for events.
    Still need to handle dynamic events (not owned by a SimObject).
sim/serialize.cc:
sim/serialize.hh:
    Export serialization filename so PhysicalMemory can
    derive its filename from that.

--HG--
extra : convert_revision : 4db851c5880f73f576ca092d5e5ad4256048eb51
2003-10-29 13:35:07 -08:00
Steve Reinhardt 8da9fcdd75 Flesh out ExecContext serialize/unserialize (including RegFile).
Add support for serializing enums.

arch/alpha/isa_traits.hh:
    Add serialize/unserialize functions for RegFile
    (defined in new isa_traits.cc).
cpu/exec_context.cc:
    Flesh out serialize/unserialize.
sim/serialize.hh:
    Add {UN}SERIALIZE_ENUM().

--HG--
extra : convert_revision : 9e30c7e7b3b290dc8ea0888ba3636fc93ee89052
2003-10-29 08:50:25 -08:00
Steve Reinhardt aa12cac9fd Rename SERIALIZE_MEMBER to SERIALIZE_SCALAR.
--HG--
extra : convert_revision : 848cfcf3323d224cdb2ff14df6f6996607a5c27f
2003-10-29 00:46:26 -08:00
Steve Reinhardt 1511370d09 More progress on checkpointing... we can now write out a checkpoint and read it back in,
though most objects don't actually serialize any data.

arch/alpha/alpha_memory.cc:
arch/alpha/alpha_memory.hh:
arch/alpha/isa_traits.hh:
cpu/exec_context.cc:
cpu/exec_context.hh:
cpu/simple_cpu/simple_cpu.hh:
dev/alpha_access.h:
dev/alpha_console.cc:
dev/alpha_console.hh:
dev/console.cc:
dev/console.hh:
    Change unserialize param from IniFile& to const IniFile*.
cpu/simple_cpu/simple_cpu.cc:
    Change unserialize param from IniFile& to const IniFile*.
    Make unserialize call ExecContext::unserialize.
sim/eventq.cc:
    Rename MainEventQueue (no spaces) for easier parsing in checkpoints.
    Disable event serialization for now, so we can focus on the easy stuff.
sim/serialize.cc:
    Change paramIn and arrayParamIn param from IniFile& to const IniFile*.
sim/serialize.hh:
    Change unserialize, paramIn, and arrayParamIn params from IniFile& to const IniFile*.

--HG--
extra : convert_revision : 6e8853ed375eddec0e140c95a01dd51bd225f7b9
2003-10-29 00:41:24 -08:00
Steve Reinhardt a0f3ee7e17 Add a few configuration DPRINTFs.
Fix handling of chars (uint8_ts) in serialization.
Minor cleanup.

sim/param.cc:
    Add specialization of showParam for char: output as ints, not as characters.
    Clean up comments a bit.

--HG--
extra : convert_revision : 96349382447d892679dda9f83c028eec64252dc0
2003-10-28 23:24:40 -08:00
Steve Reinhardt 3761bcf076 Get new serialization code to link.
sim/param.cc:
    Convert parseParam() and showParam() to templates,
    andd explicitly instantiate them for common types.
sim/param.hh:
    Add declarations for parseParam() and showParam() function templates,
    so serialize.cc can use them.
sim/serialize.cc:
    Don't need declarations for parseParam() and showParam() since
    we put them in param.hh.
    Also instantiate paramOut() etc. for bool.

--HG--
extra : convert_revision : 1d84d0fbec64481996cbfa8b84c67c13c6244385
2003-10-28 17:48:10 -08:00
Steve Reinhardt b90f810575 Revamp serialization to make it easier.
--HG--
extra : convert_revision : c57a538d7cf606dbdf5fa244f92da46bd830e335
2003-10-28 12:55:12 -08:00
Nathan Binkert cec7f73abf emulate callpal halt for non FULL_SYSTEM
in the process make m5_exit more generic

arch/alpha/ev5.cc:
arch/alpha/ev5.hh:
    There's no reason that this needs to be in an arch specific file
arch/alpha/isa_desc:
    m5_exit -> SimExit
    Emulate callpal halt and cause the simulator to exit
    while we're at it, sort #includes
sim/sim_events.cc:
sim/sim_events.hh:
    move the m5_exit function here, renaming it to SimExit.
    Also Allow the caller to pass in the termination message.

--HG--
extra : convert_revision : 54b43b17a412ab387b8672c27ef0b04fce10ee15
2003-10-28 10:05:58 -05:00
Steve Reinhardt 167928f12b Minor serialization tweaks.
cpu/simple_cpu/simple_cpu.cc:
    Serialize FP regs as integers (so we get exact bit representation).
sim/serialize.cc:
    Don't panic on object rename... events come up named "event"
    and need to get renamed.  Also fix some DPRINTFs.

--HG--
extra : convert_revision : 62ad527a7aaf78ae623b70febc1331cf91cbad05
2003-10-26 22:38:53 -08:00
Steve Reinhardt 91cb532f9f Make FullCPU schedule its TickEvent when one of its contexts becomes active.
This fixes detailed-mpboot, which was broken as of my last change.
Also clean up some of the ExecContext status initialization.

cpu/base_cpu.hh:
    CPU::execCtxStatusChg() now takes thread_num as an arg so the CPU knows
    which execContext had the status change.
    BaseCPU::registerExecContexts() no longer needs to be virtual.
cpu/exec_context.cc:
    Initialize _status directly... don't use setStatus() as this will notify the CPU
    of the change before it is ready.
    CPU::execCtxStatusChg() now takes thread_num as an arg so the CPU knows
    which execContext had the status change.
cpu/exec_context.hh:
    Don't need initStatus() any more.
cpu/simple_cpu/simple_cpu.cc:
    Move execCtxStatusChg() from header to .cc file.
    No longer need specialized version of registerExecContexts to schedule TickEvent.
cpu/simple_cpu/simple_cpu.hh:
    Move execCtxStatusChg() from header to .cc file.
    CPU::execCtxStatusChg() now takes thread_num as arg (must be 0 for SimpleCPU).
    No longer need specialized version of registerExecContexts to schedule TickEvent.
kern/tru64/tru64_system.cc:
    Don't need initRegs; the PC etc. get initialized in the CPU constructor.
    ExecContexts start out as Unallocated, so no need to set them to Unallocated here.
kern/tru64/tru64_system.hh:
    Don't need initRegs; the PC etc. get initialized in the CPU constructor.
sim/prog.cc:
    ExecContexts start out as Unallocated, so no need to set them to Unallocated here.

--HG--
extra : convert_revision : e960ebbeb845960344633798e251b6c8bf1c0378
2003-10-24 23:02:36 -07:00