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

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

?? bpred.cc

?? linux下基于c++的處理器仿真平臺。具有處理器流水線
?? CC
?? 第 1 頁 / 共 3 頁
字號:
/* * bpred.cc - branch predictor 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 * */#include <cassert>#include <cmath>#include <string>#include "base/cprintf.hh"#include "base/misc.hh"#include "base/statistics.hh"#include "cpu/smt.hh"#include "encumbered/cpu/full/bpred.hh"#include "encumbered/cpu/full/cpu.hh"#include "sim/builder.hh"#include "sim/host.hh"#include "sim/stats.hh"using namespace std;#define NBIT_MASK(n)		((1 << (n)) - 1)#define IS_POWER_OF_TWO(n)	(((n) & ((n) - 1)) == 0)#define BP_VERBOSE 0/* * Is two-bit counter value strongly biased? */#define TWOBIT_STRONG(x)	((x) == 0 || (x) == 3)/* * Do  two-bit counter values agree? */#define TWOBIT_AGREE(x,y)	(((x) >= 2) == ((y) >= 2))//// This should be stuck into the BranchPred structure, but I'm not// quite sure what it's for... (other than something// confidence-related)static int conf_table[64];// branch predictor constructorBranchPred::BranchPred(const string &_name,		       BPredClass _bp_class, // type of predictor		       unsigned int _global_hist_bits,		       unsigned int _global_pred_index_bits,		       bool _global_xor,		       unsigned int _num_local_hist_regs,		       unsigned int _local_hist_bits,		       unsigned int _local_pred_index_bits,		       bool _local_xor,		       unsigned int _meta_pred_index_bits,		       bool _meta_xor,		       unsigned int btb_sets,  // number of sets in BTB		       unsigned int btb_assoc, // BTB associativity		       unsigned int _ras_size,  // num entries in RAS		       bool _conf_pred_enable,		       unsigned int _conf_pred_index_bits,		       unsigned int _conf_pred_ctr_bits,		       int _conf_pred_ctr_thresh,		       bool _conf_pred_xor,		       ConfCounterType _conf_pred_ctr_type)    : SimObject(_name),      cpu(NULL),	// initialized later via setCPU()      bp_class(_bp_class),      global_hist_bits(_global_hist_bits),      global_pred_table(NULL),      global_pred_index_bits(_global_pred_index_bits),      global_xor(_global_xor),      num_local_hist_regs(_num_local_hist_regs),      local_hist_bits(_local_hist_bits),      local_pred_table(NULL),      local_pred_index_bits(_local_pred_index_bits),      local_xor(_local_xor),      meta_pred_table(NULL),      meta_pred_index_bits(_meta_pred_index_bits),      meta_xor(_meta_xor),      ras_size(_ras_size),      conf_pred_enable(_conf_pred_enable),      conf_pred_index_bits(_conf_pred_index_bits),      conf_pred_ctr_bits(_conf_pred_ctr_bits),      conf_pred_ctr_thresh(_conf_pred_ctr_thresh),      conf_pred_xor(_conf_pred_xor),      conf_pred_ctr_type(_conf_pred_ctr_type){    int i;    if (conf_pred_ctr_thresh == -1) {	/* static confidence assignment: high confidence iff both	 * predictors strong & agree.  conf_table is 1 for high confidence.	 * index value is meta|local|global (2 bits each). */	for (i = 0; i < 64; i++) {	    int local = (i >> 2) & 3;	    int global = i & 0x3;	    conf_table[i] = (local == global) && TWOBIT_STRONG(local);	}    } else if (conf_pred_ctr_thresh == -2) {	/* static confidence assignment: high confidence iff both	 * predictors strong & agree OR meta strong, prediction indicated by	 * meta is strong, other prediction agrees (maybe only weakly) */	for (i = 0; i < 64; i++) {	    int meta = (i >> 4) & 3;	    int local = (i >> 2) & 3;	    int global = i & 0x3;	    conf_table[i] = ((local == global) &&TWOBIT_STRONG(local))		|| (TWOBIT_STRONG(meta)		    && ((meta >= 2) ? TWOBIT_STRONG(local) :			TWOBIT_STRONG(global))		    && TWOBIT_AGREE(local, global));	}    } else if (conf_pred_ctr_thresh >= 0) {	/* dynamic counters determine confidence: initialize them */	for (i = 0; i < 64; i++)	    conf_table[i] = (1 << conf_pred_ctr_bits) - 1;    } else	panic("conf_pred_ctr_thresh is negative!\n");    if (bp_class == BPredComb || bp_class == BPredGlobal) {	/* allocate global predictor */	unsigned pred_table_size = 1 << global_pred_index_bits;	global_pred_table = new uint8_t[pred_table_size];	/* initialize history regs (for repeatable results) */	for (i = 0; i < SMT_MAX_THREADS; ++i)	    global_hist_reg[i] = 0;	/* initialize to weakly taken (not that it matters much) */	for (i = 0; i < pred_table_size; ++i)	    global_pred_table[i] = 2;	// confidence predictor only works with COMB or GLOBAL predictor types	if (conf_pred_enable) {	    conf_pred_table = new uint8_t[1 << conf_pred_index_bits];	    for (i = 0; i < (1 << conf_pred_index_bits); ++i)		conf_pred_table[i] = 0;	    if (conf_pred_ctr_bits > 8)		fatal("bpred_create: confidence counter has max of 8 bits");	    if (conf_pred_ctr_thresh >= (1 << conf_pred_ctr_bits))		fatal("bpred_create: confidence threshold has max value of %d",		      (1 << conf_pred_ctr_bits));	} else	  conf_pred_table = 0;    } else {	// no global predictor: config incompatible with confidence predictor	if (conf_pred_enable)	    fatal("confidence predictor only works with hybrid or global "		  "branch predictor types");    }    if (bp_class == BPredComb || bp_class == BPredLocal) {	/* allocate local predictor */	unsigned pred_table_size = 1 << local_pred_index_bits;	local_pred_table = new uint8_t[pred_table_size];	if (!IS_POWER_OF_TWO(num_local_hist_regs))	    fatal("number of local history regs must be a power of two");	local_hist_regs = new unsigned int[num_local_hist_regs];	/* initialize history registers */	for (i = 0; i < num_local_hist_regs; ++i)	    local_hist_regs[i] = 0;	/* initialize to weakly taken (not that it matters much) */	for (i = 0; i < pred_table_size; ++i)	    local_pred_table[i] = 2;    }    if (bp_class == BPredComb) {	/* allocate meta predictor */	unsigned pred_table_size = 1 << meta_pred_index_bits;	meta_pred_table = new uint8_t[pred_table_size];	/* initialize to weakly favor global (not that it matters much) */	for (i = 0; i < pred_table_size; ++i)	    meta_pred_table[i] = 1;    }    /* allocate BTB */    if (!btb_sets || !IS_POWER_OF_TWO(btb_sets))	fatal("number of BTB sets must be non-zero and a power of two");    if (!btb_assoc || !IS_POWER_OF_TWO(btb_assoc))	fatal("BTB associativity must be non-zero and a power of two");    btb.btb_data = new BTBEntry[btb_sets * btb_assoc];    btb.sets = btb_sets;    btb.assoc = btb_assoc;    /* initialize BTB entries (for repeatable results) */    for (i = 0; i < (btb.assoc * btb.sets); i++) {	btb.btb_data[i].addr = btb.btb_data[i].target = 0;	btb.btb_data[i].next = btb.btb_data[i].prev = 0;    }    /* if BTB is set-associative, initialize per-set LRU chains */    if (btb.assoc > 1) {	for (i = 0; i < (btb.assoc * btb.sets); i++) {	    if (i % btb.assoc != btb.assoc - 1)		btb.btb_data[i].next = &btb.btb_data[i + 1];	    else		btb.btb_data[i].next = NULL;	    if (i % btb.assoc != btb.assoc - 1)		btb.btb_data[i + 1].prev = &btb.btb_data[i];	}    }    /* allocate return-address stack */    if (!IS_POWER_OF_TWO(ras_size))	fatal("Return-address-stack size must be zero or a power of two");    if (ras_size) {	for (i = 0; i < SMT_MAX_THREADS; i++) {	    retAddrStack[i].stack = new Addr[ras_size];	    // clear stack entries (for repeatable results)	    for (int j = 0; j < ras_size; ++j)		retAddrStack[i].stack[j] = 0;	    retAddrStack[i].tos = ras_size - 1;	}    }}voidBranchPred::regStats( ){    using namespace Stats;    lookups	.init(cpu->number_of_threads)	.name(name() + ".lookups")	.desc("num BP lookups")	.flags(total)	;    cond_predicted	.init(cpu->number_of_threads)	.name(name() + ".cond_predicted")	.desc("num committed conditional branches")	.flags(total)	;    cond_correct	.init(cpu->number_of_threads)	.name(name() + ".cond_correct")	.desc("num correct dir predictions")	.flags(total)	;    btb_lookups	.init(cpu->number_of_threads)	.name(name() + ".btb_lookups")	.desc("Number of BTB lookups")	.flags(total)	;    btb_hits	.init(cpu->number_of_threads)	.name(name() + ".btb_hits")	.desc("Number of BTB hits")	.flags(total)	;    used_btb	.init(cpu->number_of_threads)	.name(name() + ".used_btb")	.desc("num committed branches using target from BTB")	.flags(total)	;    btb_correct	.init(cpu->number_of_threads)	.name(name() + ".btb_correct")	.desc("num correct BTB predictions")	.flags(total)	;    used_ras	.init(cpu->number_of_threads)	.name(name() + ".used_ras")	.desc("num returns predicted using RAS")	.flags(total)	;    ras_correct	.init(cpu->number_of_threads)	.name(name() + ".ras_correct")	.desc("num correct RAS predictions")	.flags(total)	;    switch (bp_class) {    case BPredComb:	pred_state_table_size = 64;	/* bit patterns */	break;    case BPredGlobal:    case BPredLocal:	pred_state_table_size = 16;	break;    default:	fatal("bad bpred class");    }    for (int i = 0; i < NUM_PRED_STATE_ENTRIES; i++)	pred_state[i].init(pred_state_table_size);    conf_chc.init(cpu->number_of_threads);    conf_clc.init(cpu->number_of_threads);    conf_ihc.init(cpu->number_of_threads);    conf_ilc.init(cpu->number_of_threads);    corr_conf_dist.init(/* base value */ 0,			/* array size - 1*/			(1 << conf_pred_ctr_bits) - 1,			/* bucket size */ 1);    incorr_conf_dist.init(/* base value */ 0,			  /* array size - 1*/			  (1 << conf_pred_ctr_bits) - 1,			  /* bucket size */ 1);    if (conf_pred_enable) {	conf_chc	    .name(name() + ".conf.cor_high")	    .desc("num correct preds with high confidence")	    .flags(total)	    ;	conf_clc	    .name(name() + ".conf.cor_low")	    .desc("num correct preds with low confidence")	    .flags(total)	    ;	conf_ihc	    .name(name() + ".conf.incor_high")	    .desc("num incorrect preds with high confidence")	    .flags(total)	    ;	conf_ilc	    .name(name() + ".conf.incor_low")	    .desc("num incorrect preds with low confidence")	    .flags(total)	    ;	corr_conf_dist	    .name(name() + ".conf.cor.dist")	    .desc("Number of correct predictions for each confidence value")	    .flags(pdf)	    ;	incorr_conf_dist	    .name(name() + ".conf.incor.dist")	    .desc("Number of incorrect predictions for each confidence value")	    .flags(pdf)	    ;    }}voidBranchPred::regFormulas(){    using namespace Stats;    lookup_rate	.name(name() + ".lookup_rate")	.desc("Rate of bpred lookups")	.flags(total)	;    lookup_rate = lookups / cpu->numCycles;    dir_accuracy	.name(name() + ".dir_accuracy")	.desc("fraction of predictions correct")	.flags(total)	;    dir_accuracy = cond_correct / cond_predicted;    btb_hit_rate	.name(name() + ".btb_hit_rate")	.desc("BTB hit ratio")	.flags(total)	;    btb_hit_rate = btb_hits / btb_lookups;    btb_accuracy	.name(name() + ".btb_accuracy")	.desc("fraction of BTB targets correct")	.flags(total)	;    btb_accuracy = btb_correct / used_btb;    ras_accuracy	.name(name() + ".ras_accuracy")	.desc("fraction of RAS targets correct")	.flags(total)	;    ras_accuracy = ras_correct / used_ras;    if (conf_pred_enable) {	conf_sens	    .name(name() + ".conf.sens")	    .desc("Sens: \% correct preds that were HC")	    .precision(4)	    ;	conf_sens = conf_chc / (conf_chc + conf_clc);	conf_pvp	    .name(name() + ".conf.pvp")

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利一区二区三区视频在线 | 亚洲男人的天堂av| 91精品在线一区二区| 91看片淫黄大片一级在线观看| 久久成人免费电影| 极品瑜伽女神91| 免费成人在线视频观看| 日韩av中文字幕一区二区| 五月激情综合色| 日本亚洲天堂网| 日韩av电影天堂| 蜜臀久久久99精品久久久久久| 午夜激情综合网| 日本午夜精品视频在线观看| 视频一区在线播放| 日韩电影在线免费| 久久97超碰色| 国产高清视频一区| 色网综合在线观看| 91国产免费观看| 欧美日韩国产高清一区| 欧美高清www午色夜在线视频| 91精品国产高清一区二区三区| 欧美一区二区三区的| 精品国产髙清在线看国产毛片| 26uuu亚洲| 国产精品亲子乱子伦xxxx裸| 日韩久久一区二区| 午夜精品久久久久久久久| 久久99日本精品| 91污在线观看| 日韩欧美在线影院| 久久久亚洲精品一区二区三区 | 亚洲欧洲精品天堂一级| 亚洲天堂久久久久久久| 亚洲二区视频在线| 国产精品自拍在线| 欧美日韩卡一卡二| 国产亚洲欧美一级| 亚洲国产视频一区二区| 久久99久久久久| 色吊一区二区三区| 亚洲精品一区二区三区影院| 中文字幕日韩一区| 另类综合日韩欧美亚洲| 91在线观看美女| 337p日本欧洲亚洲大胆精品| 亚洲精品亚洲人成人网| 精品制服美女丁香| 一本大道久久a久久精品综合| 日韩欧美一级在线播放| 夜色激情一区二区| 国产91丝袜在线播放九色| 欧美日韩国产综合视频在线观看| 国产日本欧美一区二区| 麻豆成人91精品二区三区| 99在线精品一区二区三区| 精品国产免费人成电影在线观看四季 | 一区二区三区欧美视频| 国产一本一道久久香蕉| 欧美一三区三区四区免费在线看| 亚洲视频一区在线观看| 国产成人在线影院| 精品国产制服丝袜高跟| 亚洲va欧美va国产va天堂影院| 99久久久久久99| 国产目拍亚洲精品99久久精品| 久久国产精品区| 91精品久久久久久蜜臀| 亚洲一区二区黄色| 色婷婷综合激情| 中文字幕日韩一区二区| 成人一区二区三区中文字幕| 欧美精品一区二区三区一线天视频 | 99精品在线观看视频| 国产亚洲午夜高清国产拍精品| 日韩精品免费视频人成| 欧美性色aⅴ视频一区日韩精品| 中文字幕在线观看一区| 成人av动漫在线| 久久综合网色—综合色88| 麻豆中文一区二区| 亚洲精品在线观| 国产伦精品一区二区三区在线观看| 欧美一区二区三级| 奇米色一区二区三区四区| 欧美久久久久久久久久| 日一区二区三区| 日韩视频免费观看高清在线视频| 日韩va欧美va亚洲va久久| 欧美mv日韩mv亚洲| 国产精品一区二区久久不卡 | av在线综合网| 亚洲精品欧美综合四区| 在线日韩一区二区| 亚洲综合一区在线| 欧美精品1区2区3区| 蜜桃av一区二区| 国产午夜亚洲精品午夜鲁丝片| 国产成人亚洲综合色影视| 国产精品久久久久久亚洲伦 | 欧美日产在线观看| 另类小说综合欧美亚洲| 国产午夜一区二区三区| 91视频国产资源| 天堂一区二区在线| 久久综合五月天婷婷伊人| 成人看片黄a免费看在线| 亚洲激情自拍视频| 日韩欧美在线网站| 高清av一区二区| 午夜免费久久看| 久久久九九九九| 欧美无人高清视频在线观看| 久久成人羞羞网站| 亚洲男人都懂的| 日韩精品影音先锋| 91首页免费视频| 国产在线视视频有精品| 亚洲少妇屁股交4| 欧美一级在线视频| 91在线播放网址| 精品一区二区三区久久| 亚洲伦理在线精品| 精品卡一卡二卡三卡四在线| 色婷婷综合久久久久中文一区二区 | 成人一区二区在线观看| 亚洲chinese男男1069| 国产喂奶挤奶一区二区三区| 欧美日韩在线一区二区| 激情六月婷婷久久| 亚洲精品日产精品乱码不卡| 精品国产乱码久久久久久图片 | 欧美一级片在线看| 91色.com| 大美女一区二区三区| 精品影院一区二区久久久| 亚洲午夜在线视频| 国产精品不卡在线观看| 久久久噜噜噜久久中文字幕色伊伊| 欧美日韩精品一二三区| 色综合久久综合网97色综合| 粉嫩av亚洲一区二区图片| 青青草原综合久久大伊人精品 | 无吗不卡中文字幕| 亚洲综合色噜噜狠狠| 中文字幕视频一区| 国产精品丝袜在线| 国产视频一区不卡| 精品久久一二三区| 精品少妇一区二区| 精品少妇一区二区三区视频免付费 | 欧美在线视频你懂得| 91原创在线视频| 91香蕉视频在线| 色婷婷亚洲综合| 欧美在线你懂的| 欧美肥大bbwbbw高潮| 91精品在线观看入口| 欧美久久久一区| 91精品国产一区二区| 日韩网站在线看片你懂的| 日韩欧美不卡一区| 久久久久久97三级| 国产精品视频线看| 亚洲欧美日韩中文字幕一区二区三区 | 国产精品亚洲专一区二区三区| 人人爽香蕉精品| 美女精品一区二区| 国产一区二区三区免费观看| 国产老女人精品毛片久久| 国产一区二区三区电影在线观看| 国产激情视频一区二区在线观看 | 性欧美大战久久久久久久久| 亚洲成a人v欧美综合天堂| 日本一区中文字幕| 国产一区二区三区四| 99视频一区二区| 欧美私人免费视频| 精品美女在线观看| 日韩一区有码在线| 亚洲午夜在线电影| 日韩高清中文字幕一区| 韩国女主播一区| 91欧美激情一区二区三区成人| 在线看国产一区二区| 日韩精品专区在线影院观看| 欧美国产成人在线| 性感美女久久精品| 韩国成人精品a∨在线观看| 国产成人精品aa毛片| av爱爱亚洲一区| 欧美一级一区二区| 亚洲欧洲综合另类在线| 秋霞电影网一区二区| 成人一区在线观看| 91精品国产综合久久福利软件 | 亚洲摸摸操操av| 麻豆国产91在线播放| 色呦呦国产精品|