feat: replace reg delay value to the marcro define

This commit is contained in:
maksyuki committed 2024-08-16 12:19:31 +08:00
1 parent a8af6b3359
commit ac5ccade08
5 files changed
+34 -27

No files matched your search

+7 -6
View File
@@ -26,6 +26,7 @@
`ifndef INC_CDC_TWOPHASE_SV
`define INC_CDC_TWOPHASE_SV
`include "setting.sv"
`include "register.sv"
`include "cdc_sync.sv"
@@ -161,13 +162,13 @@ module cdc_2phase_dst #(
// The req_dst and req registers act as synchronization stages.
always_ff @(posedge clk_i or negedge rst_n_i) begin
if (!rst_n_i) begin
r_req_dst_q <= '0;
r_req_q0 <= '0;
r_req_q1 <= '0;
r_req_dst_q <= #`REGISTER_DELAY '0;
r_req_q0 <= #`REGISTER_DELAY '0;
r_req_q1 <= #`REGISTER_DELAY '0;
end else begin
r_req_dst_q <= async_req_i;
r_req_q0 <= r_req_dst_q;
r_req_q1 <= r_req_q0;
r_req_dst_q <= #`REGISTER_DELAY async_req_i;
r_req_q0 <= #`REGISTER_DELAY r_req_dst_q;
r_req_q1 <= #`REGISTER_DELAY r_req_q0;
end
end