亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cpu.cc

?? linux下基于c++的處理器仿真平臺。具有處理器流水線
?? CC
字號:
/* * Copyright (c) 2004, 2005 * The Regents of The University of Michigan * All Rights Reserved * * This code is part of the M5 simulator, developed by Nathan Binkert, * Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions * from Ron Dreslinski, Dave Greene, Lisa Hsu, Kevin Lim, Ali Saidi, * and Andrew Schultz. * * Permission is granted to use, copy, create derivative works and * redistribute this software and such derivative works for any * purpose, so long as the copyright notice above, this grant of * permission, and the disclaimer below appear in all copies made; and * so long as the name of The University of Michigan is not used in * any advertising or publicity pertaining to the use or distribution * of this software without specific, written prior authorization. * * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE * UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND * WITHOUT WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER * EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE. THE REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE * LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, SPECIAL, INDIRECT, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM * ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH * DAMAGES. */#include <cmath>#include <cstdio>#include <cstdlib>#include <iostream>#include <iomanip>#include <list>#include <sstream>#include <string>#include "base/cprintf.hh"#include "base/inifile.hh"#include "base/loader/symtab.hh"#include "base/misc.hh"#include "base/pollevent.hh"#include "base/range.hh"#include "base/trace.hh"#include "cpu/base.hh"#include "cpu/exec_context.hh"//#include "cpu/smt.hh"#include "cpu/fast/cpu.hh"#include "cpu/sampler/sampler.hh"#include "cpu/static_inst.hh"#include "mem/base_mem.hh"#include "mem/mem_interface.hh"#include "sim/builder.hh"#include "sim/debug.hh"#include "sim/host.hh"#include "sim/sim_events.hh"#include "sim/sim_object.hh"#if FULL_SYSTEM#include "base/remote_gdb.hh"#include "mem/functional/memory_control.hh"#include "mem/functional/physical.hh"#include "sim/system.hh"#include "targetarch/alpha_memory.hh"#include "targetarch/vtophys.hh"#else#include "mem/functional/functional.hh"#endif // FULL_SYSTEMusing namespace std;/*template <>void AlphaISA::processInterrupts(FastCPU *xc);template <>void AlphaISA::zeroRegisters(FastCPU *xc);*/FastCPU::TickEvent::TickEvent(FastCPU *c)    : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c){}voidFastCPU::TickEvent::process(){    cpu->tick();}const char *FastCPU::TickEvent::description(){    return("This is a FastCPU tick");}#if FULL_SYSTEMvoidFastCPU::post_interrupt(int int_num, int index){    //Handle the interrupt    BaseCPU::post_interrupt(int_num, index);    //Check status of execution context and wakeup if necessary    if (xc->status() == ExecContext::Suspended) {        DPRINTF(IPI,"Suspended processor awoke\n");        //Can insert delay here if not 1 cycle        xc->activate();    }}#endif // FULL_SYSTEMFastCPU::FastCPU(Params *p)    : BaseCPU(p), tickEvent(this), xc(NULL){    _status = Idle;#if FULL_SYSTEM    xc = new ExecContext(this, 0, p->system, p->itb, p->dtb, p->mem);    //Initialize CPU and its registers    TheISA::initCPU(&(xc->regs));#else    xc = new ExecContext(this, /* thread_num */ 0, p->process, /* asid */ 0);#endif // !FULL_SYSTEM    memReq = new MemReq();    memReq->xc = xc;    memReq->asid = 0;    memReq->data = new uint8_t[64];    execContexts.push_back(xc);}      FastCPU::~FastCPU(){    //Free up any allocated memory ?//    delete xc;//    delete memReq->data;//    delete memReq;}voidFastCPU::switchOut(Sampler *sampler){    _status = SwitchedOut;    if (tickEvent.scheduled())        tickEvent.squash();    sampler->signalSwitched();}voidFastCPU::takeOverFrom(BaseCPU *oldCPU){    //Make sure current CPU isn't being used    assert(!tickEvent.scheduled());    //Take over from the old CPU    BaseCPU::takeOverFrom(oldCPU);    //Check if there's an active xc; if so, set this CPU as Running    //Currently the CPU is only single threaded, so this may be unnecessary    for (int i = 0; i < execContexts.size(); ++i) {        ExecContext *xc = execContexts[i];        if (xc->status() == ExecContext::Active && _status != Running) {            _status = Running;            tickEvent.schedule(curTick);        }    }}voidFastCPU::activateContext(int thread_num, int delay){    assert(_status == Idle);    assert(thread_num == 0);    assert(xc);    scheduleTickEvent(delay);    _status = Running;}voidFastCPU::suspendContext(int thread_num){    assert(_status == Running);    assert(thread_num == 0);    assert(xc);    unscheduleTickEvent();    _status = Idle;  //Not sure about this}voidFastCPU::deallocateContext(int thread_num){    //Hack...    suspendContext(thread_num);}voidFastCPU::haltContext(int thread_num){    //Hack...    suspendContext(thread_num);}void FastCPU::serialize(std::ostream &os){    //Need to serialize all state    //Main state is the status and current instruction    SERIALIZE_ENUM(_status);    //Also the execution context    nameOut(os, csprintf("%s.xc", name()));    xc->serialize(os);    //And finally the tick events    nameOut(os, csprintf("%s.tickEvent", name()));    tickEvent.serialize(os);}void FastCPU::unserialize(Checkpoint *cp, const std::string &section){    //Need to unserialize all state from serialize()       //Main state is the status and current instruction    UNSERIALIZE_ENUM(_status);    //Also the execution context    xc->unserialize(cp, csprintf("%s.xc", section));    //And finally the tick events    tickEvent.unserialize(cp, csprintf("%s.tickEvent", section));}template <class T>FaultFastCPU::read(Addr addr, T &data, unsigned flags){    memReq->reset(addr, sizeof(T), flags);    //Translate address first    Fault fault = xc->translateDataReadReq(memReq);    //If successful, do a read of the memory    if (fault == No_Fault) {        fault = xc->read(memReq, data);    }    //Need to somehow check if the read was successful    //Actually without caches, this should be sufficient    return fault;}#ifndef DOXYGEN_SHOULD_SKIP_THIStemplateFaultFastCPU::read(Addr addr, uint64_t &data, unsigned flags);templateFaultFastCPU::read(Addr addr, uint32_t &data, unsigned flags);templateFaultFastCPU::read(Addr addr, uint16_t &data, unsigned flags);templateFaultFastCPU::read(Addr addr, uint8_t &data, unsigned flags);#endif //DOXYGEN_SHOULD_SKIP_THIStemplate<>FaultFastCPU::read(Addr addr, double &data, unsigned flags){    return read(addr, *(uint64_t*)&data, flags);}template<>FaultFastCPU::read(Addr addr, float &data, unsigned flags){    return read(addr, *(uint32_t*)&data, flags);}template<>FaultFastCPU::read(Addr addr, int32_t &data, unsigned flags){    return read(addr, (uint32_t&)data, flags);}template <class T>FaultFastCPU::write(T data, Addr addr, unsigned flags, uint64_t *res){    memReq->reset(addr, sizeof(T), flags);    //Translate address first    Fault fault = xc->translateDataWriteReq(memReq);    //If successful, do a write to the memory    if (fault == No_Fault) {        fault = xc->write(memReq, data);    }    //Need to somehow check if the write was successful    //Actually without caches, this should be sufficient    if (res && fault == No_Fault) {        *res = memReq->result;    }    return fault;}#ifndef DOXYGEN_SHOULD_SKIP_THIStemplateFaultFastCPU::write(uint64_t data, Addr addr, unsigned flags, uint64_t *res);templateFaultFastCPU::write(uint32_t data, Addr addr, unsigned flags, uint64_t *res);templateFaultFastCPU::write(uint16_t data, Addr addr, unsigned flags, uint64_t *res);templateFaultFastCPU::write(uint8_t data, Addr addr, unsigned flags, uint64_t *res);#endif //DOXYGEN_SHOULD_SKIP_THIStemplate<>FaultFastCPU::write(double data, Addr addr, unsigned flags, uint64_t *res){    return write(*(uint64_t*)&data, addr, flags, res);}template<>FaultFastCPU::write(float data, Addr addr, unsigned flags, uint64_t *res){    return write(*(uint32_t*)&data, addr, flags, res);}template<>FaultFastCPU::write(int32_t data, Addr addr, unsigned flags, uint64_t *res){    return write((uint32_t)data, addr, flags, res);}FaultFastCPU::copySrcTranslate(Addr src){    memReq->reset(src, 64);    //Translate address first    Fault fault = xc->translateDataReadReq(memReq);    //Copy over the source addr and physical addr (hack)    if (fault == No_Fault) {        xc->copySrcAddr = src;        xc->copySrcPhysAddr = memReq->paddr;    } else {        xc->copySrcAddr = 0;        xc->copySrcPhysAddr = 0;    }    return fault;}FaultFastCPU::copy(Addr dest){    int blk_size = 64;    uint8_t data[blk_size];        assert(xc->copySrcPhysAddr);    memReq->reset(dest, blk_size);        //Translate address first    Fault fault = xc->translateDataWriteReq(memReq);    //If successful, do copy    if (fault == No_Fault) {        //Copy the old physical address so we don't need to re-execute        //the initial memory request translation        Addr dest_physaddr = memReq->paddr;        //Now set the phys addr to the src set by copySrcTranslate()        memReq->paddr = xc->copySrcPhysAddr;        xc->mem->read(memReq, data);        //Now set the phys addr to the destination translated above        memReq->paddr = dest_physaddr;        xc->mem->write(memReq, data);    }    return fault;}/* start simulation, program loaded, processor precise state initialized */voidFastCPU::tick(){    //Process interrupts if interrupts are enabled and not a PAL inst#if FULL_SYSTEM    if (checkInterrupts && check_interrupts() && !xc->inPalMode())        TheISA::processInterrupts(this);#endif // FULL_SYSTEM      #if FULL_SYSTEM    TheISA::zeroRegisters(this);#else    // Insure ISA semantics    xc->setIntReg(ZeroReg, 0);    xc->setFloatRegDouble(ZeroReg, 0.0);#endif    //Read current PC    Addr pc = xc->readPC();        //If a PAL instruction, then the memory address is physical#if FULL_SYSTEM    unsigned flags = xc->inPalMode() ? PHYSICAL : 0;#else    unsigned flags = 0;#endif // FULL_SYSTEM    //Setup memory request    memReq->cmd = Read;    memReq->reset(pc & ~3, sizeof(uint32_t), flags);    //Translate instruction to physical address    Fault fault = xc->translateInstReq(memReq);    //Check if translation was successful    if (fault == No_Fault) {        fault = xc->instRead(memReq);        //If we have a valid instruction, then execute        if (fault == No_Fault) {            //Increment number of completed instructions            numInst++;                        //Do any committed-instruction-based events            comInstEventQueue[0]->serviceEvents(numInst);                        //Create smart pointer to instruction            StaticInstPtr<TheISA> si(xc->getInst());                        //Execute instruction            fault = si->execute(this, NULL);        }    }    //Either set PC to next PC if no faults, or trap to handle the fault    if (fault == No_Fault) {        xc->regs.pc = xc->regs.npc;        xc->regs.npc += sizeof(MachInst);    }    else {        xc->trap(fault);    }    //Handle any PC based events#if FULL_SYSTEM    Addr oldpc;    do {        oldpc = xc->regs.pc;        system->pcEventQueue.service(xc);    } while (oldpc != xc->regs.pc);#endif    //Reschedule CPU to run    if (status() == Running && !tickEvent.scheduled())        tickEvent.schedule(curTick + cycles(1));}#if FULL_SYSTEMAddrFastCPU::dbg_vtophys(Addr addr){    return vtophys(xc, addr);}#endif // FULL_SYSTEM////////////////////////////////////////////////////////////////////////////  FastCPU Simulation Object//BEGIN_DECLARE_SIM_OBJECT_PARAMS(FastCPU)    Param<Counter> max_insts_any_thread;    Param<Counter> max_insts_all_threads;    Param<Counter> max_loads_any_thread;    Param<Counter> max_loads_all_threads;#if FULL_SYSTEM    SimObjectParam<AlphaITB *> itb;    SimObjectParam<AlphaDTB *> dtb;    SimObjectParam<FunctionalMemory *> mem;    SimObjectParam<System *> system;    Param<int> cpu_id;#else    SimObjectParam<Process *> workload;#endif // FULL_SYSTEM    Param<int> clock;    Param<bool> defer_registration;END_DECLARE_SIM_OBJECT_PARAMS(FastCPU)BEGIN_INIT_SIM_OBJECT_PARAMS(FastCPU)    INIT_PARAM(max_insts_any_thread,	       "terminate when any thread reaches this inst count"),    INIT_PARAM(max_insts_all_threads,	       "terminate when all threads have reached this inst count"),    INIT_PARAM(max_loads_any_thread,	       "terminate when any thread reaches this load count"),    INIT_PARAM(max_loads_all_threads,	       "terminate when all threads have reached this load count"),#if FULL_SYSTEM    INIT_PARAM(itb, "Instruction TLB"),    INIT_PARAM(dtb, "Data TLB"),    INIT_PARAM(mem, "memory"),    INIT_PARAM(system, "system object"),    INIT_PARAM(cpu_id, "processor ID"),#else    INIT_PARAM(workload, "processes to run"),#endif // FULL_SYSTEM    INIT_PARAM(clock, "clock speed"),    INIT_PARAM(defer_registration, "defer system registration (for sampling)")END_INIT_SIM_OBJECT_PARAMS(FastCPU)CREATE_SIM_OBJECT(FastCPU){    FastCPU::Params *params = new FastCPU::Params();    params->name = getInstanceName();    params->max_insts_any_thread = max_insts_any_thread;    params->max_insts_all_threads = max_insts_all_threads;    params->max_loads_any_thread = max_loads_any_thread;    params->max_loads_all_threads = max_loads_all_threads;    params->deferRegistration = defer_registration;    params->clock = clock;    params->functionTrace = false;    params->functionTraceStart = 0;#if FULL_SYSTEM    params->itb = itb;    params->dtb = dtb;    params->mem = mem;    params->system = system;    params->cpu_id = cpu_id;#else    params->process = workload;#endif    return new FastCPU(params);}REGISTER_SIM_OBJECT("FastCPU", FastCPU)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图清纯唯美| 粉嫩蜜臀av国产精品网站| 色综合久久六月婷婷中文字幕| 国产亚洲va综合人人澡精品| 国产一区二区三区美女| 欧美经典一区二区三区| 成人动漫一区二区在线| 1000精品久久久久久久久| 91官网在线观看| 免费看黄色91| 国产嫩草影院久久久久| 色婷婷精品久久二区二区蜜臂av | 成人亚洲一区二区一| 欧美成人精品1314www| 国产精品一区专区| 亚洲国产成人午夜在线一区| 色综合中文综合网| 91视频国产观看| 亚洲成av人片在www色猫咪| 欧美丰满一区二区免费视频| 国内精品免费**视频| 国产精品九色蝌蚪自拍| 午夜精品一区在线观看| 成人网页在线观看| 国产亚洲1区2区3区| 欧美国产国产综合| 91在线观看一区二区| 午夜久久福利影院| 精品视频免费在线| 国产成人精品一区二| 国产一区美女在线| 久久99国产精品免费| 亚洲国产成人porn| 欧美午夜在线观看| 99国产精品久| 99久久国产综合精品麻豆| 成人免费的视频| 丰满亚洲少妇av| 成人免费毛片片v| 大胆亚洲人体视频| 波波电影院一区二区三区| 国产高清视频一区| 成人午夜免费av| 成人av影视在线观看| 成人免费高清在线| 91麻豆免费观看| 色综合天天性综合| 欧美性感一区二区三区| 欧美日韩激情一区二区| 欧美一区二区日韩| 日韩欧美国产一区在线观看| 精品国产乱码久久久久久老虎 | 美腿丝袜亚洲一区| 精品在线视频一区| 国产成人亚洲综合a∨婷婷图片| 国产中文一区二区三区| 国产成人av资源| 99在线热播精品免费| 91一区二区三区在线播放| 欧美综合视频在线观看| 3751色影院一区二区三区| 欧美tickle裸体挠脚心vk| 国产亚洲一区二区在线观看| 亚洲欧洲www| 香蕉久久夜色精品国产使用方法| 人人爽香蕉精品| 国产激情视频一区二区在线观看 | 国产在线一区二区| 成人性生交大片免费看视频在线 | 欧美日韩精品免费观看视频| 欧美大片一区二区三区| 亚洲国产精华液网站w| 一区二区三区鲁丝不卡| 人妖欧美一区二区| 成人高清视频免费观看| 欧美性做爰猛烈叫床潮| 26uuu色噜噜精品一区| 中文字幕五月欧美| 日韩不卡一二三区| 成人毛片在线观看| 欧美老肥妇做.爰bbww视频| 久久综合成人精品亚洲另类欧美 | 国产日韩欧美电影| 亚洲一卡二卡三卡四卡五卡| 卡一卡二国产精品| 99在线热播精品免费| 日韩一区二区三区免费看| 国产精品不卡一区二区三区| 日韩av一区二区三区四区| 国产成a人无v码亚洲福利| 欧美日韩精品福利| 国产精品人成在线观看免费 | 北条麻妃国产九九精品视频| 5858s免费视频成人| 国产精品久久久久久久裸模| 日本欧美一区二区在线观看| 99riav一区二区三区| 日韩视频不卡中文| 夜夜嗨av一区二区三区四季av| 国产乱人伦偷精品视频免下载| 欧美色区777第一页| 国产精品入口麻豆原神| 久久99国产乱子伦精品免费| 欧美日精品一区视频| 国产精品理论片在线观看| 久久精品免费看| 欧美综合亚洲图片综合区| 中文av一区二区| 精品一区二区三区免费播放 | 91原创在线视频| 国产亚洲精久久久久久| 美女www一区二区| 精品视频1区2区| 亚洲激情中文1区| 成人av午夜电影| 久久伊人中文字幕| 蜜臀av性久久久久蜜臀aⅴ四虎| 在线亚洲一区二区| 国产精品久久久久精k8| 国产福利精品一区二区| 精品国产一区二区三区久久久蜜月| 亚洲bdsm女犯bdsm网站| 色女孩综合影院| 亚洲欧美区自拍先锋| 成人国产亚洲欧美成人综合网 | 在线国产电影不卡| 亚洲免费三区一区二区| 成人av网站在线观看免费| 国产欧美1区2区3区| 国产精品一区免费在线观看| 久久人人超碰精品| 国模大尺度一区二区三区| 精品国产成人系列| 激情深爱一区二区| 久久免费午夜影院| 国产一区二区精品久久99| 337p粉嫩大胆噜噜噜噜噜91av| 麻豆91免费看| www欧美成人18+| 国产一区二区三区日韩| 国产色产综合色产在线视频| 国产激情视频一区二区三区欧美 | 秋霞午夜鲁丝一区二区老狼| 91麻豆精品国产综合久久久久久| 午夜视频在线观看一区二区三区| 欧美日韩亚洲丝袜制服| 日韩成人av影视| 日韩欧美电影一二三| 国产麻豆91精品| 亚洲欧洲精品天堂一级| 日本乱人伦aⅴ精品| 亚洲国产精品嫩草影院| 欧美一区二区视频在线观看2022| 日韩专区在线视频| 欧美精品一区二区三区一线天视频| 极品尤物av久久免费看| 国产日韩欧美一区二区三区综合| 成人黄色一级视频| 亚洲国产一区二区视频| 日韩一级黄色大片| 国产精品一区一区三区| 亚洲日本一区二区| 欧美男生操女生| 国产在线视频一区二区三区| 中文字幕不卡在线观看| 在线区一区二视频| 免费在线观看一区二区三区| 久久久国产精品麻豆| 色呦呦网站一区| 免费人成网站在线观看欧美高清| 国产日韩欧美制服另类| 欧美在线高清视频| 精品影院一区二区久久久| 亚洲欧美影音先锋| 91精品国产91久久久久久一区二区| 国产精品一线二线三线| 亚洲精品国产无天堂网2021| 欧美一级国产精品| 成人福利视频网站| 日本三级亚洲精品| 国产精品国产三级国产有无不卡 | 色综合久久久久久久| 国产激情91久久精品导航 | 国产精品1区2区3区在线观看| 国产精品毛片大码女人| 欧美男男青年gay1069videost| 国产麻豆精品在线观看| 一区二区三区精品在线| 精品国产一区二区三区忘忧草| 91丨porny丨国产| 久久se精品一区二区| 一区二区三区蜜桃网| 精品成人一区二区| 色哟哟欧美精品| 韩国毛片一区二区三区| 亚洲香肠在线观看| 国产精品色在线| 精品国产网站在线观看| 欧美日韩黄色影视| 色综合久久综合网|