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

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

?? scoreboarddlg.cpp

?? 用VC實現的模擬指令發射流程的計分排算法實現
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
	floatreg[2].fi="F2";floatreg[2].num=2;
	floatreg[3].fi="F3";floatreg[3].num=3; 
	floatreg[4].fi="F4";floatreg[4].num=4; 
	floatreg[5].fi="F5";floatreg[5].num=5;
	floatreg[6].fi="F6";floatreg[6].num=6; 
	floatreg[7].fi="F7";floatreg[7].num=7; 
	
	

}

int CScoreboardDlg::get_fu_number(char *str)//str point to the instruction's op field
{
	int num=-1;
	for(int i=0;i<Num_instr_set;i++){
		if( !strcmp(str,code[i]) )
			break;
	}
	switch (i)
	{
	case 0: num=Int;
		break;
	case 1: num=Mult;
		break;
	case 2:
	case 3:	num=Addd;
		break;
	case 4: num=Divd;
		break;
	default:  num=Null;	
		break;
	}
	return num; 
}



//run
int CScoreboardDlg::get_next_instr(int stadge,int fu=Null)
{
	for(int i=0;i<Num_Instruc;i++){
		if( (instruction[i].stage==stadge)&&((fu==Null)||(get_fu_number(instruction[i].op)==fu)))
			return i;
	}
		return -1;
}

int CScoreboardDlg::get_register_number(char * str)//str point to the register name 
{
	if(!strcmp(str,"\0"))
		return Num_Floatreg;
	for(int i=0;i<Num_Floatreg;i++){
		if(!strcmp(str,floatreg[i].fi))
			return i;
	}
	return -1;
}

bool CScoreboardDlg::available(char * dest)// Destination register
{
	bool flag=true;
	for (int i=0;i<Num_FU;i++){//for
//		if( (statustable[i].fj)&&(statustable[i].fk) ){// if one
		if(statustable[i].fj){
			if( !strcmp(dest,statustable[i].fj) ){// if two
				if( statustable[i].rj ){
					flag=false;
				    break;
				}
			}// if two 
		}
		if(statustable[i].fk){
			if( !strcmp(dest,statustable[i].fk) ){//if three
				if(statustable[i].rk){
					flag=false;
					break;
				}
			}//if three
		}
//		}// if one
	}//for
	return flag;
}



void CScoreboardDlg::issue(void)
{
	int fuc_unit; //to indicate the fuction unit
	int index_instr;
	int index_reg;
	int i=0;
	
	CString str;
	char *dis=new char[5];	
	//attain current instruction
	if( ( index_instr=get_next_instr(BEG,Null)) !=-1) {//if one
		fuc_unit=get_fu_number(instruction[index_instr].op);//atteach the fu and register number which will be used
		index_reg=get_register_number(instruction[index_instr].dest);//determine wheather the fu is busy and the dest register is available
		if( (statustable[fuc_unit].busy==false) && (resulttable[index_reg]==-1)  ){
	    
			m_instatus.InsertItem(index_instr,::itoa(0,dis,10));
			m_instatus.SetItemText(index_instr,0,::itoa(index_instr,dis,10));
            m_instatus.SetItemText(index_instr,1,::itoa(clockcnt,dis,10));
			statustable[fuc_unit].busy=true;
			statustable[fuc_unit].op=instruction[index_instr].op;
			statustable[fuc_unit].fi=instruction[index_instr].dest;
			statustable[fuc_unit].fj=instruction[index_instr].sour1;
			statustable[fuc_unit].fk=instruction[index_instr].sour2;
			statustable[fuc_unit].qj=resulttable[ get_register_number( instruction[index_instr].sour1 ) ];
			statustable[fuc_unit].qk=resulttable[ get_register_number( instruction[index_instr].sour2 ) ];
			statustable[fuc_unit].rj=(resulttable[ get_register_number( instruction[index_instr].sour1 ) ]==-1);
			statustable[fuc_unit].rk=(resulttable[ get_register_number( instruction[index_instr].sour2 ) ]==-1);
			resulttable[index_reg]=fuc_unit;
			instruction[index_instr].stage=IS;
			instruction[index_instr].lasttime=clockcnt;
		}
	}
	
}

//bool read=false;

