pseudo_inst.hh revision 8734
11689SN/A/*
21689SN/A * Copyright (c) 2003-2006 The Regents of The University of Michigan
31689SN/A * All rights reserved.
41689SN/A *
51689SN/A * Redistribution and use in source and binary forms, with or without
61689SN/A * modification, are permitted provided that the following conditions are
71689SN/A * met: redistributions of source code must retain the above copyright
81689SN/A * notice, this list of conditions and the following disclaimer;
91689SN/A * redistributions in binary form must reproduce the above copyright
101689SN/A * notice, this list of conditions and the following disclaimer in the
111689SN/A * documentation and/or other materials provided with the distribution;
121689SN/A * neither the name of the copyright holders nor the names of its
131689SN/A * contributors may be used to endorse or promote products derived from
141689SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert
291689SN/A */
301689SN/A
312292SN/A#ifndef __SIM_PSEUDO_INST_HH__
322292SN/A#define __SIM_PSEUDO_INST_HH__
331060SN/A
341717SN/Aclass ThreadContext;
358229Snate@binkert.org
368229Snate@binkert.org//We need the "Tick" and "Addr" data types from here
378229Snate@binkert.org#include "base/types.hh"
388229Snate@binkert.org
391717SN/Anamespace PseudoInst {
408229Snate@binkert.org
411717SN/A/**
422292SN/A * @todo these externs are only here for a hack in fullCPU::takeOver...
432292SN/A */
441717SN/Aextern bool doStatisticsInsts;
451717SN/Aextern bool doCheckpointInsts;
468229Snate@binkert.orgextern bool doQuiesce;
471717SN/A
481717SN/A#if FULL_SYSTEM
491717SN/A
501061SN/Avoid arm(ThreadContext *tc);
512348SN/Avoid quiesce(ThreadContext *tc);
522348SN/Avoid quiesceSkip(ThreadContext *tc);
532348SN/Avoid quiesceNs(ThreadContext *tc, uint64_t ns);
542348SN/Avoid quiesceCycles(ThreadContext *tc, uint64_t cycles);
552348SN/Auint64_t quiesceTime(ThreadContext *tc);
562348SN/Auint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len,
572348SN/A    uint64_t offset);
582348SN/Auint64_t writefile(ThreadContext *tc, Addr vaddr, uint64_t len,
592348SN/A    uint64_t offset, Addr filenameAddr);
601060SN/Avoid loadsymbol(ThreadContext *xc);
611060SN/Avoid addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr);
621060SN/Auint64_t initParam(ThreadContext *xc);
632348SN/A
642348SN/A#else
652348SN/A
665553Snate@binkert.orgstatic inline void
672348SN/ApanicFsOnlyPseudoInst(const char *name)
682348SN/A{
692348SN/A    panic("Pseudo inst \"%s\" is only available in Full System mode.");
701060SN/A}
712348SN/A
721060SN/Astatic inline void
732348SN/Aarm(ThreadContext *tc)
741060SN/A{
752348SN/A    panicFsOnlyPseudoInst("arm");
765553Snate@binkert.org}
772348SN/Astatic inline void
781060SN/Aquiesce(ThreadContext *tc)
792348SN/A{
805553Snate@binkert.org    panicFsOnlyPseudoInst("quiesce");
812348SN/A}
825553Snate@binkert.orgstatic inline void
832348SN/AquiesceSkip(ThreadContext *tc)
845553Snate@binkert.org{
851060SN/A    panicFsOnlyPseudoInst("quiesceSkip");
862348SN/A}
872292SN/Astatic inline void
882348SN/AquiesceNs(ThreadContext *tc, uint64_t ns)
892292SN/A{
902348SN/A    panicFsOnlyPseudoInst("quiesceNs");
912292SN/A}
922348SN/Astatic inline void
932292SN/AquiesceCycles(ThreadContext *tc, uint64_t cycles)
942348SN/A{
952292SN/A    panicFsOnlyPseudoInst("quiesceCycles");
961061SN/A}
971061SN/Astatic inline uint64_t
982292SN/AquiesceTime(ThreadContext *tc)
991061SN/A{
1001061SN/A    panicFsOnlyPseudoInst("quiesceTime");
1012292SN/A    return 0;
1021061SN/A}
1031061SN/Astatic inline uint64_t
1042292SN/Areadfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
1051061SN/A{
1061061SN/A    panicFsOnlyPseudoInst("readFile");
1072292SN/A    return 0;
1081061SN/A}
1091061SN/Astatic inline void
1105553Snate@binkert.orgloadsymbol(ThreadContext *xc)
1111061SN/A{
1121061SN/A    panicFsOnlyPseudoInst("loadSymbol");
1132292SN/A}
1141061SN/Astatic inline void
1151060SN/Aaddsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
1161060SN/A{
1172292SN/A    panicFsOnlyPseudoInst("addSymbol");
118}
119static inline uint64_t
120initParam(ThreadContext *tc)
121{
122    panicFsOnlyPseudoInst("initParam");
123    return 0;
124}
125
126#endif
127
128uint64_t rpns(ThreadContext *tc);
129void wakeCPU(ThreadContext *tc, uint64_t cpuid);
130void m5exit(ThreadContext *tc, Tick delay);
131void resetstats(ThreadContext *tc, Tick delay, Tick period);
132void dumpstats(ThreadContext *tc, Tick delay, Tick period);
133void dumpresetstats(ThreadContext *tc, Tick delay, Tick period);
134void m5checkpoint(ThreadContext *tc, Tick delay, Tick period);
135void debugbreak(ThreadContext *tc);
136void switchcpu(ThreadContext *tc);
137void workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid);
138void workend(ThreadContext *tc, uint64_t workid, uint64_t threadid);
139
140} // namespace PseudoInst
141
142#endif // __SIM_PSEUDO_INST_HH__
143