Skip to content

Commit 1843da0

Browse files
committed
remove redundant 'commented-out' old code
1 parent 217d0ed commit 1843da0

File tree

6 files changed

+1
-79
lines changed

6 files changed

+1
-79
lines changed

hw/rtl/core/VX_schedule.sv

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ module VX_schedule import VX_gpu_pkg::*; #(
8787
// barriers
8888
reg [`NUM_BARRIERS-1:0][`NUM_WARPS-1:0] barrier_masks, barrier_masks_n;
8989
reg [`NUM_BARRIERS-1:0][NW_WIDTH-1:0] barrier_ctrs, barrier_ctrs_n;
90-
// reg [`NUM_WARPS-1:0] barrier_stalls, barrier_stalls_n;
9190
reg [`NUM_WARPS-1:0] curr_barrier_mask_p1;
9291

9392
// async barriers (things I think should be kept separate state from sync barrier)
@@ -115,7 +114,6 @@ module VX_schedule import VX_gpu_pkg::*; #(
115114
thread_masks_n = thread_masks;
116115
barrier_masks_n = barrier_masks;
117116
barrier_ctrs_n = barrier_ctrs;
118-
// barrier_stalls_n= barrier_stalls;
119117
warp_pcs_n = warp_pcs;
120118

121119
// async barrier next state
@@ -168,27 +166,10 @@ module VX_schedule import VX_gpu_pkg::*; #(
168166

169167
// barrier handling
170168
curr_barrier_mask_p1 = '0;
171-
// curr_barrier_mask_p1 = barrier_masks[warp_ctl_if.barrier.id];
172-
// curr_barrier_mask_p1[warp_ctl_if.wid] = 1;
173169
if (warp_ctl_if.valid && warp_ctl_if.barrier.valid) begin
174170
curr_barrier_mask_p1 = barrier_masks[warp_ctl_if.barrier.id];
175171
curr_barrier_mask_p1[warp_ctl_if.wid] = 1;
176172

177-
// if (~warp_ctl_if.barrier.is_noop) begin
178-
// if (~warp_ctl_if.barrier.is_global
179-
// && (barrier_ctrs[warp_ctl_if.barrier.id] == NW_WIDTH'(warp_ctl_if.barrier.size_m1))) begin
180-
// barrier_ctrs_n[warp_ctl_if.barrier.id] = '0; // reset barrier counter
181-
// barrier_masks_n[warp_ctl_if.barrier.id] = '0; // reset barrier mask
182-
// stalled_warps_n &= ~barrier_masks[warp_ctl_if.barrier.id]; // unlock warps
183-
// stalled_warps_n[warp_ctl_if.wid] = 0; // unlock warp
184-
// end else begin
185-
// barrier_ctrs_n[warp_ctl_if.barrier.id] = barrier_ctrs[warp_ctl_if.barrier.id] + NW_WIDTH'(1);
186-
// barrier_masks_n[warp_ctl_if.barrier.id] = curr_barrier_mask_p1;
187-
// end
188-
// end else begin
189-
// stalled_warps_n[warp_ctl_if.wid] = 0; // unlock warp
190-
// end
191-
192173
case (warp_ctl_if.barrier.op)
193174
BARRIER_OP_SYNC: begin
194175
if (~warp_ctl_if.barrier.is_noop) begin

hw/rtl/core/VX_wctl_unit.sv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ module VX_wctl_unit import VX_gpu_pkg::*; #(
3232
localparam PID_BITS = `CLOG2(`NUM_THREADS / NUM_LANES);
3333
localparam WCTL_WIDTH = $bits(tmc_t) + $bits(wspawn_t) + $bits(split_t) + $bits(join_t) + $bits(barrier_t);
3434

35-
// localparam DATAW = UUID_WIDTH + NW_WIDTH + NUM_LANES + PC_BITS + NUM_REGS_BITS + 1 + PID_WIDTH + 1 + 1 + DV_STACK_SIZEW + `XLEN + 1;
36-
3735
`UNUSED_VAR (execute_if.data.rs3_data)
3836

3937
tmc_t tmc;

kernel/include/vx_spawn.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ void vx_serial(vx_serial_cb callback, const void * arg);
7575
//////////////////////////////////////////////////////////////////////////////
7676

7777
// CTA-level async barrier
78-
// Usage:
79-
// barrier bar;
80-
// bar.init(num_warps);
81-
// uint32_t token = bar.arrive(); // returns token (generation number)
82-
// bar.wait(token); // wait until generation > token
8378
class barrier {
8479
public:
8580
// Constructor

sim/simx/emulator.cpp

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,6 @@ uint32_t Emulator::barrier_arrive(uint32_t bar_id, uint32_t count, uint32_t wid)
306306
// Capture current generation as token BEFORE any updates
307307
uint32_t token = b.generation;
308308

309-
std::cout << "[ARRIVE] warp=" << wid
310-
<< " gen =" << b.generation
311-
<< " token=" << token
312-
<< " expect =" << b.expect_count
313-
<< " arrived_count =" << b.arrived_count
314-
<< " arrived_mask =" << b.arrived_mask
315-
<< std::endl;
316-
317309
// If arrived in the same generation before, skip but still return token
318310
if (b.arrived_mask.test(wid)) {
319311
std::cout << " >> ARRIVE_DUP warp=" << wid << " (already arrived this gen)\n";
@@ -324,18 +316,11 @@ uint32_t Emulator::barrier_arrive(uint32_t bar_id, uint32_t count, uint32_t wid)
324316
b.arrived_mask.set(wid);
325317
++b.arrived_count;
326318

327-
std::cout << " [ARRIVE_UPDATE] warp=" << wid
328-
<< " arrived_count=" << b.arrived_count
329-
<< " arrived_mask=" << b.arrived_mask
330-
<< std::endl;
331319

332320
// If all warps arrived, update the generation
333321
if (b.arrived_count == b.expect_count) {
334322
uint32_t new_gen = b.generation + 1;
335323

336-
std::cout << " [GENERATION COMPLETE]: gen="
337-
<< b.generation << " -> " << new_gen << std::endl;
338-
339324
b.generation = new_gen;
340325
b.arrived_count = 0;
341326
b.arrived_mask.reset();
@@ -345,9 +330,6 @@ uint32_t Emulator::barrier_arrive(uint32_t bar_id, uint32_t count, uint32_t wid)
345330
if (b.waiting_mask.test(w)) {
346331
// Check if this warp's token indicates it should wake up
347332
// A warp waiting with token T should wake when generation > T
348-
std::cout << " [CHECK WAKE warp] =" << w
349-
<< " now_gen =" << b.generation
350-
<< std::endl;
351333
b.waiting_mask.reset(w);
352334
stalled_warps_.reset(w);
353335
}
@@ -381,43 +363,21 @@ bool Emulator::barrier_wait(uint32_t bar_id, uint32_t token, uint32_t wid) {
381363
// We need to wait until generation > token (i.e., that phase completed)
382364
uint32_t desired_gen = token + 1;
383365

384-
std::cout << "[WAIT] warp=" << wid
385-
<< " token=" << token
386-
<< " desired_gen=" << desired_gen
387-
<< " current_gen=" << b.generation
388-
<< " arrived_mask=" << b.arrived_mask
389-
<< " waiting_mask=" << b.waiting_mask
390-
<< std::endl;
391-
392366
if (b.generation >= desired_gen) {
393-
std::cout << "[WAIT_DONE] warp=" << wid
394-
<< " reaches gen=" << b.generation
395-
<< " (desired=" << desired_gen << ", token=" << token << ")"
396-
<< std::endl;
367+
397368

398369
b.waiting_mask.reset(wid);
399370
stalled_warps_.reset(wid);
400371

401-
std::cout << "waiting_mask(after pass)="
402-
<< b.waiting_mask
403-
<< std::endl;
404372

405373
return true;
406374
}
407375

408376
// Not reached, wait
409-
std::cout << " warp " << wid
410-
<< " waiting for gen " << desired_gen
411-
<< " (current gen=" << b.generation << ", token=" << token << ")"
412-
<< std::endl;
413377

414378
b.waiting_mask.set(wid);
415379
stalled_warps_.set(wid);
416380

417-
std::cout << "waiting_mask(after stall)="
418-
<< b.waiting_mask
419-
<< std::endl;
420-
421381
return false;
422382
}
423383

sim/simx/execute.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,9 +1391,6 @@ instr_trace_t* Emulator::execute(const Instr &instr, uint32_t wid) {
13911391
trace->data = std::make_shared<SfuTraceData>(rs1_data[thread_last].i, rs2_data[thread_last].i);
13921392
} break;
13931393
case WctlType::BAR_ARRIVE: {
1394-
// Asynchronous arrive - non-blocking
1395-
// rs1 = barrier_id, rs2 = num_warps
1396-
// Returns token (current generation) in rd
13971394
uint32_t bar_id = rs1_data[thread_last].u;
13981395
uint32_t count = rs2_data[thread_last].u;
13991396
uint32_t token = this->barrier_arrive(bar_id, count, wid);
@@ -1405,14 +1402,9 @@ instr_trace_t* Emulator::execute(const Instr &instr, uint32_t wid) {
14051402
rd_write = true;
14061403
} break;
14071404
case WctlType::BAR_WAIT: {
1408-
// Asynchronous wait - blocking if barrier generation <= token
1409-
// rs1 = barrier_id, rs2 = token (from previous arrive)
14101405
uint32_t bar_id = rs1_data[thread_last].u;
14111406
uint32_t token = rs2_data[thread_last].u;
1412-
// bool ready = this->barrier_wait(bar_id, token, wid);
1413-
// if (!ready) {
14141407
trace->fetch_stall = true; // Stall until barrier reaches next generation
1415-
// }
14161408
trace->data = std::make_shared<SfuTraceData>(bar_id, token);
14171409
} break;
14181410
case WctlType::PRED: {

sim/simx/func_unit.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,16 +398,12 @@ void SfuUnit::tick() {
398398
}
399399
} break;
400400
case WctlType::BAR_ARRIVE: {
401-
// Arrive is non-blocking, just pass through the pipeline
402-
// Barrier logic and token generation happen in execute.cpp
403401
output.send(trace, 2+delay);
404402
} break;
405403
case WctlType::BAR_WAIT: {
406404
output.send(trace, 2+delay);
407405
if (trace->eop) {
408406
auto trace_data = std::dynamic_pointer_cast<SfuTraceData>(trace->data);
409-
// arg1 = barrier_id, arg2 = token (from arrive)
410-
// Re-check if barrier is ready, for warp scheduling
411407
release_warp = core_->barrier_wait(trace_data->arg1, trace_data->arg2, trace->wid);
412408
}
413409
} break;

0 commit comments

Comments
 (0)