Closed kereng1 closed 5 days ago
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
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
I just accepted the invite. now you should be able to assign me
i need some clearafications about the ALUOP from the main control. @amichai-bd
[x] 1) In my code: " assign ALUOp = (opcode == R_TYPE); " maby i need to add more ,not only for Rtype but for all instructions.
[x] 2) " logic ALUOp; " doesnt this need to be size [1:0] ??
and i couldnt add you to assignees for somw reason.