Skip to content

Commit a0bb64a

Browse files
committed
fix transitions
1 parent b786319 commit a0bb64a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/guass-pyramid/ready-val/valid-hold.sv

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ module Blur#(
314314
input logic clk,
315315
input logic reset,
316316

317+
output logic[1:0] state,
318+
317319
input logic valid_i,
318320
output logic ready_i,
319321
input logic[D0-1:0][D1-1:0][7:0] in,
@@ -341,6 +343,7 @@ Conv2D#(.N(N)) conv2d(
341343
localparam Idle=0, Send_Conv=1, Recv_Conv=2, Writing=3;
342344

343345
logic[1:0] st, nxt_st;
346+
assign state = st;
344347
always_ff @(posedge clk) begin
345348
if (reset) st <= '0;
346349
else st <= nxt_st;
@@ -354,15 +357,18 @@ always_comb begin
354357
end
355358
Send_Conv: if (conv_ready_i) nxt_st = Recv_Conv;
356359
Recv_Conv: begin
357-
if (valid_o) begin
360+
if (conv_valid_o) begin
358361
if (last_chunk) nxt_st = Writing;
359362
else nxt_st = Send_Conv;
360363
end
361364
end
362-
Writing: if (ready_o) nxt_st = Recv_Conv;
365+
Writing: if (ready_o) nxt_st = Idle;
363366
endcase
364367
end
365368

369+
// Send the ready signal to the convolution module.
370+
assign conv_ready_o = st == Recv_Conv;
371+
366372
// The current image we are working on. We latch the value when a valid input
367373
// is accepted.
368374
logic[D1-1:0][D1-1:0][7:0] image;

0 commit comments

Comments
 (0)