core_wrapper: Use finished and !reset to determine termination

This commit is contained in:
Hansung Kim
2024-06-11 16:27:23 -07:00
parent de10d5a957
commit 5218292b6f

View File

@@ -495,15 +495,20 @@ module Vortex import VX_gpu_pkg::*; #(
// .busy(busy) // .busy(busy)
// ); // );
always @(*) begin always @(posedge clock) begin
if (busy === 1'b0) begin if (!reset) begin
$display("---------------- no more active warps ----------------"); if (finished) begin
`ifdef SIMULATION `ifdef SIMULATION
if ($time >= 60000) begin $display("---------------- core%2d has no more active warps ----------------", CORE_ID);
$display("simulation has probably ended. exiting"); $display("simulation has ended. exiting");
@(posedge clock) $finish(); $finish();
end
`endif `endif
// `ifdef SIMULATION
// if ($time >= 60000) begin
// $display("simulation has probably ended. exiting");
// @(posedge clock) $finish();
// end
// `endif
// TODO: lane assumed to be 4 // TODO: lane assumed to be 4
// `ifndef SYNTHESIS // `ifndef SYNTHESIS
// for (integer j = 0; j < `NUM_WARPS; j++) begin // for (integer j = 0; j < `NUM_WARPS; j++) begin
@@ -519,6 +524,7 @@ module Vortex import VX_gpu_pkg::*; #(
// @(posedge clock) $finish(); // @(posedge clock) $finish();
end end
end end
end
endmodule : Vortex endmodule : Vortex