::std::

Module cdc

Expand

This module contains primitives for clock domain crossing.

Clock domain crossing is difficult to get right, and all of these modules come with pitfalls (for example, the possibility to miss some signals if transferring between domains of similar speed).

Make sure to read the docs of each individual module.

Modules

handshake_impl
sync_wide_impl

Entities

handshake

Synchronize data from clk1 to clk2 via handshaking. Primarily to be used to cross domains of similar speed. A single pulse on data in clk1 results in a single output in clk2. If data is active for more than one cycle, the behaviour is undefined. Likewise if data occurs too frequently, i.e. within a few clock cycles in the slowest domain

sync2

NOTE: This function does not provide any guarantees about value integrity for / signals of more than one bit as crossing 2 domains with multi-bit signals can cause issues. It is primarily intended for other synchronization primitives

sync2_bool

Synchronize a bool signal into another domain. This guarantees valid values, but does not guarantee that all values are transferred. If synchronizing a short pulse where seeing the pulse is important, handshake may be better

sync_uint_counter

Synchronizes a uint counter signal between domains. The counter aspect is important, it must be a N bit gray counter for this to do anything useful.

sync_wide

Synchronizes a wide value from the source domain into the destination domain. This guarantees that all values sent between the domains are valid, but some values may be skipped