zoukankan      html  css  js  c++  java
  • Clocks and Global lines

     

    转自:http://www.fpga4fun.com/FPGAinfo5.html

    Clocks and Global lines

    An FPGA design is usually "synchronous". Simply put, that means that the design is clock based - each clock rising edge allows the D-flipflops to take a new state.

    In a synchronous design, a single clock may drive a lot of flipflops simultaneously. That can cause timing and electrical problems inside the FPGA. To get that working properly, FPGA manufacturers provide special internal wires called "global routing" or "global lines". They allow distributing the clock signal all over the FPGA with a low skew (i.e. the clock signal appears almost simultaneously to all the flipflops).

    When you feed a clock signal to your FPGA, you shouldn't use any FPGA pin, but use a dedicated input clock pin. Usually, only such pin has the ability to drive a global line. FPGA software are aware of these dedicated input pins, and will automatically assign clocks to them if given the choice.

    Clock domains

    An FPGA can use multiple clocks (using multiple global lines and dedicated input pins). Each clock forms a "clock domain" inside the FPGA.

    Flipflops and combinatorial logic in each clock domain

    For each flipflop inside the FPGA, its clock domain is easy to determine. Just look at the flipflop clock input.
    But what about the combinatorial logic that sits in between flipflops?

    • If there is some combinatorial logic in between "same clock domain" flipflops, the logic is said to be part of the clock domain too.
    • If there is some combinatorial logic in between "different clock domains" flipflops, the logic is not owned by any clock domain. But in a typical FPGA design, there is no such logic; the only paths from different clock domains are synchronizers.
    Clock domain speeds

    For each clock domain, the FPGA software will analyze all flop-to-flop paths and give you a report with the maximum allowed frequencies. In the general case, only the paths from within each clock domains are analyzed. The synchronizer paths (from different clock domains) usually don't matter and are not analyzed.

    One clock domain may work at 10MHz, while another may work at 100MHz. As long as each clock uses a global line, and you use clock speeds that are lower than the maximums reported by the software, you don't have to worry about internal timing issues, the design is guaranteed to work internally timing-wise.

    There may still be some timing issues from the FPGA input and output pins though. The software will give you a report about that. See also the next section.

    Signals between clock domains

    If you need to send some information across different clock domains, special considerations need to apply.

    In the general case, if your clocks have no relationship with one another, you cannot use a signal generated from one clock domain into another as-is. Doing so would violate setup and hold flipflop timings (in the destination clock domain), and cause metastability.

    Crossing clock domains requires special techniques, like the use of synchronizers (that's simple), or FIFOs (that's more complicated). See the fpga4fun's Crossing clock domains project to get some practical ideas, or these external links here, here and here.


  • 相关阅读:
    【Linux】防火墙命令
    【MySQL】mysql分组后重命名
    【SpringBoot】全局配置Long转String,解决前端接收时精度丢失的问题
    【VSCode】vscode运行命令时提示“因为在此系统上禁止运行脚本”
    【Mybatis】mybatisplus代码生成器【逆向工程】搭配Lombok和swagger2
    【Linux】赋予root权限
    【MySQL】mysql模糊匹配多个字段
    idea为新创建的类增加个人注释模板
    【Linux】学习笔记:(一)常用命令大全
    Navicat查看数据库的密码
  • 原文地址:https://www.cnblogs.com/xinjie/p/1522785.html
Copyright © 2011-2022 走看看