09-03-2020 12:26 AM
Conventionally, cascaded two latches/flip-flops are used for avoiding metastable state. But I am wondering if it is alternatively possible to replace the second latch/flip-flop with the LDCE described as below.
Could you please tell me your opinion or advice?
LDCE #( .INIT(1'b0) // Initial value of latch (1'b0 or 1'b1) ) LDCE_inst1b ( .Q(output_to_my_circuit), // Data output .CLR(RESET), // Asynchronous clear/reset input .D(input_from_1st_latch), // Data input .G(1'b1), // Gate input .GE(1'b1) // Gate enable input );
I am trying to use this in a part of asynchronous circuits.
09-03-2020 01:10 AM
You won't avoid metastability by using a latch instead of a D-flip flop. The origin of metastability is because data is captured when transitioning, so at an invalid level (not 0, not 1). The difference between a latch and a flip flop is that one captures data with a level, the other with a rising/ falling edge. Because data is asynchronous, you don't know when it will transition, so you can't sync either your edges or your latch capture signals. Same problem.
09-03-2020 01:15 AM
You may be thinking that a latch will capture whatever and then somehow you will find when your data is stable then toggle the latch gate to capture data. The problem is because data is asynchronous, it may also change when you toggle the gate and you are screwed up again... there's no way, I'm afraid. Asynchronous data is a problem only solvable if you can foresee the future.
09-03-2020 03:50 AM
I would suggest taking advantage of the Xilinx Parameterizable Macros (XPMs) specifically for Clock Domain Crossing (CDC) to mitigate metastability.
You can find details on the XPM_CDC XPMs in the following documentation:
The XPMs handle the low level properties (i.e. ASYNC_REG) that must be attached to the FFs used to synchronize the signals that cross clock domains. The presence of the ASYNC_REG attribute on these registers prevents the tool from replicating these registers as well as keeping them physically located together. You can also reference the following documentation for details:
09-07-2020 10:31 PM
09-08-2020 12:21 AM
Thank you for your suggestion on XPMs and ASYNC_REG.
The documents you guided told me that there must be a clock signal to use the ASYNC_REG attribute, but I unfortunately have no clock in my circuit.
Actually, the figure below shows my target circuit in which I want to avoid the metastability.
(When I posted here last time, I was going to replace the second quasi-SR-latch with the LDCE.)
INA and INB signals change asynchronously, and there are no clocks.
Could you please tell me how to use ASYNC_REG properly in this kind of circuits?
Or if there are any workarounds, could you please let me know about them?