void CScoreboardDlg::readop(void)
{
	int fuc_unit; //to indicate the fuction unit
	int index_instr;
		if( (index_instr=get_next_instr(IS,Null))!=-1 ){//there is still instruction to be processed
			fuc_unit=get_fu_number(instruction[index_instr].op);
			if( (instruction[index_instr].stage==IS)&&statustable[fuc_unit].rj&&
				statustable[fuc_unit].rk ){
				if(instruction[index_instr].lasttime!=clockcnt){
					//m_list_ps.SetItemText(index_instr,clockcnt,"RO");	
					m_instatus.SetItemText(index_instr,2,::itoa(clockcnt,clock1,10));
					statustable[fuc_unit].rj=false;
					statustable[fuc_unit].rk=false;
					statustable[fuc_unit].qj=-1;
					statustable[fuc_unit].qk=-1;
					instruction[index_instr].stage=RO;
					instruction[index_instr].lasttime=clockcnt;
				}
			}
		}	

}

void CScoreboardDlg::execuse_int()
{
	int fuc_unit; //to indicate the fuction unit
	int index_instr;
		if( ( (index_instr=get_next_instr(RO,Int))!=-1) && 
			( (fuc_unit=get_fu_number(instruction[index_instr].op))==Int)){
			if(instruction[index_instr].lasttime!=clockcnt){
				//m_list_ps.SetItemText(index_instr,clockcnt,"EX_INT");
				
				if((--instruction[index_instr].exe_time==0)){
				m_instatus.SetItemText(index_instr,3,::itoa(clockcnt,clock1,10));				
				printf("instruction  has be excused:\t%s,%s,%s,%s cost 1 clocktime\t\n\n",instruction[index_instr].op,instruction[index_instr].dest,instruction[index_instr].sour1,instruction[index_instr].sour2);
				instruction[index_instr].stage=EX;
				instruction[index_instr].lasttime=clockcnt;
			}
			}
		}
}

void CScoreboardDlg::execuse_addd()
{
	int fuc_unit; //to indicate the fuction unit
	int index_instr;
		if( ( (index_instr=get_next_instr(RO,Addd))!=-1) && 
			( (fuc_unit=get_fu_number(instruction[index_instr].op))==Addd)){
			if(instruction[index_instr].lasttime!=clockcnt){
				//m_list_ps.SetItemText(index_instr,clockcnt,"EX_ADD");
				
				if((--instruction[index_instr].exe_time==0)){
					m_instatus.SetItemText(index_instr,3,::itoa(clockcnt,clock1,10));				
					instruction[index_instr].stage=EX;
					instruction[index_instr].lasttime=clockcnt;
				}
			}
		}
}

void CScoreboardDlg::execuse_mult()
{
	int fuc_unit; //to indicate the fuction unit
	int index_instr;
		if( ( (index_instr=get_next_instr(RO,Mult))!=-1) && 
			( (fuc_unit=get_fu_number(instruction[index_instr].op))==Mult)){
			if(instruction[index_instr].lasttime!=clockcnt){
				//m_list_ps.SetItemText(index_instr,clockcnt,"EX_MUL");
				
				if((--instruction[index_instr].exe_time==0)){
				m_instatus.SetItemText(index_instr,3,::itoa(clockcnt,clock1,10));
				printf("instruction  has  be excused:\t%s,%s,%s,%s cost 10 clocktime\t\n\n",instruction[index_instr].op,instruction[index_instr].dest,instruction[index_instr].sour1,instruction[index_instr].sour2);
				instruction[index_instr].stage=EX;
				instruction[index_instr].lasttime=clockcnt;
				}
			}
		}
}

void CScoreboardDlg::execuse_divd()
{
	int fuc_unit; //to indicate the fuction unit
	int index_instr;
	if( ( (index_instr=get_next_instr(RO,Divd))!=-1) && 
			( (fuc_unit=get_fu_number(instruction[index_instr].op))==Divd)){
			if(instruction[index_instr].lasttime!=clockcnt){
				//m_list_ps.SetItemText(index_instr,clockcnt,"EX_DIV");
                
				if((--instruction[index_instr].exe_time==0)){
				m_instatus.SetItemText(index_instr,3,::itoa(clockcnt,clock1,10));
				printf("instruction  has  be excused:\t%s,%s,%s,%s cost 40 clocktime\t\n\n",instruction[index_instr].op,instruction[index_instr].dest,instruction[index_instr].sour1,instruction[index_instr].sour2);
				instruction[index_instr].stage=EX;
                instruction[index_instr].lasttime=clockcnt;
				}
			}
		}
}


