寄存器组设计实验_第1页
寄存器组设计实验_第2页
寄存器组设计实验_第3页
寄存器组设计实验_第4页
寄存器组设计实验_第5页
已阅读5页,还剩21页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、熟悉并掌握MIPS32CPU掌握用VerilogHDLVHDL语言来设计一个MIPS32CPU组成的字长为 32 位的 ARM32 CPU 中所用的寄存器组。二实验原理(背景知识 “, ).三实验器材/环【硬件器材】电脑,Alter公司的DE2-70开发板CycloneII 系列EP2C70F896C6【环境】quartus 器组的设计,并在Quartus (MIPS寄存器的要求设计AlteraDE2-70 AlteraDE2-115 开发板实现。用Verilog HDL语言或VHDL语言编写一个由37个寄存器组成的字长为32位的ARM32位中所用的寄存器组(Thumb寄存器暂不考虑并在Qua

2、rtus AlteraDE2-70或AlteraDE115加点,并将电缆与计算机相连VerilogHDLVHDL语言编写一个MIPS32CPU MIPS32(inputinput 4:0 Rd_addr,input Clk,Rd_write_en, output 31:0Rs_out, reg/当Rd_write_en=1时,即可结束实验 if(Rd_write_en = 0&Rd_addr!=0 ) if(Rd_Byte_w_en3 = 0)RRd_addr31:24=Rd_in31:24; if(Rd_Byte_w_en2 = 0)RRd_addr23:16=Rd_in23:16; if(

3、Rd_Byte_w_en1 = 0)RRd_addr15:8=Rd_in15:8; if(Rd_Byte_w_en0 = 0)RRd_addr7:0=/将写入指定寄存器的数据出来: assignRs_out31:0RRs_addr31:0; assign Rt_out 31:0 = R Rt_addr 31:0; project_2( input input 3:0Rd_Byte_w_en, input 3:0 Rd_addr,input3:0output 3:0Rs_out, reg3:0Rif(Rd_write_en = 0 ) RRd_addr3=Rd_in3; if(Rd_Byte_w

4、_en2 = 0)RRd_addr2=Rd_in2; if(Rd_Byte_w_en1 = 0)RRd_addr1=Rd_in1; if(Rd_Byte_w_en0 = 0)RRd_addr0=0&Rn_w_addr=15) if(Rn_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rn_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rn_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rn_byte_w_en0=0) memRn_w_addr7:0=0&R

5、d_w_addr=15) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0=0&Rn_w_addr=7) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn

6、_in23:16; if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= 8 & Rn_w_addr = 15)if(Rd_byte_w_en3=0)mem_fiqRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_fiqRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) mem_fiqRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) mem_

7、fiqRn_w_addr7:0= 13 & Rn_w_addr = 15)if(Rd_byte_w_en3=0)mem_fiqRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_fiqRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) mem_fiqRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) mem_fiqRn_w_addr7:0=0&Rd_w_addr=7) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24;

8、 if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0= 8 & Rd_w_addr = 15)if(Rd_byte_w_en3=0)mem_fiqRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)mem_fiqRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) mem_fiqRd_w_addr1

9、5:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_fiqRd_w_addr7:0= 13 & Rd_w_addr = 15)if(Rd_byte_w_en3=0)mem_fiqRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)mem_fiqRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) mem_fiqRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_fiqRd_w_addr7:0=0&Rn_w_addr=12) if(Rd_b

10、yte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) memRn_w_addr15:8 = Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0 = Rn_in7:0;if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_irqRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_irqR

11、n_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) mem_irqRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) mem_irqRn_w_addr7:0=0&Rd_w_addr=12) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0

12、=0) memRd_w_addr7:0= Rd_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_irqRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)mem_irqRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) mem_irqRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_irqRd_w_addr7:0=0&Rn_w_addr=7) if(Rd_byte_w_en3=0)memRn

13、_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_irqRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_irqRn_w_addr23:16=Rn_in

14、23:16; if (Rd_byte_w_en1=0) mem_irqRn_w_addr15:8 = Rn_in15:8; if (Rd_byte_w_en0=0) mem_irqRn_w_addr7:0 =0&Rd_w_addr=7) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7

15、:0= Rd_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_irqRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)mem_irqRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) mem_irqRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_irqRd_w_addr7:0= Rd_in7:0; 5b10011: /SVC mode if (SPSR_write_en=0) SPSR_

16、svc=0&Rn_w_addr=12) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en1=0)mem_svcRn_w_addr15:8 =Rn_in15:8; if

17、(Rd_byte_w_en0=0) mem_svcRn_w_addr7:0=0&Rd_w_addr=12) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0= Rd_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en1=0)me

18、m_svcRd_w_addr15:8 =Rd_in15:8; if (Rd_byte_w_en0=0) mem_svcRd_w_addr7:0=0&Rn_w_addr=7) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn

19、_w_addr=14) if(Rd_byte_w_en1=0)mem_svcRn_w_addr15:8 =Rn_in15:8; if (Rd_byte_w_en0=0) mem_svcRn_w_addr7:0=0&Rd_w_addr=7) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8 = Rd_in15:8;if (Rd_byte_w_en0=0) memRd_w_add

20、r7:0if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en1=0)mem_svcRd_w_addr15:8 =Rd_in15:8; if (Rd_byte_w_en0=0) mem_svcRd_w_addr7:0= Rd_in7:0; 5b10111: /ABT mode if (SPSR_write_en=0) SPSR_abt=0&Rn_w_addr=12) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16;

