240 likes | 351 Views
Computer Organization Lecture 18. IF, ID, R-type microprogramming Exam 2 review. Microprogramming overview. Review instructions, understand goals Determine state diagram Microprogram individual instructions List tokens on one line Repeat for remaining clocks Merge all instructions
E N D
Computer OrganizationLecture 18 IF, ID, R-type microprogramming Exam 2 review University of Portland School of Engineering
Microprogramming overview • Review instructions, understand goals • Determine state diagram • Microprogram individual instructions • List tokens on one line • Repeat for remaining clocks • Merge all instructions • Test, test, test University of Portland School of Engineering
MicroAsm • Java application: MicroAsm.class, SavitchIn.class • Microinstruction: free format, no fixed fields • Requires input file: text-only, file.upg • Creates output file: file.txt • Errors: command line file name,file I/O, unrecognizable token • Execution: BlueJ or DOS command line University of Portland School of Engineering
MicroAsm syntax • Directives org: nbr Sets uPC to value of nbr, used with branch token // comment Everthing after // ignored • Each line • directives (optional) • tokens (signals to assert) • last line contains return University of Portland School of Engineering
MicroAsm source format University of Portland School of Engineering
uProgram tokens University of Portland School of Engineering
uProgram tokens, continued. University of Portland School of Engineering
uProgram tokens, continued. University of Portland School of Engineering
A B Reset Lw or Sw R-fmt C Beq Jump G I J Sw Lw D F H E Partial MDP16 state diagram University of Portland School of Engineering
ID IF Reset 2 clocks sll srl lw sw R-fmt nop 1- 3 additional clocks j beq addi subi andi ori MDP16 state diagram University of Portland School of Engineering
IF state ? • Write instruction from memory into IR • Increment the program counter IRwr PCinc University of Portland School of Engineering
ID state ? • Determine optimistic branch address • Branch to opcode Alua-pc Alub-ext imm aluopadd branch University of Portland School of Engineering
R-type instruction • Op code: 01 • Func bits (IR[3:0]) determine ALU operation • Write result into register file University of Portland School of Engineering
R-type EX state? • Origin: 0x10 • Operation: clock 3 • RALUout = A funct B • Functional units • ALU funct = IR[0:3] • ALU inputs • R0 • R1 Org: 10 alua-r0 Alub-r1 University of Portland School of Engineering
R-type WB state? • Next: return to IF • Operation: clock 4 • Reg [ IR(9)] = ALUout • Functional units • Must write to reg file • Data comes from RALU • Use IR[9] as destination register rwr reg-ralu return University of Portland School of Engineering
Exam 2 review See website Syllabus & Reference page University of Portland School of Engineering
IF state ? • Write instruction from memory into IR • Increment the program counter IRWr PCinc University of Portland School of Engineering
ID state ? • Determine optimistic branch address • Dispatch to opcode Imm aluA_Pc aluB_Ext aluOpAdd branch University of Portland School of Engineering
IF, ID microprogram Two microinstructions, two ROM contents University of Portland School of Engineering
R-type microprogram • Func bits (IR[3:0]) determine ALU operation • Write result into register file Rwr reg_Ralu Return aluA_R0 aluB_R1 University of Portland School of Engineering
R-type microprogram University of Portland School of Engineering