Академический Документы
Профессиональный Документы
Культура Документы
Ron Sass and Andrew G. Schmidt http://www.rcs.uncc.edu/rsass University of North Carolina at Charlotte Spring 2011
1/ 71
The Target
C h a p t e r 2 T h e Ta r g e t
2/ 71
The Target
Topics
from transistors to programmable logic to Platform FPGAs writing VHDL for Platform FPGAs Platform FPGA properties from HDL to a bitstream
3/ 71
The Target
Big Picture
a little knowledge can be a very bad thing
often, a very reasonable and legitimate specication written in an HDL language produces a horrible FPGA design despite the efforts of many very talented researchers, high-level synthesis is imperfect real-world consequence: write HDL idiomatically
4/ 71
The Target
Transistors
FPGAs rely up CMOS transistors important to understand their construct and functionality improves design decisions making for better designs NMOS/PMOS/CMOS transistors
5/ 71
The Target
Transistors
focus on use as a voltage-controlled switch Metal Oxide Semiconductor Field Effect Transistor (MOSFET)
created from 2-D regions in a slab of silicon substrate constructed with excess of positive or negative charge a layer of silicon dioxide placed over substrate to insulate it from metal layer placed above silicon dioxide
6/ 71
The Target
N-Channel MOSFET
Source
Gate
Drain
Drain
Source
7/ 71
The Target
N-Channel MOSFET
VDD VDD VDD Output VDD
(a)
(b)
(c)
an NMOS (a) NAND gate (b) NOR gate (c) AND gate
8/ 71
The Target
P-Channel MOSFET
Source
Gate
Drain
Drain
Source
9/ 71
The Target
Inverter
VDD
Output Input
10/ 71
The Target
combine NMOS and PMOS transistor in steady-stead no appreciable current is owing rule-of-thumb: most energy in a design is consumed when a CMOS gate is changing state
11/ 71
The Target
CMOS NAND
VDD
Output Input
Input
The Target
p- and n-type location/functionality xed at fabrication how to build devices to be congured after fabrication? need a structure capable of implementing arbitrary combinational circuits, a storage cell (memory), and a mechanism to connect these resources.
13/ 71
The Target
sum-of-products formulation of a Boolean function array of multi-input AND gates array of multi-input OR gates device programmed by breaking unwanted connections at the inputs to the AND and OR gates for manufacturing reasons, approach fell out of favor
14/ 71
The Target
15/ 71
The Target
PLA functionality increased to include: memory elements, such as D-type Flip-Flops a MUX
16/ 71
The Target
D CLK
Select
17/ 71
The Target
Switch Box
Switch Box
Switch Box
18/ 71
The Target
Modern FPGA consists of: a 2-D array of programmable logic blocks, xed-function blocks, and routing resources implemented in CMOS technology
19/ 71
The Target
Function generators
20/ 71
The Target
f (x , y , z ) = xy + z
21/ 71
The Target
Function Generators
To generalize, basic n-input function generator consists of: a 2n -to-1 multiplexer (MUX) 2n SRAM (static random access memory) cells i.e. a 3-LUT is a 3-input function generator 4-LUTs and 6-LUTs are more common (3-LUTs are easier to draw by hand!)
22/ 71
The Target
Function Generators
What about more complex functions? use multiple LUTs function decomposed into sub-functions sub-function has subset of inputs each sub-function assigned to one LUT LUTs combined via routing resources to form function
23/ 71
The Target
24/ 71
The Target
Storage Elements
Most circuits need: function generators (LUTs) storage elements (ip-ops) Can now create sequential circuits!
25/ 71
The Target
Logic Cells
26/ 71
The Target
Logic Cells
low-level building block upon which FPGA designs are built combinational/sequential logic built from logic cells used to compare capacity of different FPGA devices slice
27/ 71
The Target
Logic Blocks
A logic block
combines:
28/ 71
The Target
Logic Blocks
29/ 71
The Target
30/ 71
The Target
FPGAs combine programmable logic with additional resources embedded into FPGA fabric. Why? embedded resources consume less resources embedded resources consume less power embedded resources can operate at a higher frequency
31/ 71
The Target
Such as: Block RAM Digital Signal Processing Blocks Processors Digital Clock Manager Multi-Gigabit Transceivers
32/ 71
The Target
Block RAM
many designs require use of on-chip memory possible to use using logic cells to build memory elements logic resources quickly consumed as demand grows Block RAM
33/ 71
The Target
Digital signal processing (DSP) quickly consumes resources: implement necessary components in FPGA fabric:
multiplier accumulator adder bitwise logical operations (AND, OR, NOT, NAND, etc.)
34/ 71
The Target
Processors
Simplify designs, reducing resource and power consumption IBM PowerPC 405 and 440 (in Virtex 4 and 5 FX FPGAs, respectively) conventional RISC processors implement PowerPC instruction set no hardware oating point functions level-1 instruction and data caches memory management unit translation look-aside buffer can connect to FPGA fabric through system bus not all FPGAs have embedded processors
35/ 71
The Target
How to support designs with multiple clock domains? Digital Clock Manager (DCM): generate different clocks from a reference clock divide reference clock clocks have lower jitter and phase relationship
36/ 71
The Target
Multi-Gigabit Transceivers
37/ 71
The Target
Platform FPGA
Block RAM DSP DCM/PLL/IOBs
Logic blocks
Embedded Systems Design with Platform FPGAs
Block RAM
DSP
38/ 71
The Target
Assume you are moderately familiar with HDL (VHDL or Verilog) Question: how to write HDL for FPGAs? Answer: Carefully! when writing HDL be careful, not everything is synthesizable briey cover VHDL next
39/ 71
The Target
40/ 71
The Target
VHDL Syntax
entity declaration: describes the components interface followed by one or more declared architectures: the implementation of the interface best to learn by example
41/ 71
The Target
43/ 71
The Target
44/ 71
The Target
45/ 71
The Target
I n s t a n t i a t e B i t 1 o f F u l l Adder f a 1 : f a d d e r port map ( a => a_reg ( 1 ) , b => b_reg ( 1 ) , c i n => carry_tmp , sum => sum_reg ( 1 ) , c o u t => c o u t _ r e g ) ; I n s t a n t i a t e B i t 0 o f F u l l Adder f a 0 : f a d d e r port map ( a => a_reg ( 0 ) , b => b_reg ( 0 ) , c i n => c i n _ r e g , sum => sum_reg ( 0 ) , c o u t => carry_tmp ) ; end beh ;
46/ 71
The Target
useful for a variety of purposes writing style can result in different netlists recommended to follow synthesis guide (i.e. Xilinx Synthesis Technology (XST) User Guide) simple 8-bit Adder with FSM example
47/ 71
The Target
a r c h i t e c t u r e beh of adderFSM i s 8 b i t R e g i s t e r / Next D e c l a r a t i o n f o r A and B s i g n a l a_reg , b_reg : s t d _ l o g i c _ v e c t o r ( 7 downto 0 ) ; s i g n a l a_next , b_next : s t d _ l o g i c _ v e c t o r ( 7 downto 0 ) ; F i n i t e S t a t e Machine Type D e c l a r a t i o n type FSM_TYPE i s ( wait_a_b , wait_a , wait_b , add_a_b ) ; I n t e r n a l s i g n a l s t o r e p r e s e n t t h e C u r r e n t S t a t e ( fsm_cs ) and t h e Next S t a t e ( fsm_ns ) o f t h e s t a t e machine s i g n a l fsm_cs : FSM_TYPE : = wait_a_b ; s i g n a l fsm_ns : FSM_TYPE : = wait_a_b ;
48/ 71
The Target
begin F i n i t e S t a t e Machine Process t o R e g i s t e r S i g n a l s f s m _ r e g i s t e r _ p r o c : process ( c l k ) i s begin R i s i n g Edge Clock t o i n f e r F l i p Flops i f ( ( c l k event ) and ( c l k = 1 ) ) then Synchronous Reset / Return t o I n i t i a l S t a t e i f ( r s t = 1 ) then a_reg <= ( others => 0 ) ; b_reg <= ( others => 0 ) ; fsm_cs <= wait_a_b ; else a_reg <= a_next ; b_reg <= b_next ; fsm_cs <= fsm_ns ; end i f ; end i f ; end process f s m _ r e g i s t e r _ p r o c ;
49/ 71
The Target
50/ 71
The Target
51/ 71
The Target
Input signals
R E G
VHDL: fsm_logic_proc fsm_cs signal State register function VHDL: fsm_register_proc fsm_ns signal
52/ 71
The Target
53/ 71
The Target
54/ 71
The Target
xst
55/ 71
The Target
Standard netlists .edif ngd build Xilinx database netlist .ngd map Native circuit description .ncd par Mapped NCD _map.ngd
56/ 71
The Target
57/ 71
The Target
ports have names and direction complex cells formed with instances of cells and nets hierarchy formed from complex cells with top-level cell encompassing all other cells top-level port cells associated with external pins of FPGA
58/ 71
The Target
60/ 71
The Target
Digital circuit to sequence of bits using previous example: with 4-inputs, cannot implement f in a single 3-LUT solution: two 3-LUTs and routing resources f can be decomposed into two functions:
f (w , x , y , z ) = f2 (w , f1 (x , y , z )) f1 (x , y , z ) = x + yz f2 (w , t ) = w + t
now f1 and f2 can be used to congure two 3-LUTs the output of f1 is routed to the second input of f2
61/ 71
The Target
62/ 71
The Target
After generating the netlist: mapping after MAP another netlist is generated cells now refer to FPGA primitives (LUTs,FFs, etc.)
63/ 71
The Target
64/ 71
The Target
z y x w 1 3LUT FF 0 1 1 3LUT FF
65/ 71
The Target
bitstream
66/ 71
The Target
67/ 71
The Target
Chapter-In-Review
transistors: NMOS,PMOS,CMOS programmable logic devices writing VHDL for Platform FPGAs Platform FPGA properties from HDL to a bitstream
68/ 71
The Target
Chapter 2 Terms
69/ 71
The Target
Chapter 2 Terms
70/ 71
The Target
Chapter 2 Terms
71/ 71