亚洲欧美第一页_禁久久精品乱码_粉嫩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| 国内精品视频一区二区三区八戒| 成人sese在线| 精品99一区二区三区| 亚洲精品视频在线| 成人一区二区三区视频| 日韩一级片网站| 亚洲色图制服诱惑 | 国产精品自拍av| 欧美日韩一二三区| 亚洲精品在线观看网站| 日韩国产在线观看一区| 色狠狠色噜噜噜综合网| 国产精品久久久99| 大白屁股一区二区视频| 日韩欧美区一区二| 免费人成在线不卡| 91精品国产欧美一区二区18| 亚洲最新在线观看| 色一情一乱一乱一91av| 国产精品日韩精品欧美在线| 国产在线精品一区在线观看麻豆| 制服丝袜成人动漫| 免费精品视频在线| 日韩网站在线看片你懂的| 天天色天天爱天天射综合| 欧洲一区在线电影| 亚洲综合色网站| 色婷婷久久久亚洲一区二区三区| 中文字幕日韩av资源站| 成人毛片视频在线观看| 国产精品久久久久久久久久久免费看| 国产精品99精品久久免费| 久久精品人人做人人综合| 国产自产v一区二区三区c| 久久九九久久九九| 福利91精品一区二区三区| 亚洲国产成人午夜在线一区| 成人免费黄色在线| 尤物在线观看一区| 欧美日韩一二三| 九九热在线视频观看这里只有精品| 欧美不卡视频一区| 国产不卡视频在线播放| 国产精品免费看片| 欧美午夜不卡视频| 日韩成人精品在线| 国产性天天综合网| 91麻豆免费观看| 午夜精品视频在线观看| 日韩欧美国产午夜精品| 国产一区二区三区免费在线观看 | 亚洲欧美视频一区| 欧美色精品天天在线观看视频| 日韩高清不卡在线| 久久影院午夜论| 色婷婷久久久久swag精品| 亚洲第一主播视频| www激情久久| 色综合天天综合在线视频| 亚洲mv在线观看| 国产色一区二区| 欧美日韩免费电影| 国产成人免费视频一区| 亚洲国产精品久久一线不卡| 久久久久久久久久久久久久久99| 91在线丨porny丨国产| 日韩综合小视频| 国产精品久久久久三级| 在线播放中文一区| 不卡av免费在线观看| 蜜臀av性久久久久av蜜臀妖精 | 亚洲成人在线观看视频| 久久免费精品国产久精品久久久久 | 亚州成人在线电影| 国产日韩欧美一区二区三区综合| 91久久线看在观草草青青| 久久精品久久精品| 亚洲国产精品一区二区久久| 欧美国产一区视频在线观看| 欧美一区永久视频免费观看| av中文字幕不卡| 麻豆91免费观看| 亚洲制服欧美中文字幕中文字幕| 久久精品视频在线免费观看| 欧美一区二区三区男人的天堂| 97久久人人超碰| 丁香桃色午夜亚洲一区二区三区| 午夜视频一区在线观看| 自拍偷拍国产亚洲| 国产精品青草综合久久久久99| 精品久久久久久久久久久久包黑料 | 美女高潮久久久| 亚洲一区二区黄色| 综合久久给合久久狠狠狠97色 | 日韩欧美123| 欧美日韩一区二区在线观看视频| 不卡av在线免费观看| 国产另类ts人妖一区二区| 久久av老司机精品网站导航| 污片在线观看一区二区| 亚洲超碰精品一区二区| 亚洲一区二区视频| 亚洲一区视频在线观看视频| 亚洲美女视频一区| 亚洲私人影院在线观看| 中文字幕一区二区三区四区不卡 | 秋霞电影一区二区| 三级在线观看一区二区| 天使萌一区二区三区免费观看| 一区二区三区不卡视频| 国产精品二三区| 中文字幕视频一区二区三区久| 国产精品色哟哟网站| 中文字幕日本不卡| 一区二区三区四区视频精品免费| 亚洲免费资源在线播放| 亚洲欧美欧美一区二区三区| 亚洲欧美日韩久久| 亚洲国产日韩av| 天天做天天摸天天爽国产一区 | 精品欧美一区二区在线观看| 欧美一区二区三区在线观看视频| 欧美一区二区在线观看| 日韩欧美自拍偷拍| 久久综合久久综合久久综合| 国产日韩欧美一区二区三区乱码| 国产精品久久久久一区二区三区共| 国产精品美女一区二区三区| 亚洲黄色免费电影| 青青草成人在线观看| 国产一区91精品张津瑜| kk眼镜猥琐国模调教系列一区二区| 91女厕偷拍女厕偷拍高清| 欧美日韩久久久| 精品国产网站在线观看| 国产精品美女www爽爽爽| 亚洲综合色噜噜狠狠| 麻豆国产欧美一区二区三区| 国产成人午夜精品5599| 91黄视频在线观看| 日韩欧美一级特黄在线播放| 国产视频一区在线播放| 一区二区免费在线播放| 久草精品在线观看| 色婷婷综合五月| 精品av综合导航| 亚洲精品日韩综合观看成人91| 青青青爽久久午夜综合久久午夜| 国产一区二区美女| 欧美影片第一页| 国产亚洲制服色| 亚洲地区一二三色| 成人综合婷婷国产精品久久免费| 欧美视频在线观看一区二区| 精品国产免费视频| 亚洲国产综合91精品麻豆| 国产乱妇无码大片在线观看| 欧美日韩在线亚洲一区蜜芽| 久久综合精品国产一区二区三区| 一区二区激情视频| 国产成人av电影免费在线观看| 欧美中文字幕一区二区三区亚洲| 久久久久久久电影| 亚洲aaa精品| 91在线国产福利| 久久久午夜电影| 蜜臀久久久99精品久久久久久| 一本色道久久综合亚洲91| 国产欧美日韩精品在线| 日本在线观看不卡视频| 日本精品裸体写真集在线观看 | 成人毛片老司机大片| 日韩美女一区二区三区四区| 亚洲成人www| 91传媒视频在线播放| 亚洲国产精品精华液ab| 国产在线麻豆精品观看| 欧美一区二区三区在线| 一区二区三区 在线观看视频| 风间由美性色一区二区三区| 日韩欧美精品三级| 日韩电影免费在线看| 欧美久久高跟鞋激| 一区二区三区在线看| 91在线精品一区二区| 国产精品久久国产精麻豆99网站| 国产精品99久久久久久似苏梦涵 | 国产在线看一区| 精品久久国产97色综合| 美脚の诱脚舐め脚责91| 9191久久久久久久久久久| 性感美女极品91精品| 欧美中文字幕久久| 一区二区三区.www| 欧美精品乱码久久久久久| 亚洲成av人片观看| 日韩一区二区三区免费看| 蓝色福利精品导航|