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

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

?? decoder_arm.v

?? 若干VHDL語言的源代碼
?? V
?? 第 1 頁 / 共 5 頁
字號:
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//i assume that there is at most 32 function component, each 	//
// at most have 8 entry	outstand operation entry,so a byte will	//
//be enough for the tomasulo source operand that come from 	//
//function component,if a source come from register file entry	//
//then i will direct read it from register file and tag it as 	//
//ready								//
//a all zero component entry means null device,and you can not	//
//treat it like normal device					//
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
`include "Def_StructureParameter.v"
`include "Def_RegisterFile.v"
`include "Def_ARMALU.v"
//`include "Def_ComponentEntry.v"
`include "Def_ALUType.v"
`include "Def_Decoder.v"
`include "Def_BarrelShift.v"
`include "Def_ALUType.v"
`include "Def_mem.v"
`include "Def_psr.v"
`include "Def_Mode.v"
`include "Def_Exception.v"

module Decoder_ARM(	in_ValidInstruction_IFID,
			in_PipelineRegister_IFID,
			in_AddressGoWithInstruction,
			in_NextInstructionAddress,
			out_IDOwnCanGo,
			//signal for register file
			out_LeftReadRegisterEnable,
			out_LeftReadRegisterNumber,
			out_RightReadRegisterEnable,
			out_RightReadRegisterNumber,
			//use to read the shift count stored in register
			out_ThirdReadRegisterEnable,
			out_ThirdReadRegisterNumber,
			//signal for register file
			//signal for ALU
			out_ALUEnable,
			out_ALUType,
			out_ALULeftRegister,
			out_ALURightRegister,
			out_ALUThirdRegister,
			out_ALULeftFromImm,
			out_ALURightFromImm,
			out_ALUThirdFromImm,
			out_CPSRFromImm,
			out_SPSRFromImm,
			out_ALUTargetRegister,
			out_ALUExtendedImmediateValue,	//extended 32bit immediate value ,go to right bus
			out_ALURightShiftType,
			out_ALUSecondImmediateValue,	//serve as the shift count
			out_SimpleALUType,		//serve for the pre index mode of load/store
			out_SimpleALUTargetRegister,
			out_ALUMisc,			//some special signal
			out_ALUPSRType,
			out_AddressGoWithInstruction2ALU,
			out_NextAddressGoWithInstruction2ALU,
			//signal for mem stage
			out_MEMEnable,
			out_MEMType,
			out_MEMTargetRegister,
			out_SimpleMEMType,
			out_SimpleMEMTargetRegister,
			out_MEMPSRType,
			//Thumb state
			in_ThumbState,
			in_IsInPrivilegedMode,
			//interrupt signal
			in_TrueFiq,
			in_TrueIrq,
			//can AUL go
			in_ALUCanGo,
			//clear internal state
			in_ChangePC,
			in_MEMChangePC,
			clock,
			reset
			);


//////////////////////////////////////////////////
//////////////////////////////////////////////////
//	input and output declaration		//
//////////////////////////////////////////////////
//////////////////////////////////////////////////
//signal come from if register
input 							in_ValidInstruction_IFID;
input 	[`InstructionWidth-1:0]			in_PipelineRegister_IFID;
input	[`AddressBusWidth-1:0]			in_AddressGoWithInstruction,in_NextInstructionAddress;

//can id its own go
output							out_IDOwnCanGo;

//the three read register signal
output							out_LeftReadRegisterEnable,
								out_RightReadRegisterEnable,
								out_ThirdReadRegisterEnable;
