kereng1 / mips_poc

0 stars 0 forks source link

ALUOp main control in the decode. #4

Closed kereng1 closed 5 days ago

kereng1 commented 1 week ago

i need some clearafications about the ALUOP from the main control. @amichai-bd

and i couldnt add you to assignees for somw reason.

amichai-bd commented 1 week ago

Regarding 1):

If i remember correctly, the functionality of the opcodes are always the same except the case of R-Type. Only in R-Type you need to take into account the bits of the "function"- instruction[5:0] So ya - This seems correct to me:

assign ALUOp    = (opcode == R_TYPE);
...
//ALU control
// ALUOp
assign ALUCtrl = Branch ? FUNCT_SUB  :              //branch is a subtraction:
                 ALUOp  ? t_funct'(instruction[5:0]) :
                          FUNCT_ADD; //add is the default operation

Regarding 2)

The microarchitecture we implemented allowed all LSB t_funct'(instruction[5:0]) to determine the ALU behavior. And the ALUOp was a single bit just for the case of R-Type where we need to look at the t_funct'(instruction[5:0]) .

In the case of other opcode such as "branch" we need to "FUNCT_SUB" to set the "zero" in the case of 2 register values are the same

Regarding 3)

I just accepted the invite. now you should be able to assign me