void CScoreboardDlg::writback(void)
{
	//to indicate the current FU REGISTER INSTRUCTION
	int fuc_unit; 
	int index_instr;
	int index_reg;
	if ( (index_instr=get_next_instr(EX,Null))!=-1 ){//if_one
			fuc_unit=get_fu_number(instruction[index_instr].op);
			index_reg=get_register_number(instruction[index_instr].dest);
			if ( available(instruction[index_instr].dest) ){//if_two
				if(instruction[index_instr].lasttime!=clockcnt){//if_three
					
					resulttable[index_reg]=-1;
					for(int i=0;i<Num_FU;i++){
						if(statustable[i].qj==fuc_unit){
							statustable[i].qj=-1;
							statustable[i].rj=true;
						}
						if(statustable[i].qk==fuc_unit){
							statustable[i].qk=-1;
							statustable[i].rk=true;
						}
					}			
					//m_list_ps.SetItemText(index_instr,clockcnt,"WB");
                    m_instatus.SetItemText(index_instr,4,::itoa(clockcnt,clock1,10));
					statustable[fuc_unit].busy=false;
					statustable[fuc_unit].op=NULL;
					statustable[fuc_unit].fi=NULL;
					statustable[fuc_unit].fj=NULL;
					statustable[fuc_unit].fk=NULL;
					statustable[fuc_unit].qj=-1;
					statustable[fuc_unit].qk=-1;
					statustable[fuc_unit].rj=true;
					statustable[fuc_unit].rk=true;	
					instruction[index_instr].stage=WB;
					instruction[index_instr].lasttime=clockcnt;

				}//if_three
			}//if_tow
	}//if_one
}


void CScoreboardDlg::updatelist()
{
	CString str="\0";
	char* dis=new char[5];
	int fu;
	for(int j=0;j<Num_FU;j++)
	{
		if(statustable[j].op!=NULL){
			fu=get_fu_number(statustable[j].op);

			m_function.SetItemText(fu,2,statustable[j].op);
			if(statustable[j].busy)
				str="Yes";
			else
				str="No";
			m_function.SetItemText(fu,1,str);
			m_function.SetItemText(fu,3,_T(statustable[j].fi));
			m_function.SetItemText(fu,4,_T(statustable[j].fj));
			m_function.SetItemText(fu,5,_T(statustable[j].fk));
			switch(statustable[j].qj)
			{
			case -1:str=" ";
				break;
			case Int:str="Int";
				break;
			case Addd:str="Addd";
				break;
			case Mult:str="Mult";
				break;
			case Divd:str="Divd";
				break;
			}
			m_function.SetItemText(fu,6,_T(str));

			switch(statustable[j].qk)
			{
			case -1:str=" ";
				break;
			case Int:str="Int";
				break;
			case Addd:str="Addd";
				break;
			case Mult:str="Mult";
				break;
			case Divd:str="Divd";
				break;
			}
			m_function.SetItemText(fu,7,_T(str));

			if(statustable[j].rj)
				str="Yes";
			else
				str="no";
			m_function.SetItemText(fu,8,_T(str));

			if(statustable[j].rk)
				str="Yes";
			else
				str="no";
			m_function.SetItemText(fu,9,_T(str));
		}else{//for if
		m_function.SetItemText(j,1,"no");
		m_function.SetItemText(j,2," ");
		m_function.SetItemText(j,3," ");
		m_function.SetItemText(j,4," ");
		m_function.SetItemText(j,5," ");
	}//if
	}//for
	for(j=0;j<Num_Floatreg+1;j++){
		str.Format("%d",resulttable[j]);
		m_register.SetItemText(0,j,_T(str));
	}

	for(j=0;j<Num_Instruc;j++){	
		switch(instruction[j].stage){
		case BEG:	str="BEG";
			break;
		case IS:	str="IS";
			break;
		case RO:	str="RO";
			break;
		case EX:	str="EX";
			break;
		case WB:	str="WB";
			break;
		//case EXE:	str="EXED";
			//break;
		}
		//m_instruction.SetItemText(j,4,_T(str));
	}
		
}


