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

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

?? ref.c

?? 這是個trace drive的Cache模擬器
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Memory reference handling functions for Dinero IV * Written by Jan Edler and Mark D. Hill * * Copyright (C) 1997 NEC Research Institute, Inc. and Mark D. Hill. * All rights reserved. * Copyright (C) 1985, 1989 Mark D. Hill.  All rights reserved. *  * Permission to use, copy, modify, and distribute this software and * its associated documentation for non-commercial purposes is hereby * granted (for commercial purposes see below), provided that the above * copyright notice appears in all copies, derivative works or modified * versions of the software and any portions thereof, and that both the * copyright notice and this permission notice appear in the documentation. * NEC Research Institute Inc. and Mark D. Hill shall be given a copy of * any such derivative work or modified version of the software and NEC * Research Institute Inc.  and any of its affiliated companies (collectively * referred to as NECI) and Mark D. Hill shall be granted permission to use, * copy, modify, and distribute the software for internal use and research. * The name of NEC Research Institute Inc. and its affiliated companies * shall not be used in advertising or publicity related to the distribution * of the software, without the prior written consent of NECI.  All copies, * derivative works, or modified versions of the software shall be exported * or reexported in accordance with applicable laws and regulations relating * to export control.  This software is experimental.  NECI and Mark D. Hill * make no representations regarding the suitability of this software for * any purpose and neither NECI nor Mark D. Hill will support the software. *  * Use of this software for commercial purposes is also possible, but only * if, in addition to the above requirements for non-commercial use, written * permission for such use is obtained by the commercial user from NECI or * Mark D. Hill prior to the fabrication and distribution of the software. *  * THE SOFTWARE IS PROVIDED AS IS.  NECI AND MARK D. HILL DO NOT MAKE * ANY WARRANTEES EITHER EXPRESS OR IMPLIED WITH REGARD TO THE SOFTWARE. * NECI AND MARK D. HILL ALSO DISCLAIM ANY WARRANTY THAT THE SOFTWARE IS * FREE OF INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS OF OTHERS. * NO OTHER LICENSE EXPRESS OR IMPLIED IS HEREBY GRANTED.  NECI AND MARK * D. HILL SHALL NOT BE LIABLE FOR ANY DAMAGES, INCLUDING GENERAL, SPECIAL, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY * TO USE THE SOFTWARE. * * $Header: /home/edler/dinero/d4/RCS/ref.c,v 1.8 1997/12/11 07:56:19 edler Exp $ *//* * This file contains the primary functions * for handling memory references in Dinero IV. * *	Replacement policy functions * 	Prefetch policy functions *	Write allocate and back/through policy functions *	Other support functions *	Primary user-callable function: d4ref * * These functions are grouped together to allow customization * on a per-cache basis to be performed, * with macros such as D4CUSTOM, D4_CACHE_*, and D4_OPTS_*. * In such a case, this file is #include'd into some other file * multiple times (see d4customize in misc.c). * The first time, we do only some stuff that must be done just one time. * Each additional time, we define all the customized functions for one cache. * * If you add new policy functions to this file, you also need to add * some code to d4customize in misc.c! *//* * The first group of stuff in this file is only done once * if we are customizing */#if !D4CUSTOM || D4_REF_ONCE==0#include <stddef.h>#include <stdlib.h>#include <limits.h>#include <stdio.h>#include <string.h>#include <assert.h>#include "d4.h"/* some systems don't provide a proper declaration for random() */#ifdef D4_RANDOM_DEFextern D4_RANDOM_DEF random(void);#endif/* some silly macros to cope with ## wierdness */#define D4_OPT__(cacheid,spec)	D4_OPTS_ ## cacheid ## _ ## spec#define D4_OPT_(cacheid,spec)	D4_OPT__(cacheid,spec)#define D4_OPT(spec)		D4_OPT_(D4_CACHEID,spec)#if !D4CUSTOM /* these are just dummies to avoid unresolved references */int d4_ncustom = 0;long *d4_cust_vals[1] = { NULL };#endif/* This is a general mechanism by which you can tell if we are customized */const int d4custom = D4CUSTOM;/* * We need some non-customized policy functions even in the customized * case.  These dummy functions aren't for actually calling, but * are needed to resolve references, e.g., when the user sets * the function pointers in d4cache before calling d4setup. * They also allow comparison to be done in obscure cases, e.g., to * see if a particular policy is in effect. */#if D4CUSTOMstatic void d4dummy_crash (char *name)	{ fprintf (stderr, "Dinero IV: someone called dummy function %s!\n", name);	  exit(9);	}d4stacknode *d4rep_lru (d4cache *c, int stacknum, d4memref m, d4stacknode *ptr)	{ d4dummy_crash("d4rep_lru"); return NULL; }d4stacknode *d4rep_fifo (d4cache *c, int stacknum, d4memref m, d4stacknode *ptr)	{ d4dummy_crash("d4rep_fifo"); return NULL; }d4stacknode *d4rep_random (d4cache *c, int stacknum, d4memref m, d4stacknode *ptr)	{ d4dummy_crash("d4rep_random"); return NULL; }d4pendstack *d4prefetch_none (d4cache *c, d4memref m, int miss, d4stacknode *stackptr)	{ d4dummy_crash("d4prefetch_none"); return NULL; }d4pendstack *d4prefetch_always (d4cache *c, d4memref m, int miss, d4stacknode *stackptr)	{ d4dummy_crash("d4prefetch_always"); return NULL; }d4pendstack *d4prefetch_loadforw (d4cache *c, d4memref m, int miss, d4stacknode *stackptr)	{ d4dummy_crash("d4prefetch_loadforw"); return NULL; }d4pendstack *d4prefetch_subblock (d4cache *c, d4memref m, int miss, d4stacknode *stackptr)	{ d4dummy_crash("d4prefetch_subblock"); return NULL; }d4pendstack *d4prefetch_miss (d4cache *c, d4memref m, int miss, d4stacknode *stackptr)	{ d4dummy_crash("d4prefetch_miss"); return NULL; }d4pendstack *d4prefetch_tagged (d4cache *c, d4memref m, int miss, d4stacknode *stackptr)	{ d4dummy_crash("d4prefetch_tagged"); return NULL; }int d4walloc_always (d4cache *c, d4memref m)	{ d4dummy_crash("d4walloc_always"); return 0; }int d4walloc_never (d4cache *c, d4memref m)	{ d4dummy_crash("d4walloc_never"); return 0; }int d4walloc_nofetch (d4cache *c, d4memref m)	{ d4dummy_crash("d4walloc_nofetch"); return 0; }int d4wback_always (d4cache *c, d4memref m, int setnumber, d4stacknode *ptr, int walloc)	{ d4dummy_crash("d4wback_always"); return 0; }int d4wback_never (d4cache *c, d4memref m, int setnumber, d4stacknode *ptr, int walloc)	{ d4dummy_crash("d4wback_never"); return 0; }int d4wback_nofetch (d4cache *c, d4memref m, int setnumber, d4stacknode *ptr, int walloc)	{ d4dummy_crash("d4wback_nofetch"); return 0; }#endif#if D4CUSTOM/* * Dynamic stub for d4ref in customized case. * This routine will normally be called at most 1 time for each cache. * Remember, if D4CUSTOM is 1, the "real" d4ref, later in this file, * will appear multiple times, renamed to something else each time. */#undef d4ref /* defeat the macro from d4.h, which users normally invoke */extern void d4ref (d4cache *, d4memref); /* prototype to avoid compiler warnings */voidd4ref (d4cache *c, d4memref m){	extern int d4_ncustom;	extern void (*d4_custom[]) (d4cache *, d4memref);	if (c->cacheid <= 0 || c->cacheid > d4_ncustom) {		/* "can't happen" */		fprintf (stderr, "Dinero IV: d4_custom is messed up "			 "(d4_ncustom %d, cacheid %d)\n", d4_ncustom, c->cacheid);		exit (9);	}	c->ref = d4_custom[c->cacheid-1];	c->ref (c, m);}#endif#define D4_REF_ONCE 1	/* don't do it again */#endif	/* !D4CUSTOM || D4_REF_ONCE==0 *//* * Everything else in this file may be done multiple times * if we're customizing. */#if !D4CUSTOM || D4_REF_ONCE>1	/* applies everything else except the last line */#if !D4CUSTOM || D4_OPT (rep_lru)/* * LRU replacement policy * With D4CUSTOM!=0 and inlining, this is also good for direct-mapped caches */D4_INLINEd4stacknode *d4rep_lru (d4cache *c, int stacknum, d4memref m, d4stacknode *ptr){	if (ptr != NULL) {	/* hits */		if ((!D4CUSTOM || D4VAL (c, assoc) > 1 || (D4VAL (c, flags) & D4F_CCC) != 0) &&		    ptr != c->stack[stacknum].top)			d4movetotop (c, stacknum, ptr);	}	else {			/* misses */		ptr = c->stack[stacknum].top->up;		assert (ptr->valid == 0);		ptr->blockaddr = D4ADDR2BLOCK (c, m.address);		if ((!D4CUSTOM || D4VAL(c,assoc) >= D4HASH_THRESH || (D4VAL(c,flags)&D4F_CCC)!=0) &&		    c->stack[stacknum].n > D4HASH_THRESH)			d4hash (c, stacknum, ptr);		c->stack[stacknum].top = ptr;	/* quicker than d4movetotop */	}	return ptr;}#endif	/* !D4CUSTOM || D4_OPT (rep_lru) */#if !D4CUSTOM || D4_OPT (rep_fifo)/* * FIFO replacement policy */D4_INLINEd4stacknode *d4rep_fifo (d4cache *c, int stacknum, d4memref m, d4stacknode *ptr){	if (ptr == NULL) {	/* misses */		ptr = c->stack[stacknum].top->up;		assert (ptr->valid == 0);		ptr->blockaddr = D4ADDR2BLOCK (c, m.address);		if (c->stack[stacknum].n > D4HASH_THRESH)			d4hash (c, stacknum, ptr);		c->stack[stacknum].top = ptr;	/* quicker than d4movetotop */	}	return ptr;}#endif	/* !D4CUSTOM || D4_OPT (rep_fifo) */#if !D4CUSTOM || D4_OPT (rep_random)/* * Random replacement policy. */D4_INLINEd4stacknode *d4rep_random (d4cache *c, int stacknum, d4memref m, d4stacknode *ptr){	if (ptr == NULL) {	/* misses */		int setsize = c->stack[stacknum].n - 1;		ptr = c->stack[stacknum].top->up;		assert (ptr->valid == 0);		ptr->blockaddr = D4ADDR2BLOCK (c, m.address);		if (setsize >= D4HASH_THRESH)			d4hash (c, stacknum, ptr);		c->stack[stacknum].top = ptr;	/* quicker than d4movetotop */		if (ptr->up->valid != 0)	/* set is full */			d4movetobot (c, stacknum, d4findnth (c, stacknum, 2 + (random() % setsize)));	}	return ptr;}#endif	/* !D4CUSTOM || D4_OPT (rep_random) */#if !D4CUSTOM || D4_OPT (prefetch_none)/* * Demand fetch only policy, no prefetching */D4_INLINEd4pendstack *d4prefetch_none (d4cache *c, d4memref m, int miss, d4stacknode *stackptr){	/* no prefetch, nothing to do */	return NULL;}#endif	/* !D4CUSTOM || D4_OPT (prefetch_none) */#if !D4CUSTOM || D4_OPT (prefetch_always)/* * Always prefetch policy */D4_INLINEd4pendstack *d4prefetch_always (d4cache *c, d4memref m, int miss, d4stacknode *stackptr){	d4pendstack *pf;	pf = d4get_mref();	pf->m.address = D4ADDR2SUBBLOCK (c, m.address + c->prefetch_distance);	pf->m.accesstype = m.accesstype | D4PREFETCH;	pf->m.size = 1<<D4VAL(c,lg2subblocksize);	return pf;}#endif	/* !D4CUSTOM || D4_OPT (prefetch_always) */#if !D4CUSTOM || D4_OPT (prefetch_loadforw)/* * Load forward prefetch policy * Don't prefetch into next block. */D4_INLINEd4pendstack *d4prefetch_loadforw (d4cache *c, d4memref m, int miss, d4stacknode *stackptr){	d4pendstack *pf;	if (D4ADDR2BLOCK(c,m.address+c->prefetch_distance) != D4ADDR2BLOCK(c,m.address))		return NULL;	pf = d4get_mref();	pf->m.address = D4ADDR2SUBBLOCK (c, m.address + c->prefetch_distance);	pf->m.accesstype = m.accesstype | D4PREFETCH;	pf->m.size = 1<<D4VAL(c,lg2subblocksize);	return pf;}#endif	/* !D4CUSTOM || D4_OPT (prefetch_loadforw) */#if !D4CUSTOM || D4_OPT (prefetch_subblock)/* * Subblock prefetch policy * Don't prefetch into next block; wrap around within block instead. */D4_INLINEd4pendstack *d4prefetch_subblock (d4cache *c, d4memref m, int miss, d4stacknode *stackptr){	d4pendstack *pf;	pf = d4get_mref();	pf->m.address = D4ADDR2SUBBLOCK (c, m.address + c->prefetch_distance);	pf->m.accesstype = m.accesstype | D4PREFETCH;	pf->m.size = 1<<D4VAL(c,lg2subblocksize);	if (D4ADDR2BLOCK(c,pf->m.address) != D4ADDR2BLOCK(c,m.address))		pf->m.address -= 1<<D4VAL(c,lg2blocksize);	return pf;}#endif	/* !D4CUSTOM || D4_OPT (prefetch_subblock) */#if !D4CUSTOM || D4_OPT (prefetch_miss)/* * Miss prefetch policy * Prefetch only on misses */D4_INLINEd4pendstack *d4prefetch_miss (d4cache *c, d4memref m, int miss, d4stacknode *stackptr){	d4pendstack *pf;	if (!miss)		return NULL;	pf = d4get_mref();	pf->m.address = D4ADDR2SUBBLOCK (c, m.address + c->prefetch_distance);	pf->m.accesstype = m.accesstype | D4PREFETCH;	pf->m.size = 1<<D4VAL(c,lg2subblocksize);	return pf;}#endif	/* !D4CUSTOM || D4_OPT (prefetch_miss) */#if !D4CUSTOM || D4_OPT (prefetch_tagged)/*  * Tagged prefetch (see Smith, "cache Memories," ~p.20) initiates  * a prefetch on the first demand reference to a (sub)-block.  Thus,  * a prefetch is initiated on a demand miss or the first demand  * reference to a (sub)-block that was brought into the cache by a  * prefetch.  * * Tagged prefetching is implemented using demand reference bits * in the cache entry.  A prefetch is started on a demand miss and * on a refernce to a (sub)-block whose reference bit was not previously set. */D4_INLINEd4pendstack *d4prefetch_tagged (d4cache *c, d4memref m, int miss, d4stacknode *stackptr){	d4pendstack *pf;	int sbbits;	sbbits = D4ADDR2SBMASK(c,m);	if (!miss && (sbbits & stackptr->referenced) != 0)		return NULL;	pf = d4get_mref();	pf->m.address = D4ADDR2SUBBLOCK (c, m.address + c->prefetch_distance);	pf->m.accesstype = m.accesstype | D4PREFETCH;	pf->m.size = 1<<D4VAL(c,lg2subblocksize);	return pf;}#endif	/* !D4CUSTOM || D4_OPT (prefetch_tagged) */#if !D4CUSTOM || D4_OPT (walloc_always)/* * Always write allocate */D4_INLINEintd4walloc_always (d4cache *c, d4memref m){	return 1;}#endif	/* !D4CUSTOM || D4_OPT (walloc_always) */#if !D4CUSTOM || D4_OPT (walloc_never)/* * Never write allocate */D4_INLINEintd4walloc_never (d4cache *c, d4memref m){	return 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
毛片av一区二区| 国产精品欧美久久久久无广告| 亚洲成a人片在线观看中文| 欧美日韩视频不卡| 日韩不卡在线观看日韩不卡视频| 制服丝袜亚洲播放| 国产成人精品亚洲午夜麻豆| 中文字幕av不卡| 91丝袜国产在线播放| 亚洲一区在线电影| 精品三级av在线| 不卡电影免费在线播放一区| 亚洲自拍偷拍综合| 欧美一级理论性理论a| 国产精品一区二区在线看| 中文字幕亚洲综合久久菠萝蜜| 欧美午夜在线一二页| 久久99日本精品| 亚洲欧洲精品一区二区精品久久久 | 亚洲午夜私人影院| 欧美一级高清片在线观看| 国产精品白丝av| 一区二区三区日韩欧美精品| 日韩视频永久免费| 99精品欧美一区| 日本vs亚洲vs韩国一区三区二区 | 国产98色在线|日韩| 亚洲国产精品视频| 国产欧美日本一区二区三区| 99国产精品国产精品毛片| 免费成人在线网站| 亚洲精品视频在线观看网站| 欧美第一区第二区| 欧美在线影院一区二区| 久久97超碰国产精品超碰| 亚洲综合色丁香婷婷六月图片| 精品久久久久久久一区二区蜜臀| 色悠悠久久综合| 国产一区二区视频在线| 亚洲成人av资源| 18成人在线视频| 欧美tickling网站挠脚心| 欧美手机在线视频| 成人美女在线视频| 久久99在线观看| 午夜精品免费在线观看| 成人免费在线视频观看| 国产日产欧美一区| 久久综合九色综合欧美就去吻| 欧美私人免费视频| 色哟哟国产精品免费观看| 国产精品亚洲午夜一区二区三区 | 国模少妇一区二区三区| 亚洲18影院在线观看| 一区二区三区精品在线| 国产精品久久久久一区二区三区共| 日韩欧美国产一区二区三区| 欧美日韩国产首页在线观看| 91美女在线观看| 懂色av噜噜一区二区三区av| 久久av资源网| 久久国产精品一区二区| 日韩国产欧美在线视频| 午夜精品久久久久久久久久久| 亚洲精品网站在线观看| 最新中文字幕一区二区三区 | 日韩精品中文字幕在线一区| 欧美一区二区视频网站| 欧美日韩精品系列| 欧美日韩小视频| 欧美精品乱码久久久久久| 欧美日韩一区二区三区不卡| 欧美视频自拍偷拍| 欧美日韩国产一级| 在线电影一区二区三区| 69av一区二区三区| 日韩色视频在线观看| 精品日韩一区二区三区免费视频| 欧美第一区第二区| 欧美精品一区二区久久久| 久久午夜羞羞影院免费观看| 久久伊99综合婷婷久久伊| 久久久蜜臀国产一区二区| 国产农村妇女毛片精品久久麻豆| 国产免费成人在线视频| 亚洲视频在线一区二区| 亚洲精品成人悠悠色影视| 亚洲高清不卡在线观看| 日本美女一区二区三区| 国产一区二区三区免费| 成人永久aaa| 91麻豆国产精品久久| 欧美日韩日日骚| 精品入口麻豆88视频| 国产精品高潮久久久久无| 一区二区三区在线播放| 免费av成人在线| 国产成人小视频| 一本色道久久加勒比精品| 51精品久久久久久久蜜臀| 久久精品视频一区二区三区| 国产精品久久久久国产精品日日| 亚洲欧美日韩国产另类专区| 性久久久久久久久| 国产精品自拍在线| 色狠狠色噜噜噜综合网| 欧美成人女星排行榜| 中文字幕在线视频一区| 亚洲国产综合人成综合网站| 精品影视av免费| 97久久超碰国产精品| 宅男在线国产精品| 国产精品久久久久久久久久免费看 | 99精品黄色片免费大全| 9191成人精品久久| 国产精品久久久久久久岛一牛影视 | 美国十次了思思久久精品导航| 国产v综合v亚洲欧| 欧美人妇做爰xxxⅹ性高电影 | 日韩一区二区免费在线电影| 国产日韩欧美精品一区| 日本欧美一区二区| 91久久精品一区二区| 久久久久国产一区二区三区四区| 亚洲资源在线观看| 成人黄色一级视频| 欧美不卡一区二区三区四区| 亚洲三级电影全部在线观看高清| 久久综合综合久久综合| 日本高清不卡视频| 亚洲国产成人午夜在线一区| 偷拍一区二区三区四区| 91麻豆国产香蕉久久精品| 国产偷v国产偷v亚洲高清| 婷婷丁香久久五月婷婷| 91麻豆视频网站| 国产日韩欧美一区二区三区综合| 喷水一区二区三区| 欧美视频一区二区在线观看| 亚洲桃色在线一区| 成人一区二区三区| 2020国产成人综合网| 老鸭窝一区二区久久精品| 欧美日韩aaaaaa| 一区二区三区日本| 一本大道久久a久久综合婷婷| 国产精品五月天| 国产v综合v亚洲欧| 国产亚洲一区字幕| 国产传媒久久文化传媒| 久久午夜色播影院免费高清| 久久99国产精品久久| 日韩美女在线视频| 精品一区二区三区在线播放视频 | 亚洲最大色网站| av高清不卡在线| 国产精品视频在线看| 国产精品中文欧美| 久久久久久免费网| 国产高清不卡一区| 欧美国产精品一区二区三区| 国产精品1区二区.| 国产日韩欧美精品在线| 成人妖精视频yjsp地址| 国产精品五月天| 99久久婷婷国产| 亚洲精选视频免费看| 在线一区二区视频| 亚洲超碰精品一区二区| 3751色影院一区二区三区| 日韩电影免费在线| 精品蜜桃在线看| 粉嫩绯色av一区二区在线观看| 日本一区二区成人在线| 99精品视频在线播放观看| 亚洲欧洲国产日本综合| 色老汉av一区二区三区| 亚洲444eee在线观看| 91精品国产日韩91久久久久久| 美女视频免费一区| 欧美激情在线一区二区三区| 91小视频在线| 亚洲一区二区欧美日韩| 欧美一区二区三区系列电影| 久久aⅴ国产欧美74aaa| 国产精品免费视频网站| 在线观看不卡视频| 久久精品噜噜噜成人av农村| 国产女人水真多18毛片18精品视频| a4yy欧美一区二区三区| 午夜精品久久久久久久| 精品福利视频一区二区三区| 国产成a人亚洲| 亚洲综合精品自拍| 欧美本精品男人aⅴ天堂| 不卡一区二区三区四区| 亚洲一二三四区不卡| 久久丝袜美腿综合| 欧美色倩网站大全免费| 久久国产精品色|