From 574708bd8900eb019782247a5b3dbe1cb6ccd6c4 Mon Sep 17 00:00:00 2001 From: liangkangnan Date: Wed, 1 Sep 2021 14:12:21 +0800 Subject: [PATCH] rtl:utils:gen_buf: add handle for DP=0 Signed-off-by: liangkangnan --- rtl/utils/gen_buf.sv | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtl/utils/gen_buf.sv b/rtl/utils/gen_buf.sv index 67a8a3b..9664a89 100644 --- a/rtl/utils/gen_buf.sv +++ b/rtl/utils/gen_buf.sv @@ -41,6 +41,10 @@ module gen_ticks_sync #( end endgenerate - assign dout = sync_dat[DP-1]; - + if (DP > 0) begin: dp_gt_0 + assign dout = sync_dat[DP-1]; + end else begin: dp_eq_0 + assign dout = din; + end + endmodule