diff --git a/src/cache_ctrl.sv b/src/cache_ctrl.sv index dbf3f97e5..f1bf88f27 100644 --- a/src/cache_ctrl.sv +++ b/src/cache_ctrl.sv @@ -262,13 +262,6 @@ module cache_ctrl #( mem_req_d.bypass = 1'b1; state_d = WAIT_REFILL_GNT; end - end else begin - // we can potentially accept a new request -> I don't know how this works out timing vise - // as this will chain some paths together... - // For now this should not happen to frequently and we spare another cycle - // go back to idle - state_d = IDLE; - data_rvalid_o = 1'b1; end end @@ -317,11 +310,7 @@ module cache_ctrl #( // its for sure a miss WAIT_TAG_BYPASSED: begin // the request was killed - if (kill_req_i) begin - state_d = IDLE; - // we need to ack the killing - data_rvalid_o = 1'b1; - end else begin + if (!kill_req_i) begin // save tag mem_req_d.tag = address_tag_i; state_d = WAIT_REFILL_GNT; @@ -409,8 +398,12 @@ module cache_ctrl #( state_d = IDLE; end end - endcase + + if (kill_req_i) begin + state_d = IDLE; + data_rvalid_o = 1'b1; + end end // -------------- diff --git a/src/scoreboard.sv b/src/scoreboard.sv index c17b42a68..547a54f50 100644 --- a/src/scoreboard.sv +++ b/src/scoreboard.sv @@ -255,42 +255,14 @@ module scoreboard #( else $error ("Issue acknowledged but instruction is not valid"); // there should never be more than one instruction writing the same destination register (except x0) - // assert strict pointer ordering - - // print scoreboard - // initial begin - // automatic string pointer = ""; - // static integer f = $fopen("scoreboard.txt", "w"); - - // forever begin - // wait(rst_ni == 1'b1); - // @(posedge clk_i) - // $fwrite(f, $time); - // $fwrite(f, "\n"); - // $fwrite(f, "._________________________.\n"); - // for (int i = 0; i < NR_ENTRIES; i++) begin - // if (i == commit_pointer_q && i == issue_pointer_q && i == top_pointer_q) - // pointer = " <- top, issue, commit pointer"; - // else if (i == commit_pointer_q && i == issue_pointer_q) - // pointer = " <- issue, commit pointer"; - // else if (i == top_pointer_q && i == issue_pointer_q) - // pointer = " <- top, issue pointer"; - // else if (i == top_pointer_q && i == commit_pointer_q) - // pointer = " <- top, commit pointer"; - // else if (i == top_pointer_q) - // pointer = " <- top pointer"; - // else if (i == commit_pointer_q) - // pointer = " <- commit pointer"; - // else if (i == issue_pointer_q) - // pointer = " <- issue pointer"; - // else - // pointer = ""; - // $fwrite(f, "|_________________________| %s\n", pointer); - // end - // $fwrite(f, "\n"); - // end - // $fclose(f); - // end + // check that no functional unit is retiring with the same transaction id + for (genvar i = 0; i < NR_WB_PORTS; i++) begin + for (genvar j = 0; j < NR_WB_PORTS; j++) begin + assert property ( + @(posedge clk_i) wb_valid_i[i] && wb_valid_i[j] && (i != j) |-> (trans_id_i[i] != trans_id_i[j])) + else $error ("Two or more functional units are retiring instructions with the same transaction id!"); + end + end `endif `endif endmodule