pseudo_inst.hh revision 8734
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); 588734Sdam.sunwoo@arm.comuint64_t writefile(ThreadContext *tc, Addr vaddr, uint64_t len, 598734Sdam.sunwoo@arm.com uint64_t offset, Addr filenameAddr); 605780Ssteve.reinhardt@amd.comvoid loadsymbol(ThreadContext *xc); 615780Ssteve.reinhardt@amd.comvoid addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr); 628555Sgblack@eecs.umich.eduuint64_t initParam(ThreadContext *xc); 638559Sgblack@eecs.umich.edu 648559Sgblack@eecs.umich.edu#else 658559Sgblack@eecs.umich.edu 668559Sgblack@eecs.umich.edustatic inline void 678559Sgblack@eecs.umich.edupanicFsOnlyPseudoInst(const char *name) 688559Sgblack@eecs.umich.edu{ 698559Sgblack@eecs.umich.edu panic("Pseudo inst \"%s\" is only available in Full System mode."); 708559Sgblack@eecs.umich.edu} 718559Sgblack@eecs.umich.edu 728559Sgblack@eecs.umich.edustatic inline void 738559Sgblack@eecs.umich.eduarm(ThreadContext *tc) 748559Sgblack@eecs.umich.edu{ 758559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("arm"); 768559Sgblack@eecs.umich.edu} 778559Sgblack@eecs.umich.edustatic inline void 788559Sgblack@eecs.umich.eduquiesce(ThreadContext *tc) 798559Sgblack@eecs.umich.edu{ 808559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesce"); 818559Sgblack@eecs.umich.edu} 828559Sgblack@eecs.umich.edustatic inline void 838559Sgblack@eecs.umich.eduquiesceSkip(ThreadContext *tc) 848559Sgblack@eecs.umich.edu{ 858559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceSkip"); 868559Sgblack@eecs.umich.edu} 878559Sgblack@eecs.umich.edustatic inline void 888559Sgblack@eecs.umich.eduquiesceNs(ThreadContext *tc, uint64_t ns) 898559Sgblack@eecs.umich.edu{ 908559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceNs"); 918559Sgblack@eecs.umich.edu} 928559Sgblack@eecs.umich.edustatic inline void 938559Sgblack@eecs.umich.eduquiesceCycles(ThreadContext *tc, uint64_t cycles) 948559Sgblack@eecs.umich.edu{ 958559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceCycles"); 968559Sgblack@eecs.umich.edu} 978559Sgblack@eecs.umich.edustatic inline uint64_t 988559Sgblack@eecs.umich.eduquiesceTime(ThreadContext *tc) 998559Sgblack@eecs.umich.edu{ 1008559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("quiesceTime"); 1018559Sgblack@eecs.umich.edu return 0; 1028559Sgblack@eecs.umich.edu} 1038559Sgblack@eecs.umich.edustatic inline uint64_t 1048559Sgblack@eecs.umich.edureadfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset) 1058559Sgblack@eecs.umich.edu{ 1068559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("readFile"); 1078559Sgblack@eecs.umich.edu return 0; 1088559Sgblack@eecs.umich.edu} 1098559Sgblack@eecs.umich.edustatic inline void 1108559Sgblack@eecs.umich.eduloadsymbol(ThreadContext *xc) 1118559Sgblack@eecs.umich.edu{ 1128559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("loadSymbol"); 1138559Sgblack@eecs.umich.edu} 1148559Sgblack@eecs.umich.edustatic inline void 1158559Sgblack@eecs.umich.eduaddsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr) 1168559Sgblack@eecs.umich.edu{ 1178559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("addSymbol"); 1188559Sgblack@eecs.umich.edu} 1198559Sgblack@eecs.umich.edustatic inline uint64_t 1208559Sgblack@eecs.umich.eduinitParam(ThreadContext *tc) 1218559Sgblack@eecs.umich.edu{ 1228559Sgblack@eecs.umich.edu panicFsOnlyPseudoInst("initParam"); 1238559Sgblack@eecs.umich.edu return 0; 1248559Sgblack@eecs.umich.edu} 1258559Sgblack@eecs.umich.edu 1265780Ssteve.reinhardt@amd.com#endif 1275780Ssteve.reinhardt@amd.com 1285741Snate@binkert.orguint64_t rpns(ThreadContext *tc); 1295808Snate@binkert.orgvoid wakeCPU(ThreadContext *tc, uint64_t cpuid); 1305504Snate@binkert.orgvoid m5exit(ThreadContext *tc, Tick delay); 1315504Snate@binkert.orgvoid resetstats(ThreadContext *tc, Tick delay, Tick period); 1325504Snate@binkert.orgvoid dumpstats(ThreadContext *tc, Tick delay, Tick period); 1335504Snate@binkert.orgvoid dumpresetstats(ThreadContext *tc, Tick delay, Tick period); 1345504Snate@binkert.orgvoid m5checkpoint(ThreadContext *tc, Tick delay, Tick period); 1355504Snate@binkert.orgvoid debugbreak(ThreadContext *tc); 1365504Snate@binkert.orgvoid switchcpu(ThreadContext *tc); 1377914SBrad.Beckmann@amd.comvoid workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid); 1387914SBrad.Beckmann@amd.comvoid workend(ThreadContext *tc, uint64_t workid, uint64_t threadid); 1395504Snate@binkert.org 1407811Ssteve.reinhardt@amd.com} // namespace PseudoInst 1418543Sgblack@eecs.umich.edu 1428543Sgblack@eecs.umich.edu#endif // __SIM_PSEUDO_INST_HH__ 143