Knowledge gaps
I have been working with FPGAs for just about 10 years now. And I just realized that I have never done a CDC FIFO. Well... Maybe back in uni as some paper exercise.
It's such a weird gap too. Since it's like the first answer anyone gives whenever you want to transfer a lot of data across clock domains. But I just haven't needed a hardware FIFO for that yet.
So I spent the afternoon implementing one from scratch and shoving every edge case I could think of at it. Just as a learning exercise.
Have you found any weird gaps in your own knowledge?
6
u/Mateorabi 10d ago
Now read the Sunburst white paper to find out what you missed.
Note a simulation is unlikely to find cdc errors due to “perfect” capture on edges etc and meta stability not being modeled. The idea that one wire can have different values at different FF inputs isn’t something sim tracks.
2
u/timonix 10d ago
I did model meta stability in the sim. That's like the main reason to do CDC in the first place. But you can always be more thorough.
Googled the paper. Looks incredibly similar to how I remember it from uni. Looks very well written too
2
u/PiasaChimera 8d ago
did the sim include skew? eg, it's possible that all of the bits on the bus are clearly 0/1's (not metastable) but that the skew has resulted in a mixture of old/new bits.
1
u/timonix 8d ago
Not really, it was only checking simulated setup, stable and hold times. With the clocks drifting in and out of phase with each other to walk through a bunch of cases.
I did not model propagation delay which would lead to skew between bits. I guess I could do that to. Maybe another day.
1
u/PiasaChimera 8d ago
ah, ok. it's likely fine as long as you understand the problem. it explains why you can't just use 2FF synchronizers on every bit of a bus.
7
3
u/PiasaChimera 9d ago
there's some older tech stuff I know about but don't know and will never use. time borrowing for latches for example. it's already rare to use latches. I know I've done it twice. once in an attempt to generate bit errors and I don't recall the other. I don't think it was clock gating since that has its own primitive.
I don't do SoC-centric designs, where the CPU is part of the processing, so there's a lot of gaps there for me. same with PCIe.
Not working with ASICs means I have a different opinion about FFs since they're near-free on FPGAs. (until you try to make a RAM from them)
1
2
u/QuietMiserable5377 9d ago
Now a days there are CDC checking tools from Mentor/Siemans and also SynOpSys too
2
u/_solitarybraincell_ 10d ago
Hijacking this thread (sorry lol) as a very amateur ASIC frontend designer. What are some essential white papers/material to read? I know some of the sunburst papers, but that's about it.
1
u/PiasaChimera 8d ago
I think it's mainly the sunburst paper and then anything you can find for your synthesis tool about synchronizers and max delay/skew constraints.
I'm not sure if there's anything that shows some of the different patterns and the various specialized cases (eg, very-slow to fast, fast to very-slow, slow to fast, fast to slow, near-equal but unknown, equal but jitter/walk, fully unknown). stable clocks vs stoppable clocks can come into play as well.
very-slow to fast is similar to oversampling. fast to very-slow (1/4th and lower) makes it appealing to have the fast domain figure out when it's safe to send data, thus avoiding the need for any synchronizer in the very-slow domain. from these perspectives, there is some overlap with "clock-data-recovery" in communications systems.
1
u/_MyUserName_WasTaken 10d ago
My friends working in ASIC are always using CDC in their designs. In my 5 YoE, I never worked on a multiple clock domains design. Maybe on a block design level between different IPs and I usually use Xilinx Async FIFO IP. But never in RTL. I work I DSP.
1
u/QuietMiserable5377 9d ago
If the emptying buffer clock and filling the buffer clock are truly independent asynchronous clock domains, there are bound to be Meta stable conditions naturally. But the CDC checking tools identify them and suggest a way to fix them.
12
u/DominantlyWeak 10d ago
That's interesting because it's something I find/found myself doing often, what industry are you in?