Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Clock Crossing and FIFOs

Hello all,

I am having a custom design in handwritten VHDL and a design implemented in DSP Builder and they interface using some 16bit signals BUT running on different clocks.

I was wondering what kind of synchronization I should use for this interface. I suspect I should use the dual clock FIFO IP but I am not sure if this is the suggested way. Also if the difference in the clocks is 100MHz and 150MHz and the sample ratio of the DSP Builder module is in the rate of kHz then how deep should the FIFO be? I am not expecting any overflow and I do not need any real FIFO functionality just the snychronization of the two clock domains for a bulk of data signals.

Regards

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    In general a FIFO is a good way to go. You'll have to figure out how deep it needs to be.

    If only one transaction ever happens at a time you don't need a FIFO. When the data source has data to transfer it asserts a flag (call it data_ready). The data sink will synchronize that signal and monitor the synchronized version (call it data_ready_sync). When the data sink sees data_ready_sync go high it latches the data then asserts a flag back to the data source (call it data_ready_ack). The data source synchronizes this signal and monitors the synchronized version (call is data_ready_ack_sync). When the data source sees data_ready_ack_sync go high it knows the data sink has latched the data and it can now deassert data_ready. Then when the data sink sees data_ready_sync go low it can deassert data_ready_ack and the transaction is complete.

    Sounds a little convoluted when written out like this but drawn on paper it's very simple. This only works if each transaction always completes before a new data word is ready. Otherwise a FIFO is the way to go.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually I just need to transfer a bundle of data between the clock domains one at a time. So I think you are right. The procedure you describe is the way to go and thank you so much for it!!