From 2b1e0de9de881b39dc5bd3d9f3dda04ff7e8f173 Mon Sep 17 00:00:00 2001 From: Graham Edgecombe Date: Tue, 26 Dec 2017 16:46:01 +0000 Subject: [PATCH] Propagate mem_fence signal through the pipeline --- rv32.sv | 2 ++ rv32_decode.sv | 3 +++ rv32_execute.sv | 3 +++ 3 files changed, 8 insertions(+) diff --git a/rv32.sv b/rv32.sv index 9314a84..41b74f8 100644 --- a/rv32.sv +++ b/rv32.sv @@ -60,6 +60,7 @@ module rv32 ( logic decode_mem_write; logic [1:0] decode_mem_width; logic decode_mem_zero_extend; + logic decode_mem_fence; logic [1:0] decode_branch_op; logic decode_branch_pc_src; logic [4:0] decode_rd; @@ -76,6 +77,7 @@ module rv32 ( logic execute_mem_write; logic [1:0] execute_mem_width; logic execute_mem_zero_extend; + logic execute_mem_fence; logic [1:0] execute_branch_op; logic [4:0] execute_rd; logic execute_rd_write; diff --git a/rv32_decode.sv b/rv32_decode.sv index 6562cc2..adc439c 100644 --- a/rv32_decode.sv +++ b/rv32_decode.sv @@ -41,6 +41,7 @@ module rv32_decode ( output logic mem_write_out, output logic [1:0] mem_width_out, output logic mem_zero_extend_out, + output logic mem_fence_out, output logic [1:0] branch_op_out, output logic branch_pc_src_out, output logic [4:0] rd_out, @@ -122,6 +123,7 @@ module rv32_decode ( mem_write_out <= 0; mem_width_out <= 2'bx; mem_zero_extend_out <= 1'bx; + mem_fence_out <= 0; branch_op_out <= `RV32_BRANCH_OP_NEVER; branch_pc_src_out <= 1'bx; rd_out <= rd; @@ -478,6 +480,7 @@ module rv32_decode ( end `RV32_INSTR_FENCE_I: begin valid_out <= 1; + mem_fence_out <= 1; end `RV32_INSTR_ECALL: begin valid_out <= 1; diff --git a/rv32_execute.sv b/rv32_execute.sv index 342a31a..293e87e 100644 --- a/rv32_execute.sv +++ b/rv32_execute.sv @@ -22,6 +22,7 @@ module rv32_execute ( input mem_write_in, input [1:0] mem_width_in, input mem_zero_extend_in, + input mem_fence_in, input [1:0] branch_op_in, input branch_pc_src_in, input [4:0] rd_in, @@ -45,6 +46,7 @@ module rv32_execute ( output logic mem_write_out, output logic [1:0] mem_width_out, output logic mem_zero_extend_out, + output logic mem_fence_out, output logic [1:0] branch_op_out, output logic [4:0] rd_out, output logic rd_write_out, @@ -113,6 +115,7 @@ module rv32_execute ( mem_write_out <= mem_write_in; mem_width_out <= mem_width_in; mem_zero_extend_out <= mem_zero_extend_in; + mem_fence_out <= mem_fence_in; branch_op_out <= branch_op_in; rd_out <= rd_in; rd_write_out <= rd_write_in;