From c4e711209cbfb7ef081da9a6392e64e4f1ef932e Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 18 Nov 2015 19:23:11 +0100 Subject: [PATCH] Towards compressed ISA support --- picorv32.v | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/picorv32.v b/picorv32.v index 896aca5..3d60042 100644 --- a/picorv32.v +++ b/picorv32.v @@ -236,6 +236,12 @@ module picorv32 #( if (COMPRESSED_ISA && mem_do_rinst) begin case (mem_rdata_latched[1:0]) 2'b00: begin // Quadrant 0 + case (mem_rdata_latched[15:13]) + 3'b 110: begin // C.SW + {mem_rdata_q[31:25], mem_rdata_q[11:7]} <= {mem_rdata_latched[5], mem_rdata_latched[12:10], mem_rdata_latched[6], 2'b00}; + mem_rdata_q[14:12] <= 3'b 010; + end + endcase end 2'b01: begin // Quadrant 1 case (mem_rdata_latched[15:13]) @@ -518,8 +524,13 @@ module picorv32 #( case (mem_rdata_latched[1:0]) 2'b00: begin // Quadrant 0 - decoded_rs1 <= 8 + mem_rdata_latched[9:7]; - decoded_rd <= 8 + mem_rdata_latched[4:2]; + case (mem_rdata_latched[15:13]) + 3'b110: begin // C.SW + is_sb_sh_sw <= 1; + decoded_rs1 <= 8 + mem_rdata_latched[9:7]; + decoded_rs2 <= 8 + mem_rdata_latched[4:2]; + end + endcase end 2'b01: begin // Quadrant 1 case (mem_rdata_latched[15:13])