george mason university fpga design flow ece 545 lecture 7

46
George Mason University FPGA Design Flow ECE 545 Lecture 7

Upload: roberta-woods

Post on 14-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: George Mason University FPGA Design Flow ECE 545 Lecture 7

George Mason University

FPGA Design Flow

ECE 545Lecture 7

Page 2: George Mason University FPGA Design Flow ECE 545 Lecture 7

2

• designs must be sent for expensive and time consuming fabrication in semiconductor foundry

• bought off the shelf and reconfigured by designers themselves

Two competing implementation approaches

ASICApplication Specific

Integrated Circuit

FPGAField Programmable

Gate Array

• designed all the way from behavioral description to physical layout

• no physical layout design; design ends with a bitstream used to configure a device

Page 3: George Mason University FPGA Design Flow ECE 545 Lecture 7

3

Which Way to Go?

Off-the-shelf

Low development cost

Short time to market

Reconfigurability

High performance

ASICs FPGAs

Low power

Low cost inhigh volumes

Page 4: George Mason University FPGA Design Flow ECE 545 Lecture 7

4

Block R

AM

s

Block R

AM

s

BasicLogicBlocks

I/OBlocks

What is an FPGA?

BlockRAMs

Page 5: George Mason University FPGA Design Flow ECE 545 Lecture 7

5

Modern FPGARAM blocks

Multipliers

Logic blocks

Graphics based on The Design Warrior’s Guide to FPGAsDevices, Tools, and Flows. ISBN 0750676043

Copyright © 2004 Mentor Graphics Corp. (www.mentor.com)

Multipliers/DSP units

RAM blocks

Logic resources

