Reset cache_ctrl state after a kill_req_i (#38)

This commit is contained in:
Matheus Cavalcante 2018-04-11 10:14:42 +02:00 committed by Florian Zaruba
parent 62fc4bd816
commit aaea06eba0
2 changed files with 14 additions and 49 deletions

View file

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

View file

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