mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-09 00:48:40 -08:00
stats: Add gate input to statistics collector
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -214,6 +214,7 @@ tx_stats_inst (
|
||||
/*
|
||||
* Control inputs
|
||||
*/
|
||||
.gate(1'b1),
|
||||
.update(1'b0)
|
||||
);
|
||||
|
||||
@@ -372,6 +373,7 @@ rx_stats_inst (
|
||||
/*
|
||||
* Control inputs
|
||||
*/
|
||||
.gate(1'b1),
|
||||
.update(1'b0)
|
||||
);
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ module taxi_stats_collect #
|
||||
/*
|
||||
* Control inputs
|
||||
*/
|
||||
input wire logic gate = 1'b1,
|
||||
input wire logic update = 1'b0
|
||||
);
|
||||
|
||||
@@ -100,13 +101,13 @@ for (genvar n = 0; n < CNT; n = n + 1) begin : ch
|
||||
|
||||
always_ff @(posedge clk) begin
|
||||
if (acc_clear[n]) begin
|
||||
if (stat_valid[n]) begin
|
||||
if (stat_valid[n] && gate) begin
|
||||
acc_reg <= ACC_W'(stat_inc[n]);
|
||||
end else begin
|
||||
acc_reg <= '0;
|
||||
end
|
||||
end else begin
|
||||
if (stat_valid[n]) begin
|
||||
if (stat_valid[n] && gate) begin
|
||||
acc_reg <= acc_reg + ACC_W'(stat_inc[n]);
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user