(#Logic resources, #Multipliers/DSP units, #RAM_blocks)

Page 6: George Mason University FPGA Design Flow ECE 545 Lecture 7

Technology Low-cost High-performance

220 nm Virtex180 nm Spartan II,

Spartan IIE120/150 nm Virtex II,

Virtex II Pro90 nm Spartan 3 Virtex 465 nm Virtex 545 nm Spartan 640 nm Virtex 628 nm Artix 7 Virtex 7

Xilinx FPGA Families

Page 7: George Mason University FPGA Design Flow ECE 545 Lecture 7

Altera FPGA Families

Technology Low-cost Mid-range High-performance

130 nm Cyclone Stratix

90 nm Cyclone II Stratix II

65 nm Cyclone III Arria I Stratix III

40 nm Cyclone IV Arria II Stratix IV

28 nm Cyclone V Arria V Stratix V

Page 8: George Mason University FPGA Design Flow ECE 545 Lecture 7

George Mason University

Spartan-3 Family Attributes

Page 9: George Mason University FPGA Design Flow ECE 545 Lecture 7

9

Spartan-3 FPGA Family Members

Page 10: George Mason University FPGA Design Flow ECE 545 Lecture 7

10

FPGA Nomenclature

Page 11: George Mason University FPGA Design Flow ECE 545 Lecture 7

11

FPGA Nomenclature Example

XC3S1500-4FG320

Spartan 3family

1500 k= 1.5 M

equivalent logic gates

speed grade

-4= standard

performance

320 pins

package type

Page 12: George Mason University FPGA Design Flow ECE 545 Lecture 7

George Mason University

FPGA Design Flow

Page 13: George Mason University FPGA Design Flow ECE 545 Lecture 7

FPGA Design process (1)Design and implement a simple unit permitting to speed up encryption with RC5-similar cipher with fixed key set on 8031 microcontroller. Unlike in the experiment 5, this time your unit has to be able to perform an encryption algorithm by itself, executing 32 rounds…..

Library IEEE;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;

entity RC5_core is port( clock, reset, encr_decr: in std_logic; data_input: in std_logic_vector(31 downto 0); data_output: out std_logic_vector(31 downto 0); out_full: in std_logic; key_input: in std_logic_vector(31 downto 0); key_read: out std_logic; );end AES_core;

Specification / Pseudocode

VHDL description (Your Source Files)

Functional simulation

Post-synthesis simulationSynthesis

On-paper hardware design (Block diagram & ASM chart)

Page 14: George Mason University FPGA Design Flow ECE 545 Lecture 7

FPGA Design process (2)

Implementation

Configuration

Timing simulation

On chip testing

Page 15: George Mason University FPGA Design Flow ECE 545 Lecture 7

15

Tools used in FPGA Design Flow

Xilinx XSTXilinx XST

DesignDesign

SynthesisSynthesis

ImplementationImplementationXilinx ISEXilinx ISE

VHDL code

Netlist

Bitstream

Synplify PremierSynplify Premier

Functionally verified

VHDL code

Page 16: George Mason University FPGA Design Flow ECE 545 Lecture 7

George Mason University

Synthesis

Page 17: George Mason University FPGA Design Flow ECE 545 Lecture 7

17

Synthesis Tools

… and others

Synplify PremierXilinx XST

Page 18: George Mason University FPGA Design Flow ECE 545 Lecture 7

18

architecture MLU_DATAFLOW of MLU is

signal A1:STD_LOGIC;signal B1:STD_LOGIC;signal Y1:STD_LOGIC;signal MUX_0, MUX_1, MUX_2, MUX_3: STD_LOGIC;

beginA1<=A when (NEG_A='0') else

not A;B1<=B when (NEG_B='0') else

not B;Y<=Y1 when (NEG_Y='0') else

not Y1;

MUX_0<=A1 and B1;MUX_1<=A1 or B1;MUX_2<=A1 xor B1;MUX_3<=A1 xnor B1;

with (L1 & L0) selectY1<=MUX_0 when "00",

MUX_1 when "01",MUX_2 when "10",MUX_3 when others;

end MLU_DATAFLOW;

VHDL description Circuit netlist

Logic Synthesis

Page 19: George Mason University FPGA Design Flow ECE 545 Lecture 7

19

Circuit netlist (RTL view)

Page 20: George Mason University FPGA Design Flow ECE 545 Lecture 7

20

Mapping

LUT2

LUT3

LUT4

LUT5

LUT1FF1

FF2

LUT0

Page 21: George Mason University FPGA Design Flow ECE 545 Lecture 7

21

Xilinx XST Inputs/Outputs

Page 22: George Mason University FPGA Design Flow ECE 545 Lecture 7

22

Xilinx XST Inputs

• RTL VHDL and/or Verilog files• Core files

These files can be in either NGC or EDIF format.

XST does not modify cores. It uses them to inform

area and timing optimization surrounding the cores.• Constraints – XCF

Xilinx constraints file in which you can specify

synthesis, timing, and specific implementation

constraints that can be propagated to the NGC file.

Page 23: George Mason University FPGA Design Flow ECE 545 Lecture 7

23

Xilinx XST Outputs• NGC

Netlist file with constraint information• NGR

This is a schematic representation of the pre-optimized

design shown at the Register Transfer Level (RTL).

This representation is in terms of generic symbols,

such as adders, multipliers, counters, AND gates, and

OR gates, and is generated after the HDL synthesis phase

of the synthesis process.• LOG

This report contains the results from the synthesis run,

including area and timing estimation.

Page 24: George Mason University FPGA Design Flow ECE 545 Lecture 7

RTL view in Synplify PremierRTL view in Synplify Premier

incrementercomparator

General logic structures can be recognized in RTL viewGeneral logic structures can be recognized in RTL view

MUX

Page 25: George Mason University FPGA Design Flow ECE 545 Lecture 7

Crossprobing between RTL view and codeCrossprobing between RTL view and code

Each port, net or block can be chosen by mouse click from the Each port, net or block can be chosen by mouse click from the browser or directly from the RTL Viewbrowser or directly from the RTL View

By double-clicking on the element its source code can be seen:By double-clicking on the element its source code can be seen:

Reverse crossprobing is also possible: if section of code is marked, Reverse crossprobing is also possible: if section of code is marked, appropriate element of RTL View is marked too: appropriate element of RTL View is marked too:

Page 26: George Mason University FPGA Design Flow ECE 545 Lecture 7

Technology View in Synplify ProTechnology View in Synplify Pro

Technology view is a mapped RTL view. It can be seen by pressing button Technology view is a mapped RTL view. It can be seen by pressing button or by double-click on or by double-click on ““.srm.srm”” file fileAs in case of As in case of ““RTL ViewRTL View””, buttons can be used here, buttons can be used here

Two additional buttons are enabled: - show critical pathTwo additional buttons are enabled: - show critical path - open timing analyst- open timing analyst

Technology view is presented using device primitivesPorts, nets and

blocks browser

Pay attention: technology view is usually large and presented on number of sheets

Page 27: George Mason University FPGA Design Flow ECE 545 Lecture 7

Viewing critical path Viewing critical path Critical path can be viewed by pressing on Critical path can be viewed by pressing on

Delay values are written near each component of the pathDelay values are written near each component of the path

Page 28: George Mason University FPGA Design Flow ECE 545 Lecture 7

Timing AnalystTiming Analyst

Timing analyst opened by pressing on Timing analyst opened by pressing on Timing analyst gives a possibility to analyze different paths in the designTiming analyst gives a possibility to analyze different paths in the designTiming analyst can be opened only from Technology ViewTiming analyst can be opened only from Technology View

Page 29: George Mason University FPGA Design Flow ECE 545 Lecture 7

George Mason University

Implementation

Page 30: George Mason University FPGA Design Flow ECE 545 Lecture 7

30

Implementation

• After synthesis the entire implementation process is performed by FPGA vendor tools

Page 31: George Mason University FPGA Design Flow ECE 545 Lecture 7

31

Implementation

Page 32: George Mason University FPGA Design Flow ECE 545 Lecture 7

32

Translation

Translation

UCF

NGD

EDIF NCF

Native Generic Database file

Constraint Editoror Text Editor

User Constraint File

Native Constraint

File

Electronic Design Interchange Format

Circuit netlist Timing Constraints

Synthesis

Page 33: George Mason University FPGA Design Flow ECE 545 Lecture 7

33

Pin Assignment

LAB5

CLOCKCONTROL(0)

CONTROL(2)CONTROL(1)

RESET

SEGMENTS(0)SEGMENTS(1)SEGMENTS(2)SEGMENTS(3)SEGMENTS(4)SEGMENTS(5)SEGMENTS(6)

H3

K2G5

K3H1K4

G4

H5

H6

H2

P10

B10FPGA

Page 34: George Mason University FPGA Design Flow ECE 545 Lecture 7

34

Page 35: George Mason University FPGA Design Flow ECE 545 Lecture 7

35

Example of an UCF File

NET "CLOCK" LOC = "P10";

NET "reset" LOC = "B10";

NET "S_SEG0<6>" LOC = "H1";

NET "S_SEG0<5>” LOC = "G4";

NET "S_SEG0<4>” LOC = "G5";

NET "S_SEG0<3>” LOC = "H5";

NET "S_SEG0<2>” LOC = "H6";

NET "S_SEG0<1>” LOC = "H3";

NET "S_SEG0<0>” LOC = "H2";

ECE 448 – FPGA and ASIC Design with VHDL

Page 36: George Mason University FPGA Design Flow ECE 545 Lecture 7

36

Mapping

LUT2

LUT3

LUT4

LUT5

LUT1FF1

FF2

LUT0

Page 37: George Mason University FPGA Design Flow ECE 545 Lecture 7

37

PlacingCLB SLICES

FPGA

Page 38: George Mason University FPGA Design Flow ECE 545 Lecture 7

38

Routing

Programmable Connections

FPGA

Page 39: George Mason University FPGA Design Flow ECE 545 Lecture 7

39

Configuration

• Once a design is implemented, you must create a file that the FPGA can understand• This file is called a bit stream: a BIT file (.bit extension)

• The BIT file can be downloaded directly to the FPGA, or can be converted into a PROM file which stores the programming information

Page 40: George Mason University FPGA Design Flow ECE 545 Lecture 7

Two main stages of the Two main stages of the FPGA Design FlowFPGA Design Flow

SynthesisSynthesis

TechnologyTechnologyindependentindependent

TechnologyTechnologydependentdependent

ImplementationImplementation

RTLRTLSynthesisSynthesis

MapMap Place & RoutePlace & Route ConfigureConfigure

- Code analysisCode analysis- Derivation of main logic - Derivation of main logic constructionsconstructions- Technology independent Technology independent optimizationoptimization- Creation of Creation of ““RTL ViewRTL View””

- Mapping of extracted logic Mapping of extracted logic structures to device primitivesstructures to device primitives- Technology dependent Technology dependent optimizationoptimization- Application of Application of ““synthesis synthesis constraintsconstraints””-Netlist generationNetlist generation- Creation of Creation of ““Technology ViewTechnology View””

- Placement of generated Placement of generated netlist onto the devicenetlist onto the device-Choosing best interconnect Choosing best interconnect structure for the placed structure for the placed designdesign-Application of Application of ““physical physical constraintsconstraints””

- Bitstream Bitstream generationgeneration- Burning deviceBurning device

Page 41: George Mason University FPGA Design Flow ECE 545 Lecture 7

41ECE 448 – FPGA and ASIC Design with VHDL

Report files

Page 42: George Mason University FPGA Design Flow ECE 545 Lecture 7

42

Map report header

Xilinx Mapping Report File for Design 'Lab3Demo'

Design Information------------------Command Line : c:\Xilinx\bin\nt\map.exe -p 3S1500FG320-4 -o map.ncd -pr b -k 4-cm area -c 100 Lab3Demo.ngd Lab3Demo.pcf Target Device : xc3s1500Target Package : fg320Target Speed : -4Mapper Version : spartan3 -- $Revision: 1.34 $

Page 43: George Mason University FPGA Design Flow ECE 545 Lecture 7

43

Map reportDesign Summary--------------Number of errors: 0Number of warnings: 0Logic Utilization: Number of Slice Flip Flops: 30 out of 26,624 1% Number of 4 input LUTs: 38 out of 26,624 1%Logic Distribution: Number of occupied Slices: 33 out of 13,312 1% Number of Slices containing only related logic: 33 out of 33 100% Number of Slices containing unrelated logic: 0 out of 33 0% *See NOTES below for an explanation of the effects of unrelated logicTotal Number 4 input LUTs: 62 out of 26,624 1% Number used as logic: 38 Number used as a route-thru: 24 Number of bonded IOBs: 10 out of 221 4% IOB Flip Flops: 7 Number of GCLKs: 1 out of 8 12%

Page 44: George Mason University FPGA Design Flow ECE 545 Lecture 7

44

Related and Unrelated LogicRelated logic is defined as being logic that shares connectivity – e.g. two LUTs are "related" if they share common inputs. When assembling slices, Map gives priority to combine logic that is related. Doing so results in the best timing performance.

Unrelated logic shares no connectivity. Map will only begin packingunrelated logic into a slice once 99% of the slices are occupied throughrelated logic packing.

Note that once logic distribution reaches the 99% level through related logic packing, this does not mean the device is completelyutilized. Unrelated logic packing will then begin, continuing until all usable LUTs and FFs are occupied. Depending on your timing budget, increased levels ofunrelated logic packing may adversely affect the overall timing performance of your design.

Page 45: George Mason University FPGA Design Flow ECE 545 Lecture 7

45

Place & route report

Asterisk (*) preceding a constraint indicates it was not met. This may be due to a setup or hold violation.

------------------------------------------------------------------------------------------------------ Constraint | Requested | Actual | Logic | Absolute |Number of | | | Levels | Slack |errors ------------------------------------------------------------------------------------------------------* TS_CLOCK = PERIOD TIMEGRP "CLOCK" 5 ns | 5.000ns | 5.140ns | 4 | -0.140ns | 5 HIGH 50% | | | | | ------------------------------------------------------------------------------------------------------ TS_gen1Hz_Clock1Hz = PERIOD TIMEGRP "gen1 | 5.000ns | 4.137ns | 2 | 0.863ns | 0 "gen1Hz_Clock1Hz" 5 ns HIGH 50% | | | | | ------------------------------------------------------------------------------------------------------

Page 46: George Mason University FPGA Design Flow ECE 545 Lecture 7

46

Post layout timing reportClock to Setup on destination clock CLOCK---------------+---------+---------+---------+---------+ | Src:Rise| Src:Fall| Src:Rise| Src:Fall|Source Clock |Dest:Rise|Dest:Rise|Dest:Fall|Dest:Fall|---------------+---------+---------+---------+---------+CLOCK | 5.140| | | |---------------+---------+---------+---------+---------+

Timing summary:---------------

Timing errors: 9 Score: 543

Constraints cover 574 paths, 0 nets, and 187 connections

Design statistics: Minimum period: 5.140ns (Maximum frequency: 194.553MHz)