void CScoreboardDlg::runauto()
{
	char *dis=new char[5];
	CString str;
	str.Format("%d",clockcnt);
	//m_instatus.InsertColumn(clockcnt,str,LVCFMT_LEFT,50);
	
	m_clock=++clockcnt;
	issue();
	readop();
	execuse_int();
	execuse_addd();	
	execuse_mult();	
	execuse_divd();	
	writback();
	updatelist();
	UpdateData(FALSE);
    bool finished=testfinished();
	if(finished==true){
			KillTimer(1);
			MessageBox("All instructions have been finished?。。?quot;,"Finished",MB_OK|MB_ICONWARNING);
	}
   //CScoreboardDlg::runauto();
	else CScoreboardDlg::runauto();
	/*for(int k=1000000;k>0;k--)
		for(int j=1000000;j>0;j--)
			
		{
			{;}
		}*/
		

}



void CScoreboardDlg::steprun()
{
	char *dis=new char[5];
    stepinto=true;
	stepflag=true;
	CString str;
	if(stepflag){
		str.Format("%d",clockcnt);
		//m_list_ps.InsertColumn(clockcnt,str,LVCFMT_LEFT,50);
		m_clock=clockcnt++;
		issue();
		readop();
		execuse_int();
		execuse_addd();	
		execuse_mult();	
		execuse_divd();	
		writback();
		updatelist();
		
		UpdateData(FALSE);
		stepflag=false;
	}
    bool finished=testfinished();
	if(finished==true){
			KillTimer(1);
			MessageBox("All instructions have been finished?。?!","Finished",MB_OK|MB_ICONWARNING);
	}
  // CScoreboardDlg::steprun();
}



void CScoreboardDlg::OnSetsystem() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
}


void CScoreboardDlg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
}

