Skip to content

Commit

Permalink
cdc_4phase: remove synch bypass for DECOUPLED
Browse files Browse the repository at this point in the history
The previous implementation creates a non-synchronized path
across the CDC, making it significantly more vulnerable
to metastability.

This does not seem to be necessary for DECOUPLED to work in
the cdc_2phase_clearable (cdc_reset_ctrlr).
The important thing seems to be when on the source side the
ready signal is asserted, not how the destination side
synchronizes data.
  • Loading branch information
phsauter committed Oct 11, 2024
1 parent 7d3af4b commit 83e1e15
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions src/cdc_4phase.sv
Original file line number Diff line number Diff line change
Expand Up @@ -298,27 +298,19 @@ module cdc_4phase_dst #(
end
end

if (DECOUPLED) begin : gen_decoupled
// Decouple the output from the asynchronous data bus without introducing
// additional latency by inserting a spill register
spill_register #(
.T(T),
.Bypass(1'b0)
) i_spill_register (
.clk_i,
.rst_ni,
.valid_i(data_valid),
.ready_o(output_ready),
.data_i(async_data_i),
.valid_o,
.ready_i,
.data_o
);
end else begin : gen_not_decoupled
assign valid_o = data_valid;
assign output_ready = ready_i;
assign data_o = async_data_i;
end
spill_register #(
.T(T),
.Bypass(1'b0)
) i_spill_register (
.clk_i,
.rst_ni,
.valid_i(data_valid),
.ready_o(output_ready),
.data_i(async_data_i),
.valid_o,
.ready_i,
.data_o
);

// Output assignments.
assign async_ack_o = ack_dst_q;
Expand Down

0 comments on commit 83e1e15

Please sign in to comment.