output	[`Def_RegisterSelectWidth-1:0]	out_LeftReadRegisterNumber,
								out_RightReadRegisterNumber,
								out_ThirdReadRegisterNumber;
								

//signal go to alu execute stage
output							out_ALUEnable;		//only when there is space for new operation and a known valid instruction can it be 1'b1
output	[`ByteWidth-1:0]				out_ALUType;		//what type of main alu thread 
//the source operand register,the alu will use it to enable forwarding
output	[`Def_RegisterSelectWidth-1:0]	out_ALULeftRegister,
								out_ALURightRegister,
								out_ALUThirdRegister;
//if the source operand come from immediate value,then forwording will be disable
output							out_ALULeftFromImm,
								out_ALURightFromImm,
								out_ALUThirdFromImm,
								out_CPSRFromImm,
								out_SPSRFromImm;
//target register of the main alu result,will be use to enable forwarding and write back
output	[`Def_RegisterSelectWidth-1:0]	out_ALUTargetRegister;
//the immediate value go to right operand of alu
output	[`WordWidth-1:0]				out_ALUExtendedImmediateValue;
//shift type of right operand
output	[`Def_ShiftTypeWidth-1:0]		out_ALURightShiftType;
//the shift count specify in immediate field,will go to the third read bus
output	[`WordWidth-1:0]				out_ALUSecondImmediateValue;

//simple thread operation type ad target register
output	[`ByteWidth-1:0]				out_SimpleALUType;
//will be use to write back and enable forwarding
output	[`Def_RegisterSelectWidth-1:0]	out_SimpleALUTargetRegister;
//some special signal
output	[`WordWidth-1:0]		out_ALUMisc;
output	[`ByteWidth-1:0]		out_ALUPSRType;
output	[`AddressBusWidth-1:0]		out_AddressGoWithInstruction2ALU,out_NextAddressGoWithInstruction2ALU;
reg	[`AddressBusWidth-1:0]		out_AddressGoWithInstruction2ALU,out_NextAddressGoWithInstruction2ALU;


//the operations for main mem and simple mem thread
//the alu stage will hold these information untill this instruction reach mem stage
output							out_MEMEnable;
output	[`ByteWidth-1:0]				out_MEMType;
output	[`Def_RegisterSelectWidth-1:0]	out_MEMTargetRegister;

output	[`ByteWidth-1:0]				out_SimpleMEMType;
output	[`Def_RegisterSelectWidth-1:0]	out_SimpleMEMTargetRegister;
output	[`ByteWidth-1:0]				out_MEMPSRType;


//thumb state
input	in_ThumbState;

input	in_IsInPrivilegedMode;

//interrupt signal
input	in_TrueFiq,in_TrueIrq;

//the decoder need to know if alu can go
//if not, decoder will not send out useful information
input								in_ALUCanGo;

//branch signal
input			in_ChangePC,in_MEMChangePC;

//global signal
input clock,reset;

//reg style declaration of output signal
reg								out_IDOwnCanGo;
reg								out_LeftReadRegisterEnable,
								out_RightReadRegisterEnable,
								out_ThirdReadRegisterEnable;
reg		[`Def_RegisterSelectWidth-1:0]	out_LeftReadRegisterNumber,
								out_RightReadRegisterNumber,
								out_ThirdReadRegisterNumber;
reg								out_ALUEnable;
reg		[`ByteWidth-1:0]				out_ALUType;
reg								out_ALULeftFromImm,
								out_ALURightFromImm,
								out_ALUThirdFromImm,
								out_CPSRFromImm,
								out_SPSRFromImm;
reg		[`Def_RegisterSelectWidth-1:0]	out_ALUTargetRegister;
reg		[`WordWidth-1:0]				out_ALUExtendedImmediateValue;
reg		[`Def_ShiftTypeWidth-1:0]		out_ALURightShiftType;
reg		[`WordWidth-1:0]				out_ALUSecondImmediateValue;

reg		[`ByteWidth-1:0]				out_SimpleALUType;
reg		[`Def_RegisterSelectWidth-1:0]	out_SimpleALUTargetRegister;
reg		[`WordWidth-1:0]				out_ALUMisc;
reg		[`ByteWidth-1:0]		out_ALUPSRType;

reg								out_MEMEnable;
reg		[`ByteWidth-1:0]				out_MEMType;
reg		[`Def_RegisterSelectWidth-1:0]	out_MEMTargetRegister;

reg		[`ByteWidth-1:0]				out_SimpleMEMType;
reg		[`Def_RegisterSelectWidth-1:0]	out_SimpleMEMTargetRegister;
reg		[`ByteWidth-1:0]				out_MEMPSRType;


//these register will not be infer
//left right third read register
//main and simple thread target register
reg		[`Def_RegisterSelectWidth-1:0]	LeftRegisterNumber,
								RightRegisterNumber,
								ThirdRegisterNumber,
								TargetRegisterNumber,
								SecondTargetRegisterNumber;

//these register will not be infer

//if current register number will be access in LDM or STM
reg	[`Def_RegisterSelectWidth-1:0]	RegCountInLDMSTM;
reg	IfCurrentRegAccessByLDMSTM;
reg	IsFirstAccess;

//map ARM alu type to independante alu type
reg [`ByteWidth-1:0] ALUTypeMapped;