void CScoreboardDlg::OnMenuitem32775() 
{
	// TODO: Add your command handler code here
	m_instruction.DeleteAllItems();
	m_instatus.DeleteAllItems();
	clockcnt=0;
	m_clock=0;UpdateData(FALSE);
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
**欧美大码日韩| 欧美二区三区91| 日韩综合小视频| 综合久久国产九一剧情麻豆| 国产精品热久久久久夜色精品三区| 91精品国产色综合久久不卡电影| 欧美日韩精品专区| 欧美日本精品一区二区三区| 欧美综合天天夜夜久久| 欧美一区二区三区四区高清| 一本色道a无线码一区v| 欧洲人成人精品| 777午夜精品视频在线播放| 欧美一卡二卡三卡| 久久综合色鬼综合色| 久久综合五月天婷婷伊人| 国产日韩成人精品| 国产精品国产自产拍高清av王其 | 亚洲男人的天堂av| 亚洲综合成人网| 最新高清无码专区| 亚洲一区在线看| 韩国精品一区二区| 色国产精品一区在线观看| 欧美丰满一区二区免费视频| 久久久精品天堂| 一区二区三区欧美| 奇米精品一区二区三区四区| 东方欧美亚洲色图在线| 精品视频1区2区| 久久精品亚洲国产奇米99| 亚洲一级二级在线| 国产成人精品免费网站| 欧美日韩午夜影院| 精品日韩在线一区| 亚洲精品国产高清久久伦理二区| 免费高清在线一区| 日本韩国欧美在线| 久久久久久久精| 欧美aaaaa成人免费观看视频| 国产成人在线色| 欧美mv日韩mv国产网站app| 亚洲一区二区三区国产| www.66久久| 中文字幕巨乱亚洲| 国产精品资源在线看| 91精品国产综合久久精品麻豆 | 亚洲男同性视频| 国产成人免费视频一区| 久久精品一区二区三区不卡 | 色屁屁一区二区| 国产精品久久久久久久久久久免费看| 蜜桃av一区二区三区| 欧美三级电影一区| 香蕉av福利精品导航| 欧美影院午夜播放| 五月天亚洲婷婷| 制服视频三区第一页精品| 午夜精品影院在线观看| 欧美日韩一级片在线观看| 亚洲风情在线资源站| 欧美日韩国产精选| 亚洲bt欧美bt精品777| 在线电影一区二区三区| 蜜桃视频在线观看一区| 久久精品一区蜜桃臀影院| 日韩av中文字幕一区二区三区| 一本色道久久综合狠狠躁的推荐| 亚洲一区在线免费观看| 欧美一区二区三区白人| 国产精品一区一区三区| 中文字幕av资源一区| 91精品1区2区| 精品中文字幕一区二区小辣椒| 日本一区二区综合亚洲| 色成人在线视频| 久久草av在线| 一区二区三区蜜桃| 在线不卡中文字幕播放| 国产一区二区三区视频在线播放| 国产精品区一区二区三区| 欧美日韩精品欧美日韩精品| 国产在线视频不卡二| 中文字幕不卡在线观看| 色www精品视频在线观看| 日本午夜精品一区二区三区电影| 911精品产国品一二三产区| 国产精品亚洲一区二区三区妖精| 日韩一区欧美一区| 国产色一区二区| 日韩一区二区在线免费观看| 成人黄色小视频| 亚洲风情在线资源站| 国产精品欧美综合在线| 日韩一级片网址| 欧美视频一区二区三区四区| 国产丶欧美丶日本不卡视频| 图片区小说区区亚洲影院| 亚洲免费观看在线视频| 久久久久久久久久久久久夜| 欧美午夜精品电影| 成人av电影免费在线播放| 日韩国产欧美视频| 亚洲国产成人精品视频| 亚洲国产精品久久一线不卡| 亚洲综合网站在线观看| 亚洲成人av中文| 奇米影视在线99精品| 麻豆精品视频在线观看视频| 国产成人免费视频网站| 91亚洲国产成人精品一区二区三 | 在线观看日韩一区| 91精品国产综合久久久久久久 | 亚洲资源在线观看| 欧美96一区二区免费视频| 麻豆91精品91久久久的内涵| 久久66热偷产精品| www.亚洲国产| 91 com成人网| 国产精品你懂的在线| 亚洲国产综合人成综合网站| 久久 天天综合| 97久久超碰国产精品| 欧美xxxxx裸体时装秀| 国产精品卡一卡二| 舔着乳尖日韩一区| 粉嫩av一区二区三区在线播放| 欧美自拍偷拍一区| 国产偷国产偷亚洲高清人白洁| 一区二区三区精品| 成人综合在线网站| 欧美一级理论片| 亚洲综合久久久| 99re这里只有精品6| 久久久久久电影| 国产在线精品一区二区三区不卡 | 一区二区三区免费看视频| 91福利在线导航| 亚洲欧美日韩一区| 在线观看欧美精品| 日韩主播视频在线| 精品日韩成人av| 另类小说欧美激情| 在线精品视频小说1| 中文字幕中文字幕在线一区| 国产成人免费在线观看| 精品国产a毛片| 毛片基地黄久久久久久天堂| 日韩欧美亚洲国产另类| 久久精品99国产精品| 久久综合九色综合久久久精品综合| 久久精品在这里| 国产在线视频一区二区三区| 日韩亚洲欧美在线| 精品午夜一区二区三区在线观看 | 欧美性xxxxx极品少妇| 一区二区三区四区视频精品免费 | 制服丝袜激情欧洲亚洲| 青青草原综合久久大伊人精品优势| 欧美日韩免费一区二区三区视频| 亚洲国产精品一区二区www| 日韩亚洲欧美中文三级| 午夜不卡av在线| 成人av综合一区| 欧美中文字幕一区| 国产精品久久久久久户外露出| 亚洲宅男天堂在线观看无病毒| 国产91富婆露脸刺激对白 | 欧美一区二区三区在线| 亚洲图片有声小说| 欧美精品乱人伦久久久久久| 免费看日韩精品| 国产日韩欧美在线一区| 91天堂素人约啪| 麻豆91免费观看| 亚洲视频电影在线| 91精品国产aⅴ一区二区| 国产.精品.日韩.另类.中文.在线.播放| 久久久久97国产精华液好用吗| 亚洲国产精品尤物yw在线观看| 精品国产一区二区亚洲人成毛片| 99re成人精品视频| 精品一区二区在线视频| 亚洲男同性恋视频| 欧美激情综合网| 欧美欧美午夜aⅴ在线观看| 成人免费视频网站在线观看| 亚洲国产精品久久不卡毛片| 国产亚洲一区二区三区| 宅男在线国产精品| 在线亚洲一区二区| 国产成人亚洲综合a∨猫咪| 秋霞影院一区二区| 一区二区三区在线视频免费 | 国产精品系列在线播放| 日韩中文字幕一区二区三区| 亚洲色图20p| 亚洲视频在线观看一区| 欧美激情在线一区二区| 亚洲精品一线二线三线无人区|