diff options
Diffstat (limited to 'fpga/usrp2/gpmc/cross_clock_reader.v')
-rw-r--r-- | fpga/usrp2/gpmc/cross_clock_reader.v | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fpga/usrp2/gpmc/cross_clock_reader.v b/fpga/usrp2/gpmc/cross_clock_reader.v index a8366badc..b4cdb79c5 100644 --- a/fpga/usrp2/gpmc/cross_clock_reader.v +++ b/fpga/usrp2/gpmc/cross_clock_reader.v @@ -27,18 +27,20 @@ module cross_clock_reader ); reg [WIDTH-1:0] shadow0, shadow1; + reg [2:0] count; always @(posedge clk) begin if (rst) begin out <= DEFAULT; shadow0 <= DEFAULT; shadow1 <= DEFAULT; + count <= 0; end - else if (shadow0 == shadow1) begin - out <= shadow1; - end + else if (shadow0 == shadow1) count <= count + 1; + else count <= 0; shadow0 <= in; shadow1 <= shadow0; + if (count == 3'b111) out <= shadow1; end endmodule //cross_clock_reader |