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 the domain of
from_clktoto_clkvia handshaking. Primarily to be used to cross domains of similar speed. A single-cycle pulse on data infrom_clkresults in a single-cycle output into_clk.- 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,
handshakemay 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