system.cc revision 8666
12689Sktlim@umich.edu/*
28666SPrakash.Ramrakhyani@arm.com * Copyright (c) 2011 ARM Limited
38666SPrakash.Ramrakhyani@arm.com * All rights reserved
48666SPrakash.Ramrakhyani@arm.com *
58666SPrakash.Ramrakhyani@arm.com * The license below extends only to copyright in the software and shall
68666SPrakash.Ramrakhyani@arm.com * not be construed as granting a license to any other intellectual
78666SPrakash.Ramrakhyani@arm.com * property including but not limited to intellectual property relating
88666SPrakash.Ramrakhyani@arm.com * to a hardware implementation of the functionality of the software
98666SPrakash.Ramrakhyani@arm.com * licensed hereunder.  You may use the software subject to the license
108666SPrakash.Ramrakhyani@arm.com * terms below provided that you ensure that this notice is replicated
118666SPrakash.Ramrakhyani@arm.com * unmodified and in its entirety in all distributions of the software,
128666SPrakash.Ramrakhyani@arm.com * modified or unmodified, in source code or in binary form.
138666SPrakash.Ramrakhyani@arm.com *
142689Sktlim@umich.edu * Copyright (c) 2003-2006 The Regents of The University of Michigan
157897Shestness@cs.utexas.edu * Copyright (c) 2011 Regents of the University of California
162689Sktlim@umich.edu * All rights reserved.
172689Sktlim@umich.edu *
182689Sktlim@umich.edu * Redistribution and use in source and binary forms, with or without
192689Sktlim@umich.edu * modification, are permitted provided that the following conditions are
202689Sktlim@umich.edu * met: redistributions of source code must retain the above copyright
212689Sktlim@umich.edu * notice, this list of conditions and the following disclaimer;
222689Sktlim@umich.edu * redistributions in binary form must reproduce the above copyright
232689Sktlim@umich.edu * notice, this list of conditions and the following disclaimer in the
242689Sktlim@umich.edu * documentation and/or other materials provided with the distribution;
252689Sktlim@umich.edu * neither the name of the copyright holders nor the names of its
262689Sktlim@umich.edu * contributors may be used to endorse or promote products derived from
272689Sktlim@umich.edu * this software without specific prior written permission.
282689Sktlim@umich.edu *
292689Sktlim@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
302689Sktlim@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
312689Sktlim@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
322689Sktlim@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
332689Sktlim@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
342689Sktlim@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
352689Sktlim@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
362689Sktlim@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
372689Sktlim@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
382689Sktlim@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
392689Sktlim@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
402689Sktlim@umich.edu *
412689Sktlim@umich.edu * Authors: Steve Reinhardt
422689Sktlim@umich.edu *          Lisa Hsu
432689Sktlim@umich.edu *          Nathan Binkert
442689Sktlim@umich.edu *          Ali Saidi
457897Shestness@cs.utexas.edu *          Rick Strong
462689Sktlim@umich.edu */
472689Sktlim@umich.edu
482521SN/A#include "arch/isa_traits.hh"
493960Sgblack@eecs.umich.edu#include "arch/remote_gdb.hh"
504194Ssaidi@eecs.umich.edu#include "arch/utility.hh"
511070SN/A#include "base/loader/object_file.hh"
521070SN/A#include "base/loader/symtab.hh"
532521SN/A#include "base/trace.hh"
546658Snate@binkert.org#include "config/full_system.hh"
556658Snate@binkert.org#include "config/the_isa.hh"
568229Snate@binkert.org#include "cpu/thread_context.hh"
578232Snate@binkert.org#include "debug/Loader.hh"
588666SPrakash.Ramrakhyani@arm.com#include "debug/WorkItems.hh"
592521SN/A#include "mem/mem_object.hh"
602522SN/A#include "mem/physical.hh"
612037SN/A#include "sim/byteswap.hh"
628229Snate@binkert.org#include "sim/debug.hh"
6356SN/A#include "sim/system.hh"
646658Snate@binkert.org
652378SN/A#if FULL_SYSTEM
662521SN/A#include "arch/vtophys.hh"
672378SN/A#include "kern/kernel_stats.hh"
687723SAli.Saidi@ARM.com#include "mem/vport.hh"
694762Snate@binkert.org#else
704762Snate@binkert.org#include "params/System.hh"
712378SN/A#endif
722SN/A
732SN/Ausing namespace std;
742107SN/Ausing namespace TheISA;
752SN/A
762SN/Avector<System *> System::systemList;
772SN/A
782SN/Aint System::numSystemsRunning = 0;
792SN/A
801070SN/ASystem::System(Params *p)
815714Shsul@eecs.umich.edu    : SimObject(p), physmem(p->physmem), _numContexts(0),
822378SN/A#if FULL_SYSTEM
832521SN/A      init_param(p->init_param),
847580SAli.Saidi@arm.com      loadAddrMask(p->load_addr_mask),
852378SN/A#else
867770SAli.Saidi@ARM.com      pagePtr(0),
877770SAli.Saidi@ARM.com      nextPID(0),
882378SN/A#endif
897914SBrad.Beckmann@amd.com      memoryMode(p->mem_mode),
907914SBrad.Beckmann@amd.com      workItemsBegin(0),
917914SBrad.Beckmann@amd.com      workItemsEnd(0),
928666SPrakash.Ramrakhyani@arm.com      numWorkIds(p->num_work_ids),
937914SBrad.Beckmann@amd.com      _params(p),
948666SPrakash.Ramrakhyani@arm.com      totalNumInsts(0),
957897Shestness@cs.utexas.edu      instEventQueue("system instruction-based event queue")
962SN/A{
971070SN/A    // add self to global system list
981070SN/A    systemList.push_back(this);
991070SN/A
1008460SAli.Saidi@ARM.com    /** Keep track of all memories we can execute code out of
1018460SAli.Saidi@ARM.com     * in our system
1028460SAli.Saidi@ARM.com     */
1038460SAli.Saidi@ARM.com    for (int x = 0; x < p->memories.size(); x++) {
1048460SAli.Saidi@ARM.com        if (!p->memories[x])
1058460SAli.Saidi@ARM.com            continue;
1068460SAli.Saidi@ARM.com        memRanges.push_back(RangeSize(p->memories[x]->start(),
1078460SAli.Saidi@ARM.com                                      p->memories[x]->size()));
1088460SAli.Saidi@ARM.com    }
1098460SAli.Saidi@ARM.com
1102378SN/A#if FULL_SYSTEM
1111070SN/A    kernelSymtab = new SymbolTable;
1124838Ssaidi@eecs.umich.edu    if (!debugSymbolTable)
1134838Ssaidi@eecs.umich.edu        debugSymbolTable = new SymbolTable;
1141070SN/A
1152520SN/A
1162520SN/A    /**
1172520SN/A     * Get a functional port to memory
1182520SN/A     */
1192520SN/A    Port *mem_port;
1207723SAli.Saidi@ARM.com    functionalPort = new FunctionalPort(name() + "-fport");
1212520SN/A    mem_port = physmem->getPort("functional");
1227723SAli.Saidi@ARM.com    functionalPort->setPeer(mem_port);
1237723SAli.Saidi@ARM.com    mem_port->setPeer(functionalPort);
1242520SN/A
1257723SAli.Saidi@ARM.com    virtPort = new VirtualPort(name() + "-fport");
1262521SN/A    mem_port = physmem->getPort("functional");
1277723SAli.Saidi@ARM.com    virtPort->setPeer(mem_port);
1287723SAli.Saidi@ARM.com    mem_port->setPeer(virtPort);
1292521SN/A
1302520SN/A
1311070SN/A    /**
1322158SN/A     * Load the kernel code into memory
1331070SN/A     */
1344762Snate@binkert.org    if (params()->kernel == "") {
1355823Ssaidi@eecs.umich.edu        inform("No kernel set for full system simulation. Assuming you know what"
1363812Ssaidi@eecs.umich.edu                " you're doing...\n");
1373812Ssaidi@eecs.umich.edu    } else {
1383812Ssaidi@eecs.umich.edu        // Load kernel code
1394762Snate@binkert.org        kernel = createObjectFile(params()->kernel);
1405823Ssaidi@eecs.umich.edu        inform("kernel located at: %s", params()->kernel);
1415222Sksewell@umich.edu
1423812Ssaidi@eecs.umich.edu        if (kernel == NULL)
1434762Snate@binkert.org            fatal("Could not load kernel file %s", params()->kernel);
1441070SN/A
1453812Ssaidi@eecs.umich.edu        // Load program sections into memory
1467723SAli.Saidi@ARM.com        kernel->loadSections(functionalPort, loadAddrMask);
1471070SN/A
1483812Ssaidi@eecs.umich.edu        // setup entry points
1493812Ssaidi@eecs.umich.edu        kernelStart = kernel->textBase();
1503812Ssaidi@eecs.umich.edu        kernelEnd = kernel->bssBase() + kernel->bssSize();
1513812Ssaidi@eecs.umich.edu        kernelEntry = kernel->entryPoint();
1521070SN/A
1533812Ssaidi@eecs.umich.edu        // load symbols
1543812Ssaidi@eecs.umich.edu        if (!kernel->loadGlobalSymbols(kernelSymtab))
1555823Ssaidi@eecs.umich.edu            fatal("could not load kernel symbols\n");
1561070SN/A
1573812Ssaidi@eecs.umich.edu        if (!kernel->loadLocalSymbols(kernelSymtab))
1585823Ssaidi@eecs.umich.edu            fatal("could not load kernel local symbols\n");
1591070SN/A
1603812Ssaidi@eecs.umich.edu        if (!kernel->loadGlobalSymbols(debugSymbolTable))
1615823Ssaidi@eecs.umich.edu            fatal("could not load kernel symbols\n");
1621074SN/A
1633812Ssaidi@eecs.umich.edu        if (!kernel->loadLocalSymbols(debugSymbolTable))
1645823Ssaidi@eecs.umich.edu            fatal("could not load kernel local symbols\n");
1651074SN/A
1663812Ssaidi@eecs.umich.edu        DPRINTF(Loader, "Kernel start = %#x\n", kernelStart);
1673812Ssaidi@eecs.umich.edu        DPRINTF(Loader, "Kernel end   = %#x\n", kernelEnd);
1683812Ssaidi@eecs.umich.edu        DPRINTF(Loader, "Kernel entry = %#x\n", kernelEntry);
1693812Ssaidi@eecs.umich.edu        DPRINTF(Loader, "Kernel loaded...\n");
1703812Ssaidi@eecs.umich.edu    }
1712378SN/A#endif // FULL_SYSTEM
1722378SN/A
1731070SN/A    // increment the number of running systms
174878SN/A    numSystemsRunning++;
1757914SBrad.Beckmann@amd.com
1767914SBrad.Beckmann@amd.com    activeCpus.clear();
1772SN/A}
1782SN/A
1792SN/ASystem::~System()
1802SN/A{
1812378SN/A#if FULL_SYSTEM
1821070SN/A    delete kernelSymtab;
1831070SN/A    delete kernel;
1842378SN/A#else
1852378SN/A    panic("System::fixFuncEventAddr needs to be rewritten "
1862378SN/A          "to work with syscall emulation");
1872378SN/A#endif // FULL_SYSTEM}
1888666SPrakash.Ramrakhyani@arm.com
1898666SPrakash.Ramrakhyani@arm.com    for (uint32_t j = 0; j < numWorkIds; j++)
1908666SPrakash.Ramrakhyani@arm.com        delete workItemStats[j];
1912SN/A}
1922SN/A
1932901Ssaidi@eecs.umich.eduvoid
1944762Snate@binkert.orgSystem::setMemoryMode(Enums::MemoryMode mode)
1952901Ssaidi@eecs.umich.edu{
1962901Ssaidi@eecs.umich.edu    assert(getState() == Drained);
1972901Ssaidi@eecs.umich.edu    memoryMode = mode;
1982901Ssaidi@eecs.umich.edu}
1992901Ssaidi@eecs.umich.edu
2003960Sgblack@eecs.umich.edubool System::breakpoint()
2013960Sgblack@eecs.umich.edu{
2024095Sbinkertn@umich.edu    if (remoteGDB.size())
2034095Sbinkertn@umich.edu        return remoteGDB[0]->breakpoint();
2044095Sbinkertn@umich.edu    return false;
2053960Sgblack@eecs.umich.edu}
2063960Sgblack@eecs.umich.edu
2077445Ssteve.reinhardt@amd.com/**
2087445Ssteve.reinhardt@amd.com * Setting rgdb_wait to a positive integer waits for a remote debugger to
2097445Ssteve.reinhardt@amd.com * connect to that context ID before continuing.  This should really
2107445Ssteve.reinhardt@amd.com   be a parameter on the CPU object or something...
2117445Ssteve.reinhardt@amd.com */
2127445Ssteve.reinhardt@amd.comint rgdb_wait = -1;
2137445Ssteve.reinhardt@amd.com
214180SN/Aint
2155718Shsul@eecs.umich.eduSystem::registerThreadContext(ThreadContext *tc, int assigned)
2162SN/A{
2175712Shsul@eecs.umich.edu    int id;
2185718Shsul@eecs.umich.edu    if (assigned == -1) {
2195718Shsul@eecs.umich.edu        for (id = 0; id < threadContexts.size(); id++) {
2205718Shsul@eecs.umich.edu            if (!threadContexts[id])
2215718Shsul@eecs.umich.edu                break;
2225718Shsul@eecs.umich.edu        }
2235718Shsul@eecs.umich.edu
2245718Shsul@eecs.umich.edu        if (threadContexts.size() <= id)
2255718Shsul@eecs.umich.edu            threadContexts.resize(id + 1);
2265718Shsul@eecs.umich.edu    } else {
2275718Shsul@eecs.umich.edu        if (threadContexts.size() <= assigned)
2285718Shsul@eecs.umich.edu            threadContexts.resize(assigned + 1);
2295718Shsul@eecs.umich.edu        id = assigned;
2301806SN/A    }
2311806SN/A
2322680Sktlim@umich.edu    if (threadContexts[id])
2335823Ssaidi@eecs.umich.edu        fatal("Cannot have two CPUs with the same id (%d)\n", id);
2341806SN/A
2352680Sktlim@umich.edu    threadContexts[id] = tc;
2365714Shsul@eecs.umich.edu    _numContexts++;
2371070SN/A
2385512SMichael.Adler@intel.com    int port = getRemoteGDBPort();
2397445Ssteve.reinhardt@amd.com    if (port) {
2404095Sbinkertn@umich.edu        RemoteGDB *rgdb = new RemoteGDB(this, tc);
2415512SMichael.Adler@intel.com        GDBListener *gdbl = new GDBListener(rgdb, port + id);
2424095Sbinkertn@umich.edu        gdbl->listen();
2437445Ssteve.reinhardt@amd.com
2444095Sbinkertn@umich.edu        if (rgdb_wait != -1 && rgdb_wait == id)
2454095Sbinkertn@umich.edu            gdbl->accept();
2461070SN/A
2474095Sbinkertn@umich.edu        if (remoteGDB.size() <= id) {
2484095Sbinkertn@umich.edu            remoteGDB.resize(id + 1);
2494095Sbinkertn@umich.edu        }
2504095Sbinkertn@umich.edu
2514095Sbinkertn@umich.edu        remoteGDB[id] = rgdb;
2521070SN/A    }
2531070SN/A
2547914SBrad.Beckmann@amd.com    activeCpus.push_back(false);
2557914SBrad.Beckmann@amd.com
2561806SN/A    return id;
257180SN/A}
25875SN/A
2596029Ssteve.reinhardt@amd.comint
2606029Ssteve.reinhardt@amd.comSystem::numRunningContexts()
2616029Ssteve.reinhardt@amd.com{
2626029Ssteve.reinhardt@amd.com    int running = 0;
2636029Ssteve.reinhardt@amd.com    for (int i = 0; i < _numContexts; ++i) {
2646029Ssteve.reinhardt@amd.com        if (threadContexts[i]->status() != ThreadContext::Halted)
2656029Ssteve.reinhardt@amd.com            ++running;
2666029Ssteve.reinhardt@amd.com    }
2676029Ssteve.reinhardt@amd.com    return running;
2686029Ssteve.reinhardt@amd.com}
2696029Ssteve.reinhardt@amd.com
270180SN/Avoid
2717733SAli.Saidi@ARM.comSystem::initState()
2721129SN/A{
2735713Shsul@eecs.umich.edu#if FULL_SYSTEM
2742114SN/A    int i;
2752680Sktlim@umich.edu    for (i = 0; i < threadContexts.size(); i++)
2764194Ssaidi@eecs.umich.edu        TheISA::startupCPU(threadContexts[i], i);
2775713Shsul@eecs.umich.edu#endif
2781129SN/A}
2791129SN/A
2801129SN/Avoid
2815713Shsul@eecs.umich.eduSystem::replaceThreadContext(ThreadContext *tc, int context_id)
282180SN/A{
2835713Shsul@eecs.umich.edu    if (context_id >= threadContexts.size()) {
2842680Sktlim@umich.edu        panic("replaceThreadContext: bad id, %d >= %d\n",
2855713Shsul@eecs.umich.edu              context_id, threadContexts.size());
286180SN/A    }
287180SN/A
2885713Shsul@eecs.umich.edu    threadContexts[context_id] = tc;
2895713Shsul@eecs.umich.edu    if (context_id < remoteGDB.size())
2905713Shsul@eecs.umich.edu        remoteGDB[context_id]->replaceThreadContext(tc);
2912SN/A}
2922SN/A
2932378SN/A#if !FULL_SYSTEM
2942378SN/AAddr
2958601Ssteve.reinhardt@amd.comSystem::allocPhysPages(int npages)
2962378SN/A{
2977770SAli.Saidi@ARM.com    Addr return_addr = pagePtr << LogVMPageSize;
2988601Ssteve.reinhardt@amd.com    pagePtr += npages;
2993162Ssaidi@eecs.umich.edu    if (return_addr >= physmem->size())
3003162Ssaidi@eecs.umich.edu        fatal("Out of memory, please increase size of physical memory.");
3012378SN/A    return return_addr;
3022378SN/A}
3035795Ssaidi@eecs.umich.edu
3045795Ssaidi@eecs.umich.eduAddr
3055795Ssaidi@eecs.umich.eduSystem::memSize()
3065795Ssaidi@eecs.umich.edu{
3075795Ssaidi@eecs.umich.edu    return physmem->size();
3085795Ssaidi@eecs.umich.edu}
3095795Ssaidi@eecs.umich.edu
3105795Ssaidi@eecs.umich.eduAddr
3115795Ssaidi@eecs.umich.eduSystem::freeMemSize()
3125795Ssaidi@eecs.umich.edu{
3137770SAli.Saidi@ARM.com   return physmem->size() - (pagePtr << LogVMPageSize);
3145795Ssaidi@eecs.umich.edu}
3155795Ssaidi@eecs.umich.edu
3162378SN/A#endif
3172378SN/A
3188460SAli.Saidi@ARM.combool
3198460SAli.Saidi@ARM.comSystem::isMemory(const Addr addr) const
3208460SAli.Saidi@ARM.com{
3218460SAli.Saidi@ARM.com    std::list<Range<Addr> >::const_iterator i;
3228460SAli.Saidi@ARM.com    for (i = memRanges.begin(); i != memRanges.end(); i++) {
3238460SAli.Saidi@ARM.com        if (*i == addr)
3248460SAli.Saidi@ARM.com            return true;
3258460SAli.Saidi@ARM.com    }
3268460SAli.Saidi@ARM.com    return false;
3278460SAli.Saidi@ARM.com}
3288460SAli.Saidi@ARM.com
3291070SN/Avoid
3307897Shestness@cs.utexas.eduSystem::resume()
3317897Shestness@cs.utexas.edu{
3327897Shestness@cs.utexas.edu    SimObject::resume();
3337897Shestness@cs.utexas.edu    totalNumInsts = 0;
3347897Shestness@cs.utexas.edu}
3357897Shestness@cs.utexas.edu
3367897Shestness@cs.utexas.eduvoid
3371070SN/ASystem::serialize(ostream &os)
3381070SN/A{
3392378SN/A#if FULL_SYSTEM
3401984SN/A    kernelSymtab->serialize("kernel_symtab", os);
3415183Ssaidi@eecs.umich.edu#else // !FULL_SYSTEM
3427770SAli.Saidi@ARM.com    SERIALIZE_SCALAR(pagePtr);
3437770SAli.Saidi@ARM.com    SERIALIZE_SCALAR(nextPID);
3445183Ssaidi@eecs.umich.edu#endif
3451070SN/A}
3461070SN/A
3471070SN/A
3481070SN/Avoid
3491070SN/ASystem::unserialize(Checkpoint *cp, const string &section)
3501070SN/A{
3512378SN/A#if FULL_SYSTEM
3521984SN/A    kernelSymtab->unserialize("kernel_symtab", cp, section);
3535183Ssaidi@eecs.umich.edu#else // !FULL_SYSTEM
3547770SAli.Saidi@ARM.com    UNSERIALIZE_SCALAR(pagePtr);
3557770SAli.Saidi@ARM.com    UNSERIALIZE_SCALAR(nextPID);
3565183Ssaidi@eecs.umich.edu#endif
3571070SN/A}
3582SN/A
3592SN/Avoid
3608666SPrakash.Ramrakhyani@arm.comSystem::regStats()
3618666SPrakash.Ramrakhyani@arm.com{
3628666SPrakash.Ramrakhyani@arm.com    for (uint32_t j = 0; j < numWorkIds ; j++) {
3638666SPrakash.Ramrakhyani@arm.com        workItemStats[j] = new Stats::Histogram();
3648666SPrakash.Ramrakhyani@arm.com        stringstream namestr;
3658666SPrakash.Ramrakhyani@arm.com        ccprintf(namestr, "work_item_type%d", j);
3668666SPrakash.Ramrakhyani@arm.com        workItemStats[j]->init(20)
3678666SPrakash.Ramrakhyani@arm.com                         .name(name() + "." + namestr.str())
3688666SPrakash.Ramrakhyani@arm.com                         .desc("Run time stat for" + namestr.str())
3698666SPrakash.Ramrakhyani@arm.com                         .prereq(*workItemStats[j]);
3708666SPrakash.Ramrakhyani@arm.com    }
3718666SPrakash.Ramrakhyani@arm.com}
3728666SPrakash.Ramrakhyani@arm.com
3738666SPrakash.Ramrakhyani@arm.comvoid
3748666SPrakash.Ramrakhyani@arm.comSystem::workItemEnd(uint32_t tid, uint32_t workid)
3758666SPrakash.Ramrakhyani@arm.com{
3768666SPrakash.Ramrakhyani@arm.com    std::pair<uint32_t,uint32_t> p(tid, workid);
3778666SPrakash.Ramrakhyani@arm.com    if (!lastWorkItemStarted.count(p))
3788666SPrakash.Ramrakhyani@arm.com        return;
3798666SPrakash.Ramrakhyani@arm.com
3808666SPrakash.Ramrakhyani@arm.com    Tick samp = curTick() - lastWorkItemStarted[p];
3818666SPrakash.Ramrakhyani@arm.com    DPRINTF(WorkItems, "Work item end: %d\t%d\t%lld\n", tid, workid, samp);
3828666SPrakash.Ramrakhyani@arm.com
3838666SPrakash.Ramrakhyani@arm.com    if (workid >= numWorkIds)
3848666SPrakash.Ramrakhyani@arm.com        fatal("Got workid greater than specified in system configuration\n");
3858666SPrakash.Ramrakhyani@arm.com
3868666SPrakash.Ramrakhyani@arm.com    workItemStats[workid]->sample(samp);
3878666SPrakash.Ramrakhyani@arm.com    lastWorkItemStarted.erase(p);
3888666SPrakash.Ramrakhyani@arm.com}
3898666SPrakash.Ramrakhyani@arm.com
3908666SPrakash.Ramrakhyani@arm.comvoid
3912SN/ASystem::printSystems()
3922SN/A{
3932SN/A    vector<System *>::iterator i = systemList.begin();
3942SN/A    vector<System *>::iterator end = systemList.end();
3952SN/A    for (; i != end; ++i) {
3962SN/A        System *sys = *i;
3972SN/A        cerr << "System " << sys->name() << ": " << hex << sys << endl;
3982SN/A    }
3992SN/A}
4002SN/A
4012SN/Avoid
4022SN/AprintSystems()
4032SN/A{
4042SN/A    System::printSystems();
4052SN/A}
4062SN/A
4072902Ssaidi@eecs.umich.educonst char *System::MemoryModeStrings[3] = {"invalid", "atomic",
4082902Ssaidi@eecs.umich.edu    "timing"};
4092902Ssaidi@eecs.umich.edu
4104762Snate@binkert.org#if !FULL_SYSTEM
4112424SN/A
4124762Snate@binkert.orgSystem *
4134762Snate@binkert.orgSystemParams::create()
4142424SN/A{
4155530Snate@binkert.org    return new System(this);
4162424SN/A}
4172424SN/A
4182424SN/A#endif
419