21、 if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_abtRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_abtRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) mem_abtRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w

22、_en0=0) mem_abtRn_w_addr7:0=0&Rd_w_addr=12) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if(Rd_byte_w_en1=0)memRd_w_addr15:8 =Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0 = Rd_in7:0;if(Rn_w_addr=13|Rn_w_addr=14) if (Rd_byte_w_en1=0) mem_abtRd_w

23、_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_abtRd_w_addr7:0=0&Rn_w_addr=7) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn_w_addr=14

24、) if (Rd_byte_w_en1=0) mem_abtRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) mem_abtRn_w_addr7:0=0&Rd_w_addr=7) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0= Rd_i

25、n7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en1=0)mem_abtRd_w_addr15:8 =Rd_in15:8; if (Rd_byte_w_en0=0) mem_abtRd_w_addr7:0 = Rd_in7:0;5b11011: /UND mode if (SPSR_write_en=0) SPSR_und=0&Rn_w_addr=12) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:1

26、6; if (Rd_byte_w_en1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_undRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_undRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) mem_undRn_w_addr15:8=Rn_in15:8; if (Rd_byte

27、_w_en0=0) mem_undRn_w_addr7:0=0&Rd_w_addr=12) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0= Rd_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_undRd_

28、w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)mem_undRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) mem_undRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_undRd_w_addr7:0=0&Rn_w_addr=7) if(Rd_byte_w_en3=0)memRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)memRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en

29、1=0) memRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) memRn_w_addr7:0= Rn_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_undRn_w_addr31:24=Rn_in31:24; if(Rd_byte_w_en2=0)mem_undRn_w_addr23:16=Rn_in23:16; if (Rd_byte_w_en1=0) mem_undRn_w_addr15:8=Rn_in15:8; if (Rd_byte_w_en0=0) mem_undRn

30、_w_addr7:0=0&Rd_w_addr=7) if(Rd_byte_w_en3=0)memRd_w_addr31:24=Rd_in31:24; if(Rd_byte_w_en2=0)memRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) memRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) memRd_w_addr7:0= Rd_in7:0; if(Rn_w_addr=13|Rn_w_addr=14) if(Rd_byte_w_en3=0)mem_undRd_w_addr31:24=Rd_in31:

31、24; if(Rd_byte_w_en2=0)mem_undRd_w_addr23:16=Rd_in23:16; if (Rd_byte_w_en1=0) mem_undRd_w_addr15:8=Rd_in15:8; if (Rd_byte_w_en0=0) mem_undRd_w_addr7:0= Rd_in7:0; CPSR_out=Mode_out=CPSR4:0; PC_out = mem15; case (CPSR_in4:0) Rn_out = memRn_r_addr; Rd_out = memRd_r_addr; Rs_out = memRs_r_addr;SPSR_out=

32、0&Rn_r_addr=7) Rn_out = 8 & Rn_r_addr = 14)Rn_out = 13 & Rn_r_addr = 14)Rn_out =0&Rd_r_addr=7) Rd_out = 8 & Rd_r_addr = 14)Rd_out = 13 & Rd_r_addr = 14)Rd_out =0&Rm_r_addr=7) Rm_out = 8 & Rm_r_addr = 14)Rm_out = 13 & Rm_r_addr = 14)Rm_out =0&Rs_r_addr=7) Rs_out = 8 & Rs_r_addr = 14)Rs_out = 13 & Rs_

33、r_addr = 14)Rs_out = mem_fiqRs_r_addr;SPSR_out=if(Rn_r_addr=13|Rn_r_addr=14) Rn_out = 0 & Rn_r_addr = 12)Rn_out = 0 & Rn_r_addr = 7)Rn_out = memRn_r_addr;if(Rd_r_addr=13|Rd_r_addr=14) Rd_out = 0 & Rd_r_addr = 12)Rd_out = 0 & Rd_r_addr = 7)Rd_out = memRd_r_addr;if(Rm_r_addr=13|Rm_r_addr=14) Rm_out =

34、0 & Rm_r_addr = 12)Rm_out = 0 & Rm_r_addr = 7)Rm_out = memRm_r_addr;if(Rs_r_addr=13|Rs_r_addr=14) Rs_out = 0 & Rs_r_addr = 12)Rs_out = 0 & Rs_r_addr = 7)Rs_out = memRs_r_addr;SPSR_out=if(Rn_r_addr=13|Rn_r_addr=14) Rn_out = 0 & Rn_r_addr = 12)Rn_out = 0 & Rn_r_addr = 7)Rn_out = memRn_r_addr;if(Rd_r_a

35、ddr=13|Rd_r_addr=14) Rd_out = 0 & Rd_r_addr = 12)Rd_out = 0 & Rd_r_addr = 7)Rd_out = memRd_r_addr;if(Rm_r_addr=13|Rm_r_addr=14) Rm_out = 0 & Rm_r_addr = 12)Rm_out = 0 & Rm_r_addr = 7)Rm_out = memRm_r_addr;if(Rs_r_addr=13|Rs_r_addr=14) Rs_out = 0 & Rs_r_addr = 12)Rs_out = 0 & Rs_r_addr = 7)Rs_out = memRs_r_addr;SPSR_out=if(Rn_r_addr=13|Rn_r_addr=14) Rn_out = 0 & Rn_r_addr = 12)Rn_out = 0 & Rn_r_addr = 7)Rn_out = memRn_r_addr;if(Rd_r_addr=13|Rd_r_addr=14) Rd_ou

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论