//in fact this three wire is exclusive to each other
//there will not use at the same time
//so some type of share method must be found to share the same adder
wire	[`WordWidth-1:0]		PCAdder4Result;
wire	[`WordWidth-1:0]		PCAdder8or4Result;
wire	[`WordWidth-1:0]		PCAdder12or4Result;

//pipeline register
//previous operation will write register from MEM
reg	PrevOperationWantWriteRegisterFromMEM;
reg	Next_PrevOperationWantWriteRegisterFromMEM;
reg	[`Def_RegisterSelectWidth-1:0]	PrevWriteRegister;
reg	[`Def_RegisterSelectWidth-1:0]	Next_PrevWriteRegister;

//use in block transfer for register number
reg	[`Def_RegisterSelectWidth-1:0]	IncRegNumber,DecRegNumber;
reg	[`Def_RegisterSelectWidth-1:0]	Next_IncRegNumber,Next_DecRegNumber;

wire	[`Def_RegisterSelectWidth-1:0]	IncRegNumberAdd1,DecRegNumberSub1;

wire	[`WordWidth-1:0]	Inc8or4,Inc12or4;


always	@(in_PipelineRegister_IFID	or
	DecRegNumber			or
	IncRegNumber
	)
begin
	if(in_PipelineRegister_IFID[23]==1'b0)
	begin//down
		RegCountInLDMSTM=DecRegNumber;
		if(DecRegNumber==`Def_RegisterSelectAllOne)
			IsFirstAccess=1'b1;
		else
			IsFirstAccess=1'b0;
	end
	else
	begin//up
		RegCountInLDMSTM=IncRegNumber;
		if(IncRegNumber==`Def_RegisterSelectZero)
			IsFirstAccess=1'b1;
		else
			IsFirstAccess=1'b0;
	end
end

always	@(RegCountInLDMSTM	or
	in_PipelineRegister_IFID
	)
begin
	IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[0];
	case (RegCountInLDMSTM[3:0])
	4'b0000:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[0];
	4'b0001:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[1];
	4'b0010:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[2];
	4'b0011:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[3];
	4'b0100:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[4];
	4'b0101:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[5];
	4'b0110:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[6];
	4'b0111:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[7];
	4'b1000:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[8];
	4'b1001:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[9];
	4'b1010:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[10];
	4'b1011:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[11];
	4'b1100:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[12];
	4'b1101:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[13];
	4'b1110:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[14];
	4'b1111:
		IfCurrentRegAccessByLDMSTM=in_PipelineRegister_IFID[15];
	endcase
end



always	@(posedge clock or negedge reset)
begin
	if(reset==1'b0)
	begin
		PrevOperationWantWriteRegisterFromMEM=1'b0;
		PrevWriteRegister=`Def_RegisterSelectZero;
		IncRegNumber=`Def_RegisterSelectZero;
		DecRegNumber=`Def_RegisterSelectAllOne;
	end
	else
	begin
		PrevOperationWantWriteRegisterFromMEM=Next_PrevOperationWantWriteRegisterFromMEM;
		PrevWriteRegister=Next_PrevWriteRegister;
		IncRegNumber=Next_IncRegNumber;
		DecRegNumber=Next_DecRegNumber;
	end
end

assign	IncRegNumberAdd1=IncRegNumber+1;
assign	DecRegNumberSub1=DecRegNumber-1;

//exclusive to each other, must found a method to share this adder
assign	PCAdder4Result=in_AddressGoWithInstruction+32'h0000_0004;
assign	Inc8or4=(in_ThumbState==1'b1)?32'h0000_0004:32'h0000_0008;
//STM in thumb state do not store pc, so use PCAdder12or4Result for stm pc will be ok
assign	Inc12or4=(in_ThumbState==1'b1)?32'h0000_0004:32'h0000_000C;

assign	PCAdder8or4Result=in_AddressGoWithInstruction+Inc8or4;
assign	PCAdder12or4Result=in_AddressGoWithInstruction+Inc12or4;

//output 
always @(in_ValidInstruction_IFID	or
	in_PipelineRegister_IFID	or
	in_ALUCanGo			or
	in_ThumbState			or
	in_TrueFiq			or
	in_TrueIrq			or
	in_NextInstructionAddress	or
	ALUTypeMapped			or
	LeftRegisterNumber		or
	RightRegisterNumber		or
	ThirdRegisterNumber		or
	TargetRegisterNumber		or
	SecondTargetRegisterNumber	or
	in_AddressGoWithInstruction	or
	PCAdder4Result	or
	PCAdder8or4Result	or
	PCAdder12or4Result	or
	PrevOperationWantWriteRegisterFromMEM	or
	PrevWriteRegister	or
	IncRegNumber		or
	IncRegNumberAdd1	or
	DecRegNumber		or
	DecRegNumberSub1	or
	IfCurrentRegAccessByLDMSTM
)
begin
	//to prevent latch to be infer
	//invalid instruction
	out_LeftReadRegisterEnable=1'b0;
	out_LeftReadRegisterNumber=`Def_RegisterSelectZero;
	out_ALULeftFromImm=1'b0;

	out_RightReadRegisterEnable=1'b0;
	out_RightReadRegisterNumber=`Def_RegisterSelectZero;
	out_ALURightFromImm=1'b0;
		
	//third read bus will not be use
	out_ThirdReadRegisterEnable=1'b0;
	out_ThirdReadRegisterNumber=ThirdRegisterNumber;
	out_ALUThirdFromImm=1'b0;

	out_ALUEnable=1'b0;
	out_ALUType=`ALUType_Null;
	out_ALUTargetRegister=`Def_LinkRegister;

	//no use here
	out_ALURightShiftType=2'b00;
		
	out_ALUExtendedImmediateValue=`WordDontCare;
	out_ALUSecondImmediateValue=`WordDontCare;
	out_IDOwnCanGo=1'b1;

	//mem not enable
	out_MEMEnable=1'b0;
	out_MEMType=`MEMType_Null;
	out_MEMTargetRegister=`Def_LinkRegister;

	//simple alu will not be use
	out_SimpleALUType=`ALUType_Null;
	out_SimpleALUTargetRegister=`Def_LinkRegister;
	out_ALUMisc=`WordZero;
	//send out the condition code
	out_ALUMisc[31:28]=in_PipelineRegister_IFID[31:28];

	//simple MEM thread
	out_SimpleMEMType=`MEMType_Null;
	out_SimpleMEMTargetRegister=`Def_LinkRegister;

	//condition code valid in alu and mem stage
	out_ALUPSRType=`ALUPSRType_Null;
	out_MEMPSRType=`MEMPSRType_Null;

	//default is come from register
	out_CPSRFromImm=1'b0;
	out_SPSRFromImm=1'b0;
	
	//only a branch or alu/load/store use pc as base will send address on this port 
	//out to LeftReadBus
	out_AddressGoWithInstruction2ALU=`WordDontCare;
	out_NextAddressGoWithInstruction2ALU=`WordZero;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区人| 日本一区二区三区四区在线视频| 精品国产乱码久久久久久1区2区 | 麻豆成人av在线| 91在线码无精品| 日韩欧美自拍偷拍| 一区二区三区日韩欧美| 看电影不卡的网站| 欧亚洲嫩模精品一区三区| 国产日韩欧美激情| 国产做a爰片久久毛片 | caoporen国产精品视频| 欧美成人一区二区三区| 亚洲综合成人在线视频| 91麻豆蜜桃一区二区三区| 久久精品免费在线观看| 精品一区二区日韩| 日韩精品一区二区三区中文精品| 香蕉久久夜色精品国产使用方法| 色综合久久88色综合天天免费| 国产欧美精品一区二区色综合| 国产一区二区三区日韩| 日韩欧美国产系列| 男人的天堂久久精品| 欧美精品久久一区二区三区| 亚洲午夜视频在线观看| 91久久线看在观草草青青| 亚洲三级在线播放| 色天天综合久久久久综合片| 亚洲男同性视频| 色伊人久久综合中文字幕| 亚洲欧美综合另类在线卡通| www.亚洲色图.com| 成人免费一区二区三区视频| 99久久国产综合精品麻豆| 日韩伦理av电影| 欧美唯美清纯偷拍| 亚洲成人免费av| 欧美一区二区在线不卡| 激情av综合网| 亚洲国产精品高清| 93久久精品日日躁夜夜躁欧美| 亚洲欧美激情一区二区| 欧美午夜精品一区二区三区| 日韩激情在线观看| 欧美成人a∨高清免费观看| 国内外精品视频| 中文在线资源观看网站视频免费不卡 | 精品污污网站免费看| 性久久久久久久| 日韩欧美国产一二三区| 久久国产精品一区二区| 欧美国产精品一区二区三区| 在线视频一区二区三| 另类的小说在线视频另类成人小视频在线 | 亚洲视频一区在线| 在线91免费看| 国产另类ts人妖一区二区| 欧美国产国产综合| 欧美日韩国产综合视频在线观看| 青青草国产成人av片免费| 欧美精品一区二| 色综合色综合色综合色综合色综合| 亚洲综合精品久久| 国产亚洲欧美在线| 欧美精品在线视频| 欧美婷婷六月丁香综合色| 天天综合天天综合色| 久久久国产综合精品女国产盗摄| 91九色02白丝porn| 国产一区二区不卡老阿姨| 一区二区在线免费| 久久精子c满五个校花| 欧美三片在线视频观看| 国产成人免费视频一区| 天堂av在线一区| 亚洲欧洲精品一区二区三区不卡| 欧美精品免费视频| 91亚洲资源网| 国产乱子伦一区二区三区国色天香| 中文字幕不卡一区| 精品国产免费人成在线观看| 在线观看日产精品| 风流少妇一区二区| 久久国产日韩欧美精品| 日韩综合小视频| 亚洲一区二三区| 国产精品剧情在线亚洲| 久久久精品国产免大香伊| 5月丁香婷婷综合| 在线观看av一区二区| 成人高清视频在线| 国产一区二区三区日韩| 玖玖九九国产精品| 日韩电影免费在线看| 亚洲成人免费影院| 亚洲一区二区三区自拍| 亚洲精品成人精品456| 国产精品三级在线观看| 久久久99精品久久| 26uuu精品一区二区三区四区在线| 精品视频一区三区九区| 欧美性一区二区| 在线观看日韩电影| 在线视频综合导航| 欧美亚洲禁片免费| 欧美视频中文字幕| 欧美三级中文字幕在线观看| 色av成人天堂桃色av| 色噜噜狠狠色综合欧洲selulu| www.色精品| 91国产成人在线| 欧美在线免费观看亚洲| 欧美日韩卡一卡二| 91.com视频| 欧美大片日本大片免费观看| 日韩美女一区二区三区| 精品欧美一区二区久久| 国产日韩欧美a| 中文字幕一区二区三区在线不卡| 中文字幕在线观看不卡| 亚洲综合免费观看高清完整版 | 亚洲人成在线观看一区二区| 亚洲免费伊人电影| 亚洲国产精品一区二区久久恐怖片| 亚洲第一激情av| 久久国产日韩欧美精品| 国产乱码精品一区二区三| 成人性生交大片免费看视频在线| 99久久综合99久久综合网站| 91国产免费看| 日韩精品一区二区三区在线播放 | 日韩三级中文字幕| 亚洲国产成人精品视频| 亚洲一区在线播放| 美女免费视频一区| 成人国产精品免费网站| 在线免费观看日本一区| 91精品国产综合久久婷婷香蕉 | 欧美一区二区啪啪| 国产午夜精品久久| 亚洲一区二区美女| 毛片av一区二区| 91一区二区在线| 日韩女优av电影在线观看| 中文字幕欧美一| 天天色综合天天| 成人深夜在线观看| 717成人午夜免费福利电影| 久久亚洲私人国产精品va媚药| 日韩久久一区二区| 激情另类小说区图片区视频区| 99视频在线精品| 精品国产乱码久久久久久夜甘婷婷| 国产精品色哟哟网站| 蜜桃视频一区二区| 91久久精品一区二区三区| 久久久久久久久久电影| 亚洲一区二区三区三| 国产91精品一区二区麻豆网站| 欧美丰满少妇xxxbbb| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲1区2区3区4区| 成人av免费在线| 2014亚洲片线观看视频免费| 亚洲国产一区在线观看| 国产福利精品一区| 日韩亚洲欧美综合| 亚洲午夜久久久久中文字幕久| 国产成人午夜精品5599| 日韩欧美二区三区| 亚洲午夜一区二区| 色综合久久久久网| 国产欧美日韩麻豆91| 精品一区免费av| 日韩一区二区免费视频| 亚洲一区二区三区在线看| av不卡免费电影| 国产亚洲欧美日韩日本| 国产真实乱子伦精品视频| 欧美精品高清视频| 亚洲国产精品精华液网站| 色婷婷激情久久| 亚洲欧美视频在线观看| 床上的激情91.| 国产喷白浆一区二区三区| 久久不见久久见免费视频1| 56国语精品自产拍在线观看| 亚洲精品久久久蜜桃| 99久久国产综合精品色伊| 国产精品看片你懂得| 丁香一区二区三区| 国产视频一区二区在线观看| 国产传媒日韩欧美成人| 精品99一区二区| 国产麻豆一精品一av一免费| 久久亚洲免费视频| 国产不卡在线一区| 亚洲欧洲一区二区在线播放| 99麻豆久久久国产精品免费优播|