profiling optimizations

minor updates
This commit is contained in:
Blaise Tine
2023-12-05 05:12:13 -08:00
parent e5b41bcd66
commit 6c7ac35054
5 changed files with 65 additions and 42 deletions

View File

@@ -183,21 +183,23 @@ module VX_stream_xbar #(
per_cycle_collision = 0;
for (integer i = 0; i < NUM_INPUTS; ++i) begin
for (integer j = 1; j < (NUM_INPUTS-i); ++j) begin
if (valid_in[i] && valid_in[j+i] && sel_in[i] == sel_in[j+i]) begin
per_cycle_collision[i] |= ready_in[i] | ready_in[j+i];
end
per_cycle_collision[i] |= valid_in[i]
&& valid_in[j+i]
&& (sel_in[i] == sel_in[j+i])
&& (ready_in[i] | ready_in[j+i]);
end
end
end
wire [`CLOG2(NUM_INPUTS+1)-1:0] collision_count;
wire [`CLOG2(NUM_INPUTS+1)-1:0] collision_count, collision_count_r;
`POP_COUNT(collision_count, per_cycle_collision);
`BUFFER(collision_count_r, collision_count);
always @(posedge clk) begin
if (reset) begin
collisions_r <= '0;
end else begin
collisions_r <= collisions_r + PERF_CTR_BITS'(collision_count);
collisions_r <= collisions_r + PERF_CTR_BITS'(collision_count_r);
end
end