Xilinx® 7 series FPGAs CLBs专题介绍(一)
背景
前面我们已经知道7 series FPGA的总体架构,其中包括CLBs,本篇博文根据赛灵思官方文档,专门介绍一下CLBs。
7 Series FPGAs Configurable Logic Block,简称CLB,也就是可编程逻辑块;
用户手册上说:
Usually, logic synthesis assigns the CLB resources without system designer intervention. It can be advantageous for the designer to understand certain CLB details, including the varying capabilities of the look-up tables (LUTs), the physical direction of the carry propagation, the number and distribution of the available flip-flops, and the availability of the very efficient shift registers.
意思是,通常来讲,逻辑综合分配CLB资源,无需系统设计人员干预。也就是说事实上,我们在设计一个FPGA电路时,通过赛灵思综合工具(XST)这一块会自动分配CLB资源,不需要设计者干预,但对于设计者来说,理解某些CLB细节是有利无害的,包括查找表的不同能力,进位传播的物理方向,可用触发器的数量以及分布,以及移位寄存器的有效性等。
因此,了解一下FPGA的底层架构之CLB是很有必要的。
CLB Overview
CLBs are the main logic resources for implementing sequential as well as combinatorial circuits. Each CLB element is connected to a switch matrix for access to the general routing matrix (shown in Figure 1-1). A CLB element contains a pair of slices.
CLBs是实现时序以及组合电路的主要逻辑资源,每个CLB都与一个开关矩阵相连以访问the general routing maxtrix,(这个矩阵是啥,我确定了再解释)。一个CLB包含一对slices,见下图,Slices以及Switch Matrix的分布情况:
从上面的介绍知道了CLB是由一对Slice组成,那么Slice又是什么组成的呢?
The LUTs in 7 series FPGAs can be configured as either a 6-input LUT with one output, or as two 5-input LUTs with separate outputs but common addresses or logic inputs. Each 5-input LUT output can optionally be registered in a flip-flop. Four such 6-input LUTs and their eight flip-flops as well as multiplexers and arithmetic carry logic form a slice, and two slices form a CLB. Four flip-flops per slice (one per LUT) can optionally be configured as latches. In that case, the remaining four flip-flops in that slice must remain unused.
我来解释下这段话:
Slice是由4个6输入的查找表(LUT,Look Up Table)、8个触发器(flip-flop)、多路复用器以及算数进位逻辑组成,然后两个Slice组成一个CLB。
每个Slice中有4个触发器(flip-flop)可以配置成锁存器(latch),但是在这种情况下,在该Slice中剩下的4个flip-flop不能被使用。
7 series FPGA的LUT可以被配置为6输入、1输出的LUT,或者有独立输出的两个5输入的LUT,这两个5输入的LUT共享地址和逻辑输入。而且,每一个5输入的LUT可以选择被配置为一个触发器(flip-flop)。
总的来说,就是CLB由两个Slice组成,每个Slice又由LUT、flip-flop、multiplexers以及arithmetic carry logic组成。
这还没完,用户手册还说:
Approximately two-thirds of the slices are SLICEL logic slices and the rest are SLICEM, which can also use their LUTs as distributed 64-bit RAM or as 32-bit shift registers (SRL32) or as two SRL16s. Modern synthesis tools take advantage of these highly efficient logic, arithmetic, and memory features. Expert designers can also instantiate them.
大约三分之二的Slice是SLICEL,其余的是SLICEM,也可以将它们的LUT用作分布式64位RAM或32位移位寄存器(SRL32)或作为两个SRL16。 现代综合工具利用这些高效逻辑,算术和记忆功能。 专家设计师也可以实例化它们。
上面说的,可以将它们的LUT用作分布式64位RAM或32位移位寄存器(SRL32)或作为两个SRL16,是不是有点歧义呢?是SLICEM可以这样用还是SLICEM和SLICEL都可以这样用呢?
我从用户手册上找到了这句话:
The 7 series FPGA CLB six-input LUT, abundant flip-flops and latches, carry logic, and the ability to create distributed RAM or shift
registers in the SLICEM, increase the effective capacity. The ratio between the number of logic cells and 6-input LUTs is 1.6:1.
分析这段话就可以知道,SLICEM可以用作分布式RAM或者移位寄存器。
7 Series FPGA CLB Resources
7 Series FPGA CLB Resources也就是7系列FPGA的CLB资源,我贴出了一种吧。
从上图可见,LUT的数量是SLICE的4倍,这也就是说每个Slice中有4个LUT,触发器的数量是Slice的8倍说明每个Slice中有8个触发器(flip-flop);
只有SLICEM可以使用它们的LUT作为分布式的RAM或者移位寄存器。
Recommended Design Flow(推荐设计流程)
CLB resources are inferred for generic design logic and do not require instantiation. Good HDL design is sufficient. A few items to note:
• CLB flip-flops have either a set or a reset. The designer must not use both set and reset.
• Flip-flops are abundant. Pipelining should be considered to improve performance.
• Control inputs are shared across a slice or CLB. The number of unique control inputs required for a design should be minimized. Control inputs include clock, clock enable, set/reset, and write enable.
• A 6-input LUT can be used as a 32-bit shift register for efficient implementation.
• A 6-input LUT can be used as a 64 x 1 memory for small storage requirements.
• Dedicated carry logic implements arithmetic functions effectively.
意思是:
CLB资源是针对通用设计逻辑推断的,不需要实例化。 好的HDL设计就足够了。 一些注意事项:
•CLB触发器具有置位或复位功能,设计师不能同时使用set和reset。
•触发器是丰富的,应考虑使用流水线来提高性能。
•控制输入在切片或CLB上共享。 应尽量减少设计所需的独特控制输入的数量。 控制输入包括时钟,时钟使能,置位/复位和写使能。
•6输入LUT可用作32位移位寄存器,以实现高效实现。
•6输入LUT可用作64 x 1存储器,以满足小型存储要求。
•专用进位逻辑有效地实现算术功能。
These steps indicate the recommended design flow:
1. Implement the design using preferred methodologies (HDL, IP, etc.).
2. Evaluate utilization reports to determine resources used.
Check to make sure arithmetic logic, distributed RAM, and SRL are used, when helpful.
3. Consider flip-flop usage.
a. Pipeline for performance
b. Use dedicated flip-flops at the outputs of dedicated resources (block RAM, DSP)
c. Allow shift registers to use SRL (avoid set/resets)
4. Minimize the use of set/resets.
可以大致理解为:
这些步骤意味着下面的设计流程:
1、用好的方法实现设计,例如HDL,IP等
2、评估利用率报告以确定使用的资源。
检查确保使用了算术逻辑、分布式RAM以及移位寄存器,是很有帮助的。
3、考虑使用触发器;
a:流水线以提高性能;
b:在专用资源(Block RAM,DSP)的输出端使用专用触发器;
c:允许移位寄存器使用SRL,但避免set和reset同时使用。
4、尽量少使用set和reset。
这篇博文暂时就记到这里,当然还没有完,但是长博文不便于阅读,给出续集的地址:Xilinx® 7 series FPGAs CLBs专题介绍(二)
文章来源: reborn.blog.csdn.net,作者:李锐博恩,版权归原作者所有,如需转载,请联系作者。
原文链接:reborn.blog.csdn.net/article/details/81506338
- 点赞
- 收藏
- 关注作者
评论(0)