From 74869cc9818d77f2c141edf4227671168298b084 Mon Sep 17 00:00:00 2001 From: Tommy Thorn Date: Wed, 2 Jan 2013 15:38:25 -0800 Subject: [PATCH] YARI bugfix: the shadow of a ld/st hazard wasn't flushed Loads from IO space (and stores to a busy peripheral) have variable latency and thus the pipeline must block until the resource is ready. In YARI this is done by restarting the whole pipeline. Unfortunately, the instruction in the EX stage wasn't flushed until a cycle later which was fatal when that happend to be a any store or an IO load. Pipelining is trivial in the absense of hazards... --- shared/rtl/yari-core/stage_M.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/rtl/yari-core/stage_M.v b/shared/rtl/yari-core/stage_M.v index e79dc5d..19e0139 100644 --- a/shared/rtl/yari-core/stage_M.v +++ b/shared/rtl/yari-core/stage_M.v @@ -535,7 +535,7 @@ module stage_M(input wire clock one_shot_restart <= 0; // Stalling for uncached_loads - if (x_valid) begin + if (x_valid && !m_restart) begin // We thread x_res through the byte/halfword extraction network m_pc <= x_pc; m_instr <= x_instr; @@ -556,7 +556,7 @@ module stage_M(input wire clock // ****** Store ****** // Uncache stores - if (x_store && x_address[31:24] == 8'hFF) begin + if (x_store && x_address[31:24] == 8'hFF && !m_restart) begin $display("%05d uncached store %8x <- %8x/%1d", $time, x_address, x_store_data, x_byteena); @@ -604,7 +604,7 @@ module stage_M(input wire clock // Uncached loads - if (x_load && x_address[31:24] == 8'hFF) begin + if (x_load && x_address[31:24] == 8'hFF && !m_restart) begin if (got_uncached_data) begin got_uncached_data <= 0; uncached_load_pending <= 0; -- 2.11.4.GIT