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專題介紹(二)
FPGA 分布式
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。