debugging shaper

This commit is contained in:
otroubi
2026-07-27 19:25:09 +03:00
parent 806bab9520
commit fd4b17be0d
+15 -11
View File
@@ -16,11 +16,13 @@ module shaper_axis_status #(
typedef enum logic [0:0] { typedef enum logic [0:0] {
IDLE, IDLE,
WAIT_VALID WAIT_TAKE
} wr_state; } wr_state;
wr_state state; wr_state state;
logic [31:0] data_reg;
always @(posedge clk) begin always @(posedge clk) begin
if (!rst_n) begin if (!rst_n) begin
state <= IDLE; state <= IDLE;
@@ -28,22 +30,24 @@ always @(posedge clk) begin
busy <= 1'b0; busy <= 1'b0;
handshake <= 1'b0; handshake <= 1'b0;
data_out <= '0; data_out <= '0;
data_reg <= '0;
end else begin end else begin
case (state) case (state)
IDLE: begin IDLE: begin
handshake <= 1'b0; ready <= 1'b1;
if (take) begin if (valid) begin
ready <= 1'b1; busy <= 1'b0;
busy <= 1'b1; data_reg <= data_in;
state <= WAIT_VALID; handshake <= 1'b1;
state <= WAIT_TAKE;
end end
end end
WAIT_VALID: begin WAIT_TAKE: begin
if (valid) begin if (take) begin
data_out <= data_in; data_out <= data_reg;
ready <= 1'b0; ready <= 1'b0;
handshake <= 1'b1; handshake <= 1'b0;
busy <= 1'b0; busy <= 1'b1;
state <= IDLE; state <= IDLE;
end end
end end