Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Project Contributors:
Reece L-M (Eridarus)
James Kim (jamesjhkim)
Harsh Grover (hgrover19)
Yuxuan Seah
Edward Wu (edwu0029)
Brett(Jiaxin) Yang (brettyang02)
Joonseo Park (joon2022park)
Boris Potapov (TheDeepestSpace)
Project Contributors:
Reece L-M (Eridarus)
James Kim (jamesjhkim)
Harsh Grover (hgrover19)
Yuxuan Seah
Edward Wu (edwu0029)
Brett(Jiaxin) Yang (brettyang02)
Joonseo Park (joon2022park)
Boris Potapov (TheDeepestSpace)
Mihir Maringanti
33 changes: 33 additions & 0 deletions src/top.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ module top ( input wire clk
data_t rs1;
data_t rs2;

data_t alu_input_a;
data_t alu_input_b;

addr_t OldPC; // TODO: this will need to be moved into fetch module
data_t Data; // TODO: this will need to be moved into fetch module

wire alu__zero_flag;

wire __tmp_AdrSrc
Expand Down Expand Up @@ -78,4 +84,31 @@ module top ( input wire clk
, .zeroE ( alu__zero_flag )
);

always @(*) begin
case (__tmp_ALUSrcA)
2'b00: alu_input_a = 32'd0;
2'b01: alu_input_a = OldPC;
2'b10: alu_input_a = rs1;
default: alu_input_a = 32'hxxxxxxxx;
endcase
end

always @(*) begin
case (__tmp_ALUSrcB)
2'b00: alu_input_b = rs2;
2'b01: alu_input_b = imm_ext;
2'b10: alu_input_b = 32'd4;
default: alu_input_b = 32'hxxxxxxxx;
endcase
end

always @(*) begin
case (__tmp_ResultSrc)
2'b00: __tmp_ResultData = __tmp_ALUOut;
2'b01: __tmp_ResultData = Data;
2'b10: __tmp_ResultData = OldPC;
default: __tmp_ResultData = 32'hxxxxxxxx;
endcase
end

endmodule