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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.cc

?? linux下基于c++的處理器仿真平臺。具有處理器流水線
?? CC
字號:
/* * memory.c - flat memory space routines * * This file is a part of the SimpleScalar tool suite written by * Todd M. Austin as a part of the Multiscalar Research Project. *   * The tool suite is currently maintained by Doug Burger and Todd M. Austin. *  * Copyright (C) 1994, 1995, 1996, 1997, 1998 by Todd M. Austin * * This source file is distributed "as is" in the hope that it will be * useful.  The tool set comes with no warranty, and no author or * distributor accepts any responsibility for the consequences of its * use.  *  * Everyone is granted permission to copy, modify and redistribute * this tool set under the following conditions: *  *    This source code is distributed for non-commercial use only.  *    Please contact the maintainer for restrictions applying to  *    commercial use. * *    Permission is granted to anyone to make or distribute copies *    of this source code, either as received or modified, in any *    medium, provided that all copyright notices, permission and *    nonwarranty notices are preserved, and that the distributor *    grants the recipient permission for further redistribution as *    permitted by this document. * *    Permission is granted to distribute this file in compiled *    or executable form under the same conditions that apply for *    source code, provided that either: * *    A. it is accompanied by the corresponding machine-readable *       source code, *    B. it is accompanied by a written offer, with no time limit, *       to give anyone a machine-readable copy of the corresponding *       source code in return for reimbursement of the cost of *       distribution.  This written offer must permit verbatim *       duplication by anyone, or *    C. it is distributed by someone who received only the *       executable form, and is accompanied by a copy of the *       written offer of source code that they received concurrently. * * In other words, you are welcome to use, share and improve this * source file.  You are forbidden to forbid anyone else to use, share * and improve what you give them. * * INTERNET: dburger@cs.wisc.edu * US Mail:  1210 W. Dayton Street, Madison, WI 53706 * * $Id: main.cc 1.58 05/06/05 02:52:51-04:00 rdreslin@zazzer.eecs.umich.edu $ * * $Log: <Not implemented> $ * Revision 1.1.1.1  1999/02/02 19:29:55  sraasch * Import source * * Revision 1.6  1998/08/27 15:38:28  taustin * implemented host interface description in host.h * added target interface support * memory module updated to support 64/32 bit address spaces on 64/32 *       bit machines, now implemented with a dynamically optimized hashed *       page table * added support for quadword's * added fault support * * Revision 1.5  1997/03/11  01:15:25  taustin * updated copyright * mem_valid() added, indicates if an address is bogus, used by DLite! * long/int tweaks made for ALPHA target support * * Revision 1.4  1997/01/06  16:00:51  taustin * stat_reg calls now do not initialize stat variable values * * Revision 1.3  1996/12/27  15:52:46  taustin * updated comments * integrated support for options and stats packages * * Revision 1.1  1996/12/05  18:52:32  taustin * Initial revision * * */#include <cassert>#include <string>#include <sstream>#include "base/intmath.hh"#include "base/statistics.hh"#include "cpu/exec_context.hh"#include "encumbered/mem/functional/main.hh"#include "sim/builder.hh"#include "sim/stats.hh"using namespace std;// create a flat memory space and initialize memory systemMainMemory::MainMemory(const string &n)    : FunctionalMemory(n), takeStats(false){    for (int i = 0; i < MEM_PTAB_SIZE; ++i)	ptab[i] = NULL;    break_address = 0;    break_thread = 1;    break_size = 4;}MainMemory::~MainMemory(){    for (int i = 0; i < MEM_PTAB_SIZE; i++) {	if (ptab[i]) {	    free(ptab[i]->page);	    free(ptab[i]);	}    }}voidMainMemory::startup(){    takeStats = true;}// translate address to host pageuint8_t *MainMemory::translate(Addr addr){    entry *pte, *prev;    if (takeStats) {	// got here via a first level miss in the page tables	ptab_misses++;	ptab_accesses++;    }    // locate accessed PTE    for (prev = NULL, pte = ptab[ptab_set(addr)];	 pte != NULL; prev = pte, pte = pte->next) {	if (pte->tag == ptab_tag(addr)) {	    // move this PTE to head of the bucket list	    if (prev) {		prev->next = pte->next;		pte->next = ptab[ptab_set(addr)];		ptab[ptab_set(addr)] = pte;	    }	    return pte->page;	}    }    // no translation found, return NULL    return NULL;}// allocate a memory pageuint8_t *MainMemory::newpage(Addr addr){    uint8_t *page;    entry *pte;    // see misc.c for details on the getcore() function    page = new uint8_t[VMPageSize];    if (!page)	fatal("MainMemory::newpage: out of virtual memory");    ::memset(page, 0, VMPageSize);    // generate a new PTE    pte = new entry;    if (!pte)	fatal("MainMemory::newpage: out of virtual memory (2)");    pte->tag = ptab_tag(addr);    pte->page = page;    // insert PTE into inverted hash table    pte->next = ptab[ptab_set(addr)];    ptab[ptab_set(addr)] = pte;    if (takeStats) {	// one more page allocated	page_count++;    }    return page;}// locate host page for virtual address ADDR, returns NULL if unallocateduint8_t *MainMemory::page(Addr addr){    // first attempt to hit in first entry, otherwise call xlation fn    if (ptab[ptab_set(addr)] && ptab[ptab_set(addr)]->tag == ptab_tag(addr))    {	if (takeStats) {	    // hit - return the page address on host	    ptab_accesses++;	}	return ptab[ptab_set(addr)]->page;    }    else    {	// first level miss - call the translation helper function	return translate(addr);    }}voidMainMemory::prot_read(Addr addr, uint8_t *p, int size){    int count = min((Addr)size,		    ((addr - 1) & ~(VMPageSize - 1)) + VMPageSize - addr);    page_read(addr, p, count);    addr += count;    p += count;    size -= count;    while (size >= VMPageSize) {	page_read(addr, p, VMPageSize);	addr += VMPageSize;	p += VMPageSize;	size -= VMPageSize;    }    if (size > 0)	page_read(addr, p, size);}voidMainMemory::prot_write(Addr addr, const uint8_t *p, int size){    int count = min((Addr)size,		    ((addr - 1) & ~(VMPageSize - 1)) + VMPageSize - addr);    page_write(addr, p, count);    addr += count;    p += count;    size -= count;    while (size >= VMPageSize) {	page_write(addr, p, VMPageSize);	addr += VMPageSize;	p += VMPageSize;	size -= VMPageSize;    }    if (size > 0)	page_write(addr, p, size);}voidMainMemory::prot_memset(Addr addr, uint8_t val, int size){    int count = min((Addr)size,		    ((addr - 1) & ~(VMPageSize - 1)) + VMPageSize - addr);    page_set(addr, val, count);    addr += count;    size -= count;    while (size >= VMPageSize) {	page_set(addr, val, VMPageSize);	addr += VMPageSize;	size -= VMPageSize;    }    if (size > 0)	page_set(addr, val, size);}// generic memory access function, it's safe because alignments and// permissions are checked, handles any natural transfer sizes; note,// faults out if request is not a power-of-two or if it is larger then// VMPageSizeFaultMainMemory::page_check(Addr addr, int size) const{    if (size < sizeof(uint64_t)) {	if (!IsPowerOf2(size)) {	    panic("Invalid request size!\n");	    return Machine_Check_Fault;	}	if ((size - 1) & addr)	    return Alignment_Fault;    }    else {	if ((addr & (VMPageSize - 1)) + size > VMPageSize) {	    panic("Invalid request size!\n");	    return Machine_Check_Fault;	}	if ((sizeof(uint64_t) - 1) & addr)	    return Alignment_Fault;    }    return No_Fault;}FaultMainMemory::read(MemReqPtr &req, uint8_t *p){    mem_block_test(req->paddr);    Fault fault = page_check(req->paddr, req->size);    if (fault == No_Fault)	page_read(req->paddr, p, req->size);    return fault;}FaultMainMemory::write(MemReqPtr &req, const uint8_t *p){    mem_block_test(req->paddr);    Fault fault = page_check(req->paddr, req->size);    if (fault == No_Fault)	page_write(req->paddr, p, req->size);    return fault;}// Add load-locked to tracking list.  Should only be called if the// operation is a load and the LOCKED flag is set.voidMainMemory::trackLoadLocked(MemReqPtr &req){    // set execution context's lock_addr and lock_flag.  Note that    // this is done in virtual_access.hh in full-system    // mode... eventually we should settle on a common spot for this    // to happen.    req->xc->regs.miscRegs.lock_addr = req->paddr;    req->xc->regs.miscRegs.lock_flag = true;    // first we check if we already have a locked addr for this    // xc.  Since each xc only gets one, we just update the    // existing record with the new address.    list<LockedAddr>::iterator i;    for (i = lockedAddrList.begin(); i != lockedAddrList.end(); ++i) {	if (i->matchesContext(req->xc)) {	    i->setAddr(req->paddr);	    return;	}    }    // no record for this xc: need to allocate a new one    lockedAddrList.push_front(LockedAddr(req->paddr, req->xc));}// Called on *writes* only... both regular stores and// store-conditional operations.  Check for conventional stores which// conflict with locked addresses, and for success/failure of store// conditionals.boolMainMemory::checkLockedAddrList(MemReqPtr &req){    // Initialize return value.  Non-conditional stores always    // succeed.  Assume conditional stores will fail until proven    // otherwise.    bool success = !(req->flags & LOCKED);    // Iterate over list.    list<LockedAddr>::iterator i = lockedAddrList.begin();    while (i != lockedAddrList.end()) {	if (i->matchesAddr(req->paddr)) {	    // we have a matching address	    if ((req->flags & LOCKED) && i->matchesContext(req->xc)) {		// it's a store conditional, and as far as the memory		// system can tell, the requesting context's lock is		// still valid.  We still need to check the context's		// lock flag, since this can get cleared by non-memory		// events such as interrupts.  If it's still set, we		// declare the store conditional successful.		req->result = success = req->xc->regs.miscRegs.lock_flag;		// Check for an execution context that has had lots of		// SC failures (with no intervening successes), and		// print a deadlock warning to the user.		if (success) {		    // success! clear the counter		    req->xc->storeCondFailures = 0;		}		else {		    if (++req->xc->storeCondFailures % 1000000 == 0) {			// unfortunately the xc has no back			// pointer to its CPU, so we just print out			// the xc pointer value to distinguish			// different contexts			cerr << "Warning: " << req->xc->storeCondFailures			     << " consecutive store conditional failures "			     << "on execution context " << req->xc			     << endl;		    }		}	    }	    // The execution context's copy of the lock address should	    // not be changed without the memory system finding out	    // about it (via a load_locked),	    ExecContext *lockingContext = i->getContext();	    assert(i->matchesAddr(lockingContext->regs.miscRegs.lock_addr));	    // Clear the lock flag.	    lockingContext->regs.miscRegs.lock_flag = false;	    // Get rid of our record of this lock and advance to next	    i = lockedAddrList.erase(i);	}	else {	    // no match: advance to next record	    ++i;	}    }    return success;}void MainMemory::regStats(){    using namespace Stats;    page_count	.name(name() + ".page_count")	.desc("total number of pages allocated")	;    ptab_misses	.name(name() + ".ptab_misses")	.desc("total first level page table misses")	;    ptab_accesses	.name(name() + ".ptab_accesses")	.desc("total page table accessess")	;}void MainMemory::regFormulas(){    using namespace Stats;    page_mem	.name(name() + ".page_mem")	.desc("total size of memory pages allocated")	;    page_mem = page_count * VMPageSize / 1024;    ptab_miss_rate	.name(name() + ".ptab_miss_rate")	.desc("first level page table miss rate")	.precision(4)	;    ptab_miss_rate = ptab_misses / ptab_accesses;}BEGIN_DECLARE_SIM_OBJECT_PARAMS(MainMemory)    Param<bool> do_data;END_DECLARE_SIM_OBJECT_PARAMS(MainMemory)BEGIN_INIT_SIM_OBJECT_PARAMS(MainMemory)    INIT_PARAM_DFLT(do_data, "dummy param", false)END_INIT_SIM_OBJECT_PARAMS(MainMemory)CREATE_SIM_OBJECT(MainMemory){    return new MainMemory(getInstanceName());}REGISTER_SIM_OBJECT("MainMemory", MainMemory)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月综合激情网| 亚洲综合一区二区三区| 日韩美女视频一区二区| 免费观看成人鲁鲁鲁鲁鲁视频| 成人亚洲精品久久久久软件| 欧美一区三区二区| 一区二区视频免费在线观看| 国产激情一区二区三区桃花岛亚洲| 欧美精品99久久久**| 国产精品女同互慰在线看| 免费高清视频精品| 欧美视频在线一区二区三区| 18欧美亚洲精品| 国产福利视频一区二区三区| 日韩三级视频在线观看| 亚洲 欧美综合在线网络| 成人精品电影在线观看| 国产日产精品1区| 激情欧美日韩一区二区| 日韩片之四级片| 午夜精品久久久久久久| 欧美午夜不卡视频| 一区二区三区四区亚洲| 91在线精品秘密一区二区| 国产欧美日韩亚州综合| 国产一区二区三区在线观看免费视频| 日韩精品一区国产麻豆| 日本在线不卡一区| 91精品欧美福利在线观看| 午夜精品久久久久| 7799精品视频| 日韩vs国产vs欧美| 欧美va亚洲va香蕉在线| 久久成人久久爱| 日韩一区二区精品葵司在线 | 裸体健美xxxx欧美裸体表演| 日本道精品一区二区三区| 综合久久综合久久| 91美女片黄在线观看91美女| 玉足女爽爽91| 欧美日韩mp4| 久色婷婷小香蕉久久| 久久久久久综合| 91在线视频免费91| 日韩精品电影在线观看| 制服丝袜激情欧洲亚洲| 国产一区二区在线观看免费| 中文字幕欧美区| 色综合一区二区三区| 亚洲va国产va欧美va观看| 日韩女优制服丝袜电影| 国产一区二区三区在线观看免费 | 欧美成人午夜电影| 久久91精品久久久久久秒播| 国产日韩欧美不卡| 91国产免费看| 久久国产麻豆精品| 国产精品久久久久久久第一福利| 日本丰满少妇一区二区三区| 亚洲bt欧美bt精品777| 欧美成人激情免费网| 成人av资源下载| 亚洲777理论| 久久久久88色偷偷免费| 日本韩国精品在线| 国产精品18久久久久久久久| 亚洲六月丁香色婷婷综合久久 | 日本一区二区视频在线观看| 日本高清不卡视频| 狠狠色丁香婷综合久久| 一区二区三区四区视频精品免费 | 日韩一区二区电影网| 成人激情黄色小说| 日本欧美在线看| 日韩理论片网站| 欧美v亚洲v综合ⅴ国产v| 色综合久久88色综合天天免费| 琪琪一区二区三区| 亚洲精品乱码久久久久| 欧美精品一区二区三| 欧美午夜电影在线播放| youjizz久久| 美国三级日本三级久久99 | 色诱视频网站一区| 国产成人亚洲精品青草天美| 日韩精品电影在线| 亚洲午夜一二三区视频| 国产精品国产馆在线真实露脸 | 欧美日韩国产一区| 不卡电影免费在线播放一区| 精品一区免费av| 亚洲成av人片在线观看| 亚洲三级电影网站| 国产亚洲欧美激情| 精品国产一区二区三区四区四| 欧美日韩一级片网站| 97久久超碰国产精品| 国产高清视频一区| 狠狠久久亚洲欧美| 精品一区二区三区在线播放视频 | 国产成人高清视频| 久久99精品久久久久婷婷| 午夜欧美视频在线观看| 亚洲一级不卡视频| 亚洲乱码国产乱码精品精小说 | 韩国v欧美v日本v亚洲v| 麻豆久久一区二区| 男女视频一区二区| 蜜乳av一区二区| 日韩电影在线免费看| 日韩和欧美一区二区| 视频一区视频二区中文| 婷婷亚洲久悠悠色悠在线播放| 亚洲另类春色校园小说| 亚洲免费三区一区二区| 亚洲裸体在线观看| 亚洲六月丁香色婷婷综合久久| 亚洲欧美日韩在线| 亚洲六月丁香色婷婷综合久久| 亚洲黄色在线视频| 亚洲一区二区美女| 日本女优在线视频一区二区| 久久er精品视频| 国产精品一线二线三线精华| 国产精品一区二区在线观看不卡| 国产成人一级电影| 91丨porny丨国产入口| 欧美性色综合网| 欧美一级国产精品| 久久夜色精品国产噜噜av| 国产人妖乱国产精品人妖| 国产精品麻豆一区二区| 一区二区三区欧美视频| 三级在线观看一区二区| 国产在线不卡一卡二卡三卡四卡| 成人综合在线观看| 日本道精品一区二区三区| 717成人午夜免费福利电影| 欧美mv日韩mv| 中文字幕欧美一区| 亚洲电影你懂得| 极品少妇xxxx精品少妇偷拍| 成人一区二区三区视频| 欧美日韩国产成人在线91| 精品国偷自产国产一区| 一区二区在线观看免费视频播放| 香蕉乱码成人久久天堂爱免费| 国产一区三区三区| 色偷偷成人一区二区三区91| 欧美一级视频精品观看| 国产精品久久久久三级| 三级欧美韩日大片在线看| 成人小视频免费观看| 精品视频999| 中文字幕精品一区二区精品绿巨人| 亚洲永久精品国产| 国产福利91精品一区| 欧美日韩黄色影视| 国产精品久久久久三级| 美国三级日本三级久久99| 91麻豆精品在线观看| 精品久久久久av影院| 亚洲宅男天堂在线观看无病毒| 国产九色精品成人porny| 欧美在线观看一区二区| 久久久国产综合精品女国产盗摄| 性做久久久久久免费观看欧美| 成人午夜激情在线| 日韩视频一区二区三区在线播放| 亚洲激情第一区| 成人性生交大片免费看中文网站| 欧美一二三区在线| 亚洲永久精品国产| 91小视频在线免费看| 国产午夜精品一区二区三区四区| 午夜电影久久久| 欧美影片第一页| 亚洲视频中文字幕| 成人综合在线网站| 久久精品人人做人人综合 | 精品国内二区三区| 日韩经典一区二区| 欧美日韩高清在线播放| 亚洲人被黑人高潮完整版| 成人午夜激情视频| 国产色综合久久| 国产九九视频一区二区三区| 精品理论电影在线| 美国十次了思思久久精品导航| 欧美日韩国产区一| 午夜视频久久久久久| 欧美日韩专区在线| 亚洲成a人在线观看| 欧美性猛交xxxx黑人交| 一区二区三区在线观看国产 | 欧美一区二区三区视频在线| 午夜影视日本亚洲欧洲精品| 欧美午夜在线一二页| 亚洲综合免费观看高清完整版| 91久久精品一区二区三区|