Propagate mem_fence signal through the pipeline

This commit is contained in:
Graham Edgecombe 2017-12-26 16:46:01 +00:00
parent f8b8842abc
commit 2b1e0de9de
3 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;