Тёмный

Introduction to FPGA Part 10 - Metastability and Clock Domain Crossing | Digi-Key Electronics 

DigiKey
Подписаться 153 тыс.
Просмотров 23 тыс.
50% 1

A field-programmable gate array (FPGA) is an integrated circuit (IC) that lets you implement custom digital circuits. You can use an FPGA to create optimized digital logic for things like digital signal processing (DSP), machine learning, and cryptocurrency mining. Because of the FPGA’s flexibility, you can often implement entire processors using its digital logic. You can find FPGAs in consumer electronics, satellites, and in servers used to perform specialized calculations.
In this series, we will see how an FPGA works and demonstrate how to create custom digital logic using the Verilog hardware description language (HDL).
Previously, we showed how to use a phase-locked loop (PLL) to increase clock speed as well as introduced the concept of glitches. In this episode, we examine how setup and hold time violations can cause metastability in flip-flops.
The solution to the challenge at the end of the episode can be found here: www.digikey.com/en/maker/proj...
All code examples and solutions for this series can be found here: github.com/ShawnHymel/introdu...
Colin O’Flynn’s metastability experiment: colinoflynn.com/2020/12/exper...
Better clock divider example: github.com/ShawnHymel/introdu...
Better button debounce design: github.com/ShawnHymel/introdu...
Clifford Cummings’s FIFO paper: www.sunburst-design.com/papers...
A flip-flop requires the input signal to be steady for some time before the clock edge (setup time) and remain steady for some time after the clock edge (hold time). If the input signal transitions during the setup or hold windows, then it is considered a timing violation. This could potentially cause metastability on the flip-flop, where the output remains in an unknown state for some indeterminate amount of time.
Normally, the metastable output will settle on logic high or logic low quickly (within a few nanoseconds), but it is not guaranteed. Metastable events can cause potentially catastrophic failures in a design and can be very difficult to track down due to their probabilistic nature.
The standard fix to mitigate the likelihood and impact of metastability is to use a synchronizer circuit, which consists of 2 or more flip-flops chained together. The input of one flip-flop samples the output of another. Note that this introduces an extra clock cycle of delay for each flip-flop you put in the chain.
A first-in, first-out (FIFO) system is one way to pass data from one class domain to another. Elements are read from the FIFO in the order in which they were written. We can use dual-port block RAM to construct a FIFO in our iCE40. Your challenge is to implement Clifford Cummings’s FIFO design and test it via simulation.
Product Links:
www.digikey.com/en/products/d...
Related Videos:
• Cyclone® III FPGA
• Power Management: Powe...
• FPGA's: Low-Cost, High...
Related Project Links:
www.digikey.com/en/maker/proj...
Related Articles:
www.digikey.com/en/pdf/r/rene...
www.digikey.com/en/videos/d/d...
Learn more:
Maker.io - www.digikey.com/en/maker
Digi-Key’s Blog - TheCircuit www.digikey.com/en/blog
Connect with Digi-Key on Facebook / digikey.electronics
And follow us on Twitter / digikey

Наука

Опубликовано:

 

16 янв 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@a1nelson
@a1nelson 2 года назад
This series impressively well-conceived and well executed. I have found many gems and overall find the series to be genuinely practical and directly useful. Many thanks.
@conorstewart2214
@conorstewart2214 2 года назад
Can I ask if possible you make this a longer series and delve into the more complex areas of FPGAs and digital design. Your tutorials are very well made and very informative and you explain things in a very easy to understand way.
@VCodes
@VCodes 2 месяца назад
really amazing. very clear presentation. everyone who is starting out should watch this. even people who know HDL should give it a watch. thank you.
@rishab9761
@rishab9761 2 года назад
Great stuff. Really covering all the important topics. Keep going.
@TiNredstoner
@TiNredstoner 2 года назад
I'm having problem related to clock rn, you came just in time Shawn!
@matthewvenn
@matthewvenn 2 года назад
Great video - nice work Shawn!
@hjups
@hjups 2 года назад
Another great entry to this series! You should also have probably mentioned that many of the bigger vendors have built-in FIFO logic with their block RAMs (i.e. Intel and Xilinx). You're always better off using the built-in logic (unless there is a special need to not use it - such as reducing delay). The downside though, is that those FIFOs are not inferable and instead need to be instantiated via macro. Often the solution to make a design cross-platform is to wrap the FIFO implementation in a generic module, and include the relevant implementation for the given target (even across Xilinx chips for example, there is a different macro for the 6 series, 7 series, and Ultrascale series). FIFOs can also be used to pass generic control signals other than pure data. One method is to do delta-compression, where only bit-vector updates are pushed to the FIFO (so you encode the signal bit-vector with XOR when you push, and decode it with XOR when you pull. If you didn't do that and instead pushed every clock pulse, then you could easily overrun the FIFO). If you need bi-directional signals, you can use two FIFOs in either direction. One easy example where this is very useful, is VGA timings. If you have a VGA output driver (with variable clock and timing for different monitor resolutions), and a set frequency image generator (like a bitmap BLITer), you can use a FIFO to send synchronization signals such as "Start_of_frame", and "new_scanline", to keep the image generator in sync with a scanline buffer (that allows you to use a scanline buffer instead of a full frame-buffer). The only times I have ever used a synchronizer, where cases where the update can be fuzzy (i.e. glitching is acceptable). And doing so requires specialized timing constraints to prevent the P&R tool from complaining about timing violations (usually I use a false-path constraint, which will stochastically add delay to the synchronizer making it completely impractical for general clock domain crossing). Anyway, looking forward to the next episode!
@bertbrecht7540
@bertbrecht7540 2 года назад
I am so eager to run through this series myself starting from the beginning tutorial however I can't start without a board. Sorry if you have already addressed this a hundred times but I am guessing that until the chip shortage is over (in 3 years :)) we will just have to hang tight.
@voyagepourencontrerlemillion
@voyagepourencontrerlemillion 2 года назад
Thank you 👍
@neelkamalsemwal8684
@neelkamalsemwal8684 2 года назад
Everything good but you didn't explain how a synchronizer works. That's what I was searching for in the whole video but then it jumped to FIFO fsr.
@danielhoven570
@danielhoven570 10 месяцев назад
This is a big issue with high precision sensors, because you don't want sensor modulation frequencies to be harmonically synchronous with your demodulation system. So you have to decouple the two systems, and pass data between them asynchronously.
@rtrmpt
@rtrmpt 2 года назад
Using an asynchronous reset is also discouraged. You should only have a single process that converts your asynchronous reset to synchronous. The rest of your logic should run on the synchronous reset.
@ShawnHymel
@ShawnHymel 2 года назад
Good point, thanks! I've seen some chips that are fine with asynchronous reset, but I do agree that it makes more sense to use synchronous resets where possible.
@rtrmpt
@rtrmpt 2 года назад
@@ShawnHymel it helps most to assure that multiple circuits come out of reset at the same time.
Далее
Clock Domain Crossing Considerations
19:22
Просмотров 2 тыс.
These Chips Are Better Than CPUs (ASICs and FPGAs)
5:08
Crossing Clock Domains in an FPGA
16:38
Просмотров 65 тыс.
Clock Domain Crossing (CDC), Synchronizers and FIFOs
30:25
Handshake synchronizer (clock domain crossing)
5:17
Просмотров 17 тыс.
XDC 2019 | Everything Wrong With FPGAs - Ben Widawsky
1:03:20
Очень странные дела PS 4 Pro
1:00
Просмотров 422 тыс.