pseudo_inst.hh revision 8559
1298SN/A/* 22188SN/A * Copyright (c) 2003-2006 The Regents of The University of Michigan 3298SN/A * All rights reserved. 4298SN/A * 5298SN/A * Redistribution and use in source and binary forms, with or without 6298SN/A * modification, are permitted provided that the following conditions are 7298SN/A * met: redistributions of source code must retain the above copyright 8298SN/A * notice, this list of conditions and the following disclaimer; 9298SN/A * redistributions in binary form must reproduce the above copyright 10298SN/A * notice, this list of conditions and the following disclaimer in the 11298SN/A * documentation and/or other materials provided with the distribution; 12298SN/A * neither the name of the copyright holders nor the names of its 13298SN/A * contributors may be used to endorse or promote products derived from 14298SN/A * this software without specific prior written permission. 15298SN/A * 16298SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17298SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18298SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19298SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20298SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21298SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22298SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23298SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24298SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25298SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26298SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert 29298SN/A */ 30298SN/A 318543Sgblack@eecs.umich.edu#ifndef __SIM_PSEUDO_INST_HH__ 328543Sgblack@eecs.umich.edu#define __SIM_PSEUDO_INST_HH__ 338543Sgblack@eecs.umich.edu 342680Sktlim@umich.educlass ThreadContext; 35298SN/A 362980Sgblack@eecs.umich.edu//We need the "Tick" and "Addr" data types from here 376214Snate@binkert.org#include "base/types.hh" 382081SN/A 395504Snate@binkert.orgnamespace PseudoInst { 40349SN/A 415504Snate@binkert.org/** 425504Snate@binkert.org * @todo these externs are only here for a hack in fullCPU::takeOver... 435504Snate@binkert.org */ 445504Snate@binkert.orgextern bool doStatisticsInsts; 455504Snate@binkert.orgextern bool doCheckpointInsts; 465504Snate@binkert.orgextern bool doQuiesce; 475504Snate@binkert.org 485780Ssteve.reinhardt@amd.com#if FULL_SYSTEM 498559Sgblack@eecs.umich.edu 505504Snate@binkert.orgvoid arm(ThreadContext *tc); 515504Snate@binkert.orgvoid quiesce(ThreadContext *tc); 528142SAli.Saidi@ARM.comvoid quiesceSkip(ThreadContext *tc); 535504Snate@binkert.orgvoid quiesceNs(ThreadContext *tc, uint64_t ns); 545504Snate@binkert.orgvoid quiesceCycles(ThreadContext *tc, uint64_t cycles); 555504Snate@binkert.orguint64_t quiesceTime(ThreadContext *tc); 565780Ssteve.reinhardt@amd.comuint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len, 575780Ssteve.reinhardt@amd.com uint64_t offset); 585780Ssteve.reinhardt@amd.comvoid loadsymbol(ThreadContext *xc); 595780Ssteve.reinhardt@amd.comvoid addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr); 608555Sgblack@eecs.umich.eduuint64_t initParam(ThreadContext *xc); 618559Sgblack@eecs.umich.edu 628559Sgblack@eecs.umich.edu#else 638559Sgblack@eecs.umich.edu 648559Sgblack@eecs.umich.edustatic inline void 658559Sgblack@eecs.umich.edupanicFsOnlyPseudoInst(const char *name) 668559Sgblack@eecs.umich.edu{ 678559Sgblack@eecs.umich.edu panic("Pseudo inst \"%s\" is only available in Full System mode."); 688559Sgblack@eecs.umich.edu} 698559Sgblack@eecs.umich.edu 708559Sgblack@eecs.umich.edustatic inline void 718559Sgblack@eecs.umich.eduarm(ThreadContext *tc) 728559Sgblack@eecs.umich.edu{ 738559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("arm"); 748559Sgblack@eecs.umich.edu} 758559Sgblack@eecs.umich.edustatic inline void 768559Sgblack@eecs.umich.eduquiesce(ThreadContext *tc) 778559Sgblack@eecs.umich.edu{ 788559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesce"); 798559Sgblack@eecs.umich.edu} 808559Sgblack@eecs.umich.edustatic inline void 818559Sgblack@eecs.umich.eduquiesceSkip(ThreadContext *tc) 828559Sgblack@eecs.umich.edu{ 838559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceSkip"); 848559Sgblack@eecs.umich.edu} 858559Sgblack@eecs.umich.edustatic inline void 868559Sgblack@eecs.umich.eduquiesceNs(ThreadContext *tc, uint64_t ns) 878559Sgblack@eecs.umich.edu{ 888559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceNs"); 898559Sgblack@eecs.umich.edu} 908559Sgblack@eecs.umich.edustatic inline void 918559Sgblack@eecs.umich.eduquiesceCycles(ThreadContext *tc, uint64_t cycles) 928559Sgblack@eecs.umich.edu{ 938559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceCycles"); 948559Sgblack@eecs.umich.edu} 958559Sgblack@eecs.umich.edustatic inline uint64_t 968559Sgblack@eecs.umich.eduquiesceTime(ThreadContext *tc) 978559Sgblack@eecs.umich.edu{ 988559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceTime"); 998559Sgblack@eecs.umich.edu return 0; 1008559Sgblack@eecs.umich.edu} 1018559Sgblack@eecs.umich.edustatic inline uint64_t 1028559Sgblack@eecs.umich.edureadfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset) 1038559Sgblack@eecs.umich.edu{ 1048559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("readFile"); 1058559Sgblack@eecs.umich.edu return 0; 1068559Sgblack@eecs.umich.edu} 1078559Sgblack@eecs.umich.edustatic inline void 1088559Sgblack@eecs.umich.eduloadsymbol(ThreadContext *xc) 1098559Sgblack@eecs.umich.edu{ 1108559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("loadSymbol"); 1118559Sgblack@eecs.umich.edu} 1128559Sgblack@eecs.umich.edustatic inline void 1138559Sgblack@eecs.umich.eduaddsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr) 1148559Sgblack@eecs.umich.edu{ 1158559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("addSymbol"); 1168559Sgblack@eecs.umich.edu} 1178559Sgblack@eecs.umich.edustatic inline uint64_t 1188559Sgblack@eecs.umich.eduinitParam(ThreadContext *tc) 1198559Sgblack@eecs.umich.edu{ 1208559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("initParam"); 1218559Sgblack@eecs.umich.edu return 0; 1228559Sgblack@eecs.umich.edu} 1238559Sgblack@eecs.umich.edu 1245780Ssteve.reinhardt@amd.com#endif 1255780Ssteve.reinhardt@amd.com 1265741Snate@binkert.orguint64_t rpns(ThreadContext *tc); 1275808Snate@binkert.orgvoid wakeCPU(ThreadContext *tc, uint64_t cpuid); 1285504Snate@binkert.orgvoid m5exit(ThreadContext *tc, Tick delay); 1295504Snate@binkert.orgvoid resetstats(ThreadContext *tc, Tick delay, Tick period); 1305504Snate@binkert.orgvoid dumpstats(ThreadContext *tc, Tick delay, Tick period); 1315504Snate@binkert.orgvoid dumpresetstats(ThreadContext *tc, Tick delay, Tick period); 1325504Snate@binkert.orgvoid m5checkpoint(ThreadContext *tc, Tick delay, Tick period); 1335504Snate@binkert.orgvoid debugbreak(ThreadContext *tc); 1345504Snate@binkert.orgvoid switchcpu(ThreadContext *tc); 1357914SBrad.Beckmann@amd.comvoid workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid); 1367914SBrad.Beckmann@amd.comvoid workend(ThreadContext *tc, uint64_t workid, uint64_t threadid); 1375504Snate@binkert.org 1387811Ssteve.reinhardt@amd.com} // namespace PseudoInst 1398543Sgblack@eecs.umich.edu 1408543Sgblack@eecs.umich.edu#endif // __SIM_PSEUDO_INST_HH__ 141