《7.4 单总线MIPS CPU微程序控制器原理教学课件.pptx》由会员分享,可在线阅读,更多相关《7.4 单总线MIPS CPU微程序控制器原理教学课件.pptx(14页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、单总线 CPU 微程序控制器谭志虎1微程序入口查找组合逻辑P1分支地址地址转移逻辑Pj分支地址下址字段012MUX条件判别测试组合逻辑判别测试P0PjP0分支地址微程序控制器组成原理框图(下址字段法)控制存储器 ARAR微地址寄存器时钟控制微指令字微指令状态条件B1Bj判别字段微操作控制字段下址字段微操作控制信号IR指令字后续地址n 每个判别测试位对应一个分支地址每个判别测试位对应一个分支地址地址转移逻辑2单总线结构CPU指令周期(控制流)取指令周期计算周期节拍控制信号(4 cycles)T1PCout, ARin, XinT2+4T3Zout, PCin, DREin, Read T4DRo
2、ut, IRin节拍lw (5 cycles)sw (5 cycles)beq (5 cycles)add (3 cycles)addi (3 cycles)T5Rout, XinRout, XinRout, XinT6IR(I)out,ADDIR(I)out, ADDRout, Rs/Rt, SUB, PSWinT7Zout, ARinZout, ARinPCout, XinRout, XinRout , XinT8DREin, Read Rout, Rs/Rt, DRinIR(A)out, ADDRs/Rt, Rout, ADD IR(I)out , ADD T9DRout, RinDRE
3、out, WriteZout,Cin=PSW.equalZout, Rin, RegDstZout , Rin , RegDst执行周期3单总线CPU微指令构造n 操作控制字段: 存储操作控制信号u每一位对应一个控制信号,也称微命令,可同时给出多个操作信号n 顺序控制字段: 用于控制微程序的执行顺序u判别逻辑为零,下一条微指令地址从下址字段获取,否则按约定规则生成操作控制字段操作控制字段顺序控制字段顺序控制字段1000000010010000000000P112345678910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29P
4、0PCPCoutoutDRoutRoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)outDREoutARARininDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段4微指令格式n 一条微指令对应一个时钟周期n 微指令操作控制字段的信号在当前时钟周期内有效,为1有效n 指令需要多少时钟周期就包括多少微指令操作控制字段操作控制字段顺序控制字段顺序控制字段10000000100100000000000012345678910 11 12 13 14 15 16 17 18 19 20 21 22 23
5、24 25 26 27 28 29PCPCoutoutDRoutRoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)outDREoutARARininDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段5节拍数据通路 (数据流)控制信号(控制流)T1PCAR, PCXPCout, ARin, Xin节拍数据通路 (数据流)控制信号(控制流)T1PCAR, PCXPCout, ARin, XinT2X+4Z+4节拍数据通路 (数据流)控制信号(控制流)T1PCAR, PCXPCout, ARin, Xin
6、T2X+4Z+4T3ZPC, MARDRZout, PCin, DREin, Read 节拍数据通路 (数据流)控制信号(控制流)T1PCAR, PCXPCout, ARin, XinT2X+4Z+4T3ZPC, MARDRZout, PCin, DREin, Read T4DRIRDRout, IRin时序部件PCPCPCinPCout内总线操作控制信号RinRoutR#W#Rs/RtRegDstRegsRegs0 10 1rsrdrtIDID操作控制器状态中断数据流数据流控制流控制流运算标志运算标志+4ALUALUZ ZABADDXinZoutSUB状态状态PSWinPSWPSWX XME
7、MMEMARARDRDRWrite ReadARinDRinDRoutDREoutDREinIR(A)outIRinIRIRIR(I)out单总线结构CPU 取指令数据通路MPC+ IRPCPCPCoutARinXinARARX X+4ALUALUABPCinMEMMEMDRDRReadDREinZoutZ ZPCPCIRIRIRinDRoutn 4个时钟周期n 四条微指令6节拍数据通路 (数据流)控制信号(控制流)T1PCAR, PCXPCout, ARin, XinT2X+4Z+4T3ZPC, MARDRZout, PCin, DREin, Read T4DRIRDRout, IRin取指
8、令微程序00000 100000001001000000000000000112345678910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29PCPCoutoutDRoutRoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)outDREoutARARininDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段0T T1 1 00001 00000000000000000010000000100T T2 2 +4+400010 0010
9、0001010000000000100000110T T3 3 PCPCininDREDREininZ ZoutoutReadRead00011 010000000000010000000010 xxxxxT T4 4 DRDRoutoutIRIRininPIR7lw指令微程序00100 000100000001000000000000010112345678910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29PCoutDRoutR RoutoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(
10、I)outDREoutARinDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段0T T5 5 00101 00001000000000000100000001100T T6 6 ADDADDIR(I)IR(I)outout00110 00100000100000000000000001110T T7 7 ARARininZ Zoutout00111 00000000010000000000100010000T T8 8 DREDREininReadRead01000 01000000000010000000000000000T T9 9
11、DRDRoutoutR Rinin8sw指令微程序01001 000100000001000000000000101012345678910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29PCoutDRoutR RoutoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)outDREoutARinDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段0T T5 5 01010 00001000000000000100000010110T T6
12、 6 ADDADDIR(I)IR(I)outout01011 00100000100000000000000011000T T7 7 ARARininZ Zoutout0110000010000001000010000000011010T T8 8 DRDRininRs/RtRs/RtR Routout01101 00000000000000000000010000000T T9 9 DREDREoutoutWriteWrite901110 000100000001000000000000111112345678910 11 12 13 14 15 16 17 18 19 20 21 22 2
13、3 24 25 26 27 28 29PCoutDRoutR RoutoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)outDREoutARinDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段0T T5 5 beq指令微程序10000 10000000000000000000000000011T T7 7 X XininPCPCoutout1000100000100000000000100000000101T T8 8 ADDADDIR(A)IR(A)outout10010001100010000
14、00000000000000000T T9 9 Z ZoutoutPCPCinin01111 00010000000000110001000100000T T6 6 SUBSUBR RoutoutRs/RtRs/RtPSWPSWininPequal10add指令微程序10011 000100000001000000000000010012345678910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29PCoutDRoutR RoutoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)out
15、DREoutARinDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段1T T5 5 1010000010000000000010100000001011T T6 6 ADDADDR RoutoutRs/RtRs/Rt1010100100000000010001000000000000T T7 7 R RininZ ZoutoutRegDstRegDst11addi指令微程序10110 000100000001000000000000011112345678910 11 12 13 14 15 16 17 18 19 20 21 22 23
16、 24 25 26 27 28 29PCoutDRoutR RoutoutIR(A)outPCinDREinX XininIRinRs/RtZoutIR(I)outDREoutARinDRinRinPSWinADDReadSUB+4WriteRegDstPIRPequal下址字段下址字段1T T5 5 1011100001000000000000100000010001T T6 6 ADDADDIR(I)IR(I)outout1100000100000000010000000000000000T T7 7 R RininZ Zoutout12单总线CPU微程序状态微地址操作控制字段顺序控制字段
17、0 00000000000111000011 100001000011000102 200010000101111000113 30001100011111xxxxx4 4001000010011001015 5001010010111001106 6001100011011001117 7001110011111010008 8010000100011000009 901001010011101010101001010010101101011111101011010111101100121201100011001110110113130110101101110000014140111001110110111115150111101111111110000016161000010000111000117171000110001111001018181001010010110000019191001110011111010020201010010100111101012121101011010111100000222210110101101110111232310111101111111000242410100101001100000取指微程序取指微程序lwswbeqaddaddi谭志虎下节课再见s t a n h u s t . e d u . c n