Give some slack time for other cores to finish
This commit is contained in:
@@ -495,20 +495,30 @@ module Vortex import VX_gpu_pkg::*; #(
|
|||||||
// .busy(busy)
|
// .busy(busy)
|
||||||
// );
|
// );
|
||||||
|
|
||||||
|
logic [31:0] finish_counter;
|
||||||
|
|
||||||
|
always @(posedge clock) begin
|
||||||
|
if (reset) begin
|
||||||
|
finish_counter <= 32'd0;
|
||||||
|
end else begin
|
||||||
|
if (finished) begin
|
||||||
|
finish_counter <= finish_counter + 32'd1;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
// give slack for other cores to finish
|
||||||
|
wire all_cores_finished = (finish_counter > 32'd1000);
|
||||||
|
|
||||||
|
`ifdef SIMULATION
|
||||||
always @(posedge clock) begin
|
always @(posedge clock) begin
|
||||||
if (!reset) begin
|
if (!reset) begin
|
||||||
|
if (all_cores_finished) begin
|
||||||
|
$display("simulation has probably ended. exiting");
|
||||||
|
$finish();
|
||||||
|
end
|
||||||
if (finished) begin
|
if (finished) begin
|
||||||
`ifdef SIMULATION
|
$display("---------------- core%2d has no more active warps ----------------", CORE_ID);
|
||||||
$display("---------------- core%2d has no more active warps ----------------", CORE_ID);
|
|
||||||
$display("simulation has ended. exiting");
|
|
||||||
$finish();
|
|
||||||
`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
|
||||||
@@ -525,6 +535,7 @@ module Vortex import VX_gpu_pkg::*; #(
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
|
|
||||||
endmodule : Vortex
|
endmodule : Vortex
|
||||||
|
|
||||||
|
|||||||
@@ -280,6 +280,8 @@ module VX_schedule import VX_gpu_pkg::*; #(
|
|||||||
assign gbar_bus_if.req_valid = gbar_req_valid;
|
assign gbar_bus_if.req_valid = gbar_req_valid;
|
||||||
assign gbar_bus_if.req_id = gbar_req_id;
|
assign gbar_bus_if.req_id = gbar_req_id;
|
||||||
assign gbar_bus_if.req_size_m1 = gbar_req_size_m1;
|
assign gbar_bus_if.req_size_m1 = gbar_req_size_m1;
|
||||||
|
// NOTE(hansung): since CORE_ID is global across multiple clusters, we
|
||||||
|
// need the modulo to get the per-cluster local core id
|
||||||
assign gbar_bus_if.req_core_id = `NC_WIDTH'(CORE_ID % `NUM_CORES);
|
assign gbar_bus_if.req_core_id = `NC_WIDTH'(CORE_ID % `NUM_CORES);
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user