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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? instructionprefetch.v

?? 若干VHDL語(yǔ)言的源代碼
?? V
字號(hào):
//////////////////////////////////////////////////////////////////
//			the instruction prefetch buffer		//
//Note:the orgnization of the Instruction PreFetche buffer	//
//serious depend on the ASIC library you can obtain from	//
//manufatory,
//i have assume that the cache is 1 cycle delay,if you have the //
//other delay value you must change the fetch instruction 	//
//code 								//
//when the prefetched buffer is missed,the IF pipeline stage	//
//must wait until it fetch instruction back			//
//i assume a 4 word instruction cache line			//
//////////////////////////////////////////////////////////////////

`include "Def_StructureParameter.v"
`include "Def_InstructionPreFetch.v"
`include "Def_InstructionCacheController.v"

module InstructionPreFetch(Instruction,
				Wait,
				Address,
				//above is the fetched instruction go to pipeline
				//below is the prefetched instruction come from cache or memory
				PreFetchedInstructions,
				PreFetchedWait,
				PreFetchedAddress,
				PreFetchedRequest,
				clock,
				reset);

//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//	input and output declaration			//
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
output [`InstructionWidth-1:0] Instruction;
output Wait;
wire [`InstructionWidth-1:0] Instruction;
wire Wait;
input [`AddressBusWidth-1:0] Address;
input clock,reset;

input [`InstructionCacheLineWidth-1:0] PreFetchedInstructions;
input PreFetchedWait;
output [`AddressBusWidth-1:0] PreFetchedAddress;
output PreFetchedRequest;

reg [`AddressBusWidth-1:0] PreFetchedAddress;
reg PreFetchedRequest;
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//		memory of the prefetch buffer		//
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
reg [`InstructionWidth-1:0] Instruction0;
reg [`InstructionWidth-1:0] Instruction1;
reg [`InstructionWidth-1:0] Instruction2;
reg [`InstructionWidth-1:0] Instruction3;
reg [`InstructionWidth-1:0] Instruction4;
reg [`InstructionWidth-1:0] Instruction5;
reg [`InstructionWidth-1:0] Instruction6;
reg [`InstructionWidth-1:0] Instruction7;

//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//	address of the two block prefetch instruction	//
//	they store the address of first instruction 	//
//that is to say:their 3:0 is 4'b0000			//
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
reg [`AddressBusWidth-1:0] Address0;
reg [`AddressBusWidth-1:0] Address1;
reg FirstHalfGot,SecondHalfGot;

//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//		the selected instruction		//
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
reg [`InstructionWidth-1:0] tmpInstruction;

//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//		memory access status			//
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////

reg [`ByteWidth-1:0]  Status;
//store the address of first instruction of the fetched cache block
reg [`AddressBusWidth-1:0] AddressStore;

//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//signal indicate that if i have desire instruction	//
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////

wire NoThisInstruction,ForwardNoThisInstruction;
wire [`AddressBusWidth-1:0] ForwardAddress;

//select out the desire instruction
always @(Instruction0 
	or Instruction1 
	or Instruction2 
	or Instruction3  
	or Instruction4 
	or Instruction5 
	or Instruction6  
	or Instruction7 
	or Address0 
	or Address1 
	or Address)
begin
	//in the first half of cache block
	if(Address[`AddressBusWidth-1:4]==Address0[`AddressBusWidth-1:4])
	begin
		case (Address[3:2])
		2'b00:
			tmpInstruction=Instruction0;
		2'b01:
			tmpInstruction=Instruction1;
		2'b10:
			tmpInstruction=Instruction2;
		2'b11:
			tmpInstruction=Instruction3;
		default: begin tmpInstruction=`InstructionZero; end
		endcase
	end
	//in the second half
	else if(Address[`AddressBusWidth-1:4]==Address1[`AddressBusWidth-1:4])
	begin
		case (Address[3:2])
		2'b00:
			tmpInstruction=Instruction4;
		2'b01:
			tmpInstruction=Instruction5;
		2'b10:
			tmpInstruction=Instruction6;
		2'b11:
			tmpInstruction=Instruction7;
		default: begin tmpInstruction=`InstructionZero; end
		endcase
	end
	//not in prefetched buffer
	else
	begin
		//now i do not have your desired instruction
		tmpInstruction=`InstructionZero;
	end
end

//if i can output current selected instruction
assign NoThisInstruction=((Address[`AddressBusWidth-1:4]!=Address0[`AddressBusWidth-1:4] || FirstHalfGot==1'b0) && (Address[`AddressBusWidth-1:4]!=Address1[`AddressBusWidth-1:4] || SecondHalfGot==1'b0))?1'b1:1'b0;
assign Wait=NoThisInstruction;
assign Instruction=Wait?`InstructionZ:tmpInstruction;

assign ForwardAddress=Address+{32'b0000_0000_0000_0000_0000_0000_0001_0000};
assign ForwardNoThisInstruction=((ForwardAddress[`AddressBusWidth-1:4]!=Address0[`AddressBusWidth-1:4] || FirstHalfGot==1'b0) && (ForwardAddress[`AddressBusWidth-1:4]!=Address1[`AddressBusWidth-1:4] || SecondHalfGot==1'b0))?1'b1:1'b0;


//////////////////////////////////////////////////////////
//below is fetch instruction from cahce			//
//////////////////////////////////////////////////////////
always @(posedge clock or negedge reset)
begin
	if(reset==1'b0)
	begin
		Instruction0=0;
		Instruction1=1;
		Instruction2=2;
		Instruction3=3;
		Instruction4=4;
		Instruction5=5;
		Instruction6=6;
		Instruction7=7;
		
		Address0=`AddressBusZero;
		Address1=`AddressBusZero;
		
		Status=`PreFetchStatus_Normal;
		PreFetchedAddress=`AddressBusZero;
		PreFetchedRequest=1'b0;
		AddressStore=`AddressBusZero;
		
		FirstHalfGot=1'b0;
		SecondHalfGot=1'b0;
	end
	else
	begin
		case (Status)
		`PreFetchStatus_Normal:
			//only when the cache is free can you goto fetch instruction from cache
			if(PreFetchedWait==1'b0)
			begin
			   if(NoThisInstruction==1'b1)//no this instruction in buffer
			   begin
				Status=`PreFetchStatus_Wait;
				//fetch a whole instruction cache block
				PreFetchedAddress={Address[`AddressBusWidth-1:4],4'b0000};
				PreFetchedRequest=1'b1;
				AddressStore=PreFetchedAddress;
//				$monitor($time,"	instruction prefetch buffer miss address:	%h	and request for cache block address:	%h",Address,PreFetchedAddress);
			   end
			   else if(Address[4]==1'b0)//i am accessing the first half
			   begin
			   	if(ForwardNoThisInstruction)//fetch the second half
			   	begin
			  		//send out access for the second half
					Status=`PreFetchStatus_Wait;
					//fetch a whole instruction cache block
					PreFetchedAddress={ForwardAddress[`AddressBusWidth-1:4],4'b0000};
					PreFetchedRequest=1'b1;
					AddressStore=PreFetchedAddress;
//					$monitor($time,"forward fetch for the second half at:	%h",PreFetchedAddress);
			   	end
			   end
			   else if(Address[4]==1'b1)//i am accessing the second half
			   begin
			   	if(ForwardNoThisInstruction)//fetch the first half
			   	begin
			  		//send out access for the first half
					Status=`PreFetchStatus_Wait;
					//fetch a whole instruction cache block
					PreFetchedAddress={ForwardAddress[`AddressBusWidth-1:4],4'b0000};
					PreFetchedRequest=1'b1;
					AddressStore=PreFetchedAddress;
//					$monitor($time,"forward fetch for the first half at:	%h",PreFetchedAddress);
			   	end
			   end
			end
		`PreFetchStatus_Wait:
			//wait for the desire instruction
			if(PreFetchedWait==1'b0)
			begin
				Status=`PreFetchStatus_Normal;
				//just preserve previous address
				//PreFetchedAddress=`AddressBusZ;
				PreFetchedRequest=1'b0;
//				$monitor($time,"	fetch back from instruction cache address:	%h",AddressStore);
				//write the read back instruction to buffer
				if(AddressStore[4]==1'b1)//now is store to the second half of prefetch buffer
				begin
					Instruction4=PreFetchedInstructions[31:0];
					Instruction5=PreFetchedInstructions[63:32];
					Instruction6=PreFetchedInstructions[95:64];
					Instruction7=PreFetchedInstructions[127:96];
					
					Address1=AddressStore;
					SecondHalfGot=1'b1;
				end
				else if(AddressStore[4]==1'b0)
				begin
					Instruction0=PreFetchedInstructions[31:0];
					Instruction1=PreFetchedInstructions[63:32];
					Instruction2=PreFetchedInstructions[95:64];
					Instruction3=PreFetchedInstructions[127:96];
					
					Address0=AddressStore;
					FirstHalfGot=1'b1;
				end
			end
		endcase
	end
end

endmodule

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产一区二区三区精品| 久久电影国产免费久久电影| 成人动漫视频在线| 欧美国产一区视频在线观看| 国产乱人伦偷精品视频免下载| 五月综合激情日本mⅴ| 欧美日韩午夜精品| 麻豆国产欧美日韩综合精品二区| 欧美精品免费视频| 久草精品在线观看| 国产视频一区在线观看| 99久久精品国产导航| 一区二区三区在线观看视频| 欧美日韩一区二区不卡| 日本不卡不码高清免费观看| 精品99999| 97成人超碰视| 日本欧美久久久久免费播放网| 精品久久久久久久久久久久包黑料 | 欧洲av在线精品| 亚洲一区二区三区四区在线观看 | 成人av综合在线| 亚洲精品老司机| 午夜伦欧美伦电影理论片| 日韩精品一区二区三区在线观看| 国产成人亚洲精品青草天美 | 精品日本一线二线三线不卡| 国产成人免费在线观看| 亚洲一区二区高清| 久久精品夜夜夜夜久久| 在线观看视频91| 韩国精品免费视频| 亚洲自拍偷拍欧美| 国产校园另类小说区| 欧美图区在线视频| 国产高清不卡一区| 亚洲成av人片在线| 国产精品三级视频| 777午夜精品免费视频| 成人午夜电影小说| 麻豆精品国产传媒mv男同| 日韩一区中文字幕| 久久综合狠狠综合久久激情| 在线观看亚洲a| 国产成人无遮挡在线视频| 视频精品一区二区| 亚洲卡通欧美制服中文| 久久久精品tv| 日韩午夜激情免费电影| 色就色 综合激情| 成人小视频在线| 精品一区二区久久久| 亚洲成人一区二区在线观看| 国产精品丝袜一区| 精品av久久707| 91精品国产一区二区三区蜜臀 | 《视频一区视频二区| 精品国产乱码久久久久久免费| 91黄视频在线| 91视频精品在这里| 东方aⅴ免费观看久久av| 精品亚洲porn| 美女mm1313爽爽久久久蜜臀| 亚洲成人一区二区在线观看| 中文字幕亚洲欧美在线不卡| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美久久久久久蜜桃| 91久久精品网| 欧美性生活久久| 欧洲日韩一区二区三区| 色综合久久88色综合天天| 99视频在线精品| 99久久伊人精品| 94-欧美-setu| 一本色道久久综合精品竹菊| 99久久综合99久久综合网站| 成人91在线观看| eeuss鲁片一区二区三区| bt7086福利一区国产| 成人av在线一区二区三区| 欧美大片在线观看一区二区| 欧美日韩免费一区二区三区视频| 欧洲一区在线电影| 欧美日韩在线播放一区| 欧美日韩另类国产亚洲欧美一级| 欧美少妇xxx| 欧美日韩成人综合| 欧美精三区欧美精三区| 91麻豆精品国产自产在线| 欧美日本视频在线| 91精品久久久久久久99蜜桃 | 91美女视频网站| 色婷婷综合久久久久中文| 欧美在线视频日韩| 欧美精品 日韩| 精品国产一区a| 国产亚洲污的网站| 亚洲丝袜美腿综合| 午夜精品久久久久久久99樱桃| 亚洲mv在线观看| 黄色资源网久久资源365| 懂色av一区二区三区蜜臀 | 色乱码一区二区三区88| 欧美日韩成人综合在线一区二区| 这里只有精品视频在线观看| 久久综合九色综合欧美就去吻 | 亚洲第一狼人社区| 美腿丝袜亚洲一区| 99视频有精品| 亚洲成在线观看| 久久国产三级精品| 成人黄色一级视频| 91精品国产综合久久久久| 久久免费电影网| 亚洲午夜精品一区二区三区他趣| 蜜臀久久99精品久久久久久9 | 日本欧美久久久久免费播放网| 国产在线精品视频| 欧洲一区二区三区免费视频| 日韩一级视频免费观看在线| 国产精品久久夜| 日韩成人一区二区三区在线观看| 国产丶欧美丶日本不卡视频| 日本道免费精品一区二区三区| 91精品国产综合久久精品麻豆 | 欧美一区二区三区白人| 国产蜜臀97一区二区三区| 亚洲一区二区高清| 岛国av在线一区| 欧美一级高清片在线观看| ...中文天堂在线一区| 久久精品国产秦先生| 色天天综合色天天久久| 精品久久久久av影院 | 国产欧美精品区一区二区三区 | 成人av免费观看| 日韩天堂在线观看| 一区二区三区四区不卡视频| 国产精品1区2区3区在线观看| 欧美日韩成人一区| 玉足女爽爽91| av成人免费在线观看| 久久久久亚洲蜜桃| 青青草91视频| 欧美日韩国产一级| 亚洲精品免费在线观看| 国产suv精品一区二区6| 日韩欧美国产精品| 视频在线观看91| 欧美午夜精品一区二区三区| 亚洲图片欧美激情| 懂色av一区二区三区免费看| 日韩免费高清视频| 日韩激情在线观看| 欧美日韩午夜在线视频| 亚洲综合一区二区| 色屁屁一区二区| 亚洲色图欧美激情| 97精品久久久午夜一区二区三区 | 捆绑紧缚一区二区三区视频| 欧洲生活片亚洲生活在线观看| 国产精品久久777777| 国产成人在线视频网站| 精品久久久久久久人人人人传媒| 免费观看久久久4p| 日韩精品自拍偷拍| 久久99久久久欧美国产| 欧美刺激脚交jootjob| 狂野欧美性猛交blacked| 在线电影院国产精品| 日韩影视精彩在线| 日韩精品一区二区在线| 久久精品国产精品青草| 精品国产一区a| 国产乱码精品一品二品| 久久久精品黄色| 成人激情免费电影网址| 国产精品盗摄一区二区三区| 不卡一区二区三区四区| 亚洲激情欧美激情| 欧美日韩三级在线| 蜜桃传媒麻豆第一区在线观看| 日韩免费在线观看| 国产精品77777| 综合久久国产九一剧情麻豆| 日本道免费精品一区二区三区| 亚洲国产成人va在线观看天堂| 欧美日韩和欧美的一区二区| 日韩电影免费在线看| 久久久www成人免费无遮挡大片| 国产精品小仙女| 亚洲欧美日本韩国| 91精品在线一区二区| 国产综合久久久久久久久久久久| 国产女主播在线一区二区| 91亚洲午夜精品久久久久久| 亚洲成人动漫在线免费观看| 精品国产乱码久久久久久免费| 国产成人小视频| 一区二区三区在线视频观看58|