From 7350a3aab02190bfb2f82e5fe19837b146ab3e44 Mon Sep 17 00:00:00 2001 From: aditya200523 Date: Sat, 3 Aug 2024 18:06:15 +0530 Subject: [PATCH] Updated case for A extension --- rtl/control_unit.v | 91 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/rtl/control_unit.v b/rtl/control_unit.v index 313801f..1ecae71 100644 --- a/rtl/control_unit.v +++ b/rtl/control_unit.v @@ -419,6 +419,97 @@ always@(*) begin end if(wr_en==1) wr_en<=0; end + 7'b0101111 : begin + case(out_signal) + 54'h2000000000 : begin //AMOSWAP.W + v1 <= mem_read; + v2 <= rs2_input; + final_output <= mem_read; + mem_write <= rs2_input; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + 54'h4000000000 : begin //AMOADD.W + v1 <= mem_read; + v2 <= rs2_input; + + final_output <= mem_read; + mem_write <= ALUoutput; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + 54'h8000000000 : begin //AMOAND.W + v1 <= mem_read; + v2 <= rs2_input; + + final_output <= mem_read; + mem_write <= ALUoutput; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + 54'h10000000000 : begin //AMOOR.W + v1 <= mem_read; + v2 <= rs2_input; + + final_output <= mem_read; + mem_write <= ALUoutput; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + 54'h20000000000 : begin //AMOXOR.W + v1 <= mem_read; + v2 <= rs2_input; + + final_output <= mem_read; + mem_write <= ALUoutput; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + 54'h40000000000 : begin //AMOMAX.W + v1 <= mem_read; + v2 <= rs2_input; + + final_output <= mem_read; + mem_write <= ALUoutput; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + 54'h80000000000 : begin //AMOMIN.W + v1 <= mem_read; + v2 <= rs2_input; + + final_output <= mem_read; + mem_write <= ALUoutput; + addr <= rs1_input; + wr_en <= 1; + wr_en_rf <= 1; + end + endcase + + + + + + + + + + + + + + + + + + + endcase end