fpga design flow - desy-konferenzverwaltung (indico)

13
FPGA Design Flow - from HDL to physical implementation - FPGA Design Flow - from HDL to physical implementation - Victor Andrei Kirchhoff-Institut für Physik (KIP) Ruprecht-Karls-Universität Heidelberg 6th Detector Workshop of the Helmholtz Alliance “Physics at the Terascale”, Mainz, 26/02/2013

Upload: others

Post on 08-Jan-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

FPGA Design Flow- from HDL to physical implementation -

FPGA Design Flow- from HDL to physical implementation -

Victor Andrei

Kirchhoff-Institut für Physik (KIP)Ruprecht-Karls-Universität Heidelberg

6th Detector Workshop of the Helmholtz Alliance“Physics at the Terascale”, Mainz, 26/02/2013

Page 2: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Five main FPGA developmentphases:

Design Entry

Synthesis

Implementation

Bitstream Generation

Simulation

Complexity of HDL designdoes not change the flow

varies only the executiontime

Implementation of processesis manufacture-dependent concept is basically the same

‘Xilinx approach’ in thiscourse

OverviewOverview

DESIGN ENTRY

SYNTHESIS

IMPLEMENTATION

Translate

Map

Place & Route

GENERATE

PROGRAMMING FILE

BEHAVIOURAL SIMULATION

FUNCTIONAL SIMULATION

TIMING SIMULATION

BOARD-LEVEL TESTING

DESIGN VERIFICATION

FPGA

Des

ign

Implem

enta

tion

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 2

Page 3: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

AB R

QAND

OR

Design EntryDesign Entry

Can be subdivided into two phases:define functionality and structure of the design (input)

requirements specification, basic architecture, timing diagrams, etc.

hierarchy break design into small, manageable pieces

FPGA selection (application, package, temperature range, size, price)

create the design (output)schematic based easily readable, but not very convenient for large projects

HDL based more convenient and faster, but lower in performance and density

mixed types also possible (e.g. schematic with instantiated HDL modules)

tools available to convert HDL to schematic and vice versa

Schematic design

VHDL design

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 3

entity gates isport( A,B: in std_logic;

Q,R: out std_logic);end gates;

architecture implement of gates isbegin

Q <= A and B;R <= A or B;

end implement;

FPGA

Des

ign

Implem

enta

tion

Page 4: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Synthesis (1/2)Synthesis (1/2)

Converts the input HDL source files into a netlistdescribes a list of logical FPGA elements and their connectivity

multiple netlists generated for complex designs

Three-step process:syntax check & element association

optimisation

technology mapping

Output files:design netlist Implementation

Xilinx format: Native GenericCircuit (NGC)

functional netlist Simulation

reports

schematic views (RTL & Technology)from “FPGAs 101” (G.R.Smith)

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 4

FPGA

Des

ign

Implem

enta

tion

Page 5: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

entity gates isport( A,B: in std_logic;

Q,R: out std_logic);end gates;

architecture implement of gates isbegin

Q <= A and B;R <= A or B;

end implement;

Synthesis (2/2)Synthesis (2/2)

RTL Schematic (preoptimised design)

VHDL design

Technology Schematic (postsynthesized design)

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 5

FPGA

Des

ign

Implem

enta

tion

Page 6: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Implementation (1/4)Implementation (1/4)

Determines the physical design layoutmaps synthesised netlists (.ngc) to the target FPGA’s structure

interconnects design resources to FPGA’s internal and I/O logic

Sequence of three sub-processes:Translate

Map

Place & Route (PAR)

Translatecombines all netlists and constraints into one large netlist

Xilinx format: Native Generic Database (NGD)

user-defined constraints:pin assignment & time requirements (e.g. input clock period, maximum delay, etc.)

information provided via a User Constraints File (UCF)

IMPLEMENTATION

Translate

Map

Place & Route

.ngc

.ngd

.ncd

.ncd

Constraints

.ucf

NET "A" LOC = B3 | IOSTANDARD = LVCMOS33 | PULLDOWN;

NET "Q" LOC = L6 | IOSTANDARD = LVCMOS18;

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 6

FPGA

Des

ign

Implem

enta

tion

Page 7: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Implementation (2/4)Implementation (2/4)

Mapcompares the resources specified in the input netlist (.ngd) against theavailable resources of the target FPGA

insufficient or incorrectly specified resourcesgenerate errors

divides netlist circuit into sub-blocksto fit into the FPGA logic blocks

output:Native Circuit Description (NCD, .ncd) file

Place & Route (PAR)iterative process, very time intensive

places physically the NCD sub-blocks into FPGA logic blocks

routes signals between logic blocks such that timing constraints are met

output:a completely routed NCD file

IMPLEMENTATION

Translate

Map

Place & Route

.ngc

.ngd

.ncd

.ncd

Constraints

.ucf

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 7

FPGA

Des

ign

Implem

enta

tion

Page 8: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

entity gates isport( A,B: in std_logic;

Q,R: out std_logic);end gates;

architecture implement ofgates is

beginQ <= A and B;R <= A or B;

end implement;

Implementation (3/4)Implementation (3/4)

VHDL designInput pins & logic (A,B)

Output pins & logic (R,Q)

Combinational Logic (LUT)

Floorplan view

(after PAR)

(Spartan-6)

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 8

FPGA

Des

ign

Implem

enta

tion

Page 9: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Implementation (4/4)Implementation (4/4)

Input pins & logic (A,B)

Output pins & logic (R,Q)

Combinational Logic (LUT)

Q

R

A

B

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 9

FPGA

Des

ign

Implem

enta

tion

Page 10: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Generate Programming FileGenerate Programming File

Converts the final NCD file into a format the FPGA understandsbitstream (.bit) is the usual choice

can be directly loaded into FPGA (e.g. via JTAG interface)

or stored in non-volatile devices (PROMs, Flash) downloaded to FPGAautomatically (e.g. at power-up) or upon request

other similar choice: IEEE 1532 configuration file format (.isc)

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 10

FPGA

Des

ign

Implem

enta

tion

Page 11: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Simulation (1/3)Simulation (1/3)

Stimulus

Unit (Design)

Under Testing

(UUT)

adapted from “FPGAs 101” (G.R.Smith)

Verifies that designperforms at the requiredfunctionality

Not mandatory, but shouldnot be completely ignored

Approach:apply stimulus that mimicsreal input data to thedesign

observe the output

Can be performed atdifferent stages:

Design Entry: Behavioural simulation most frequently run, detects logicerrors

Post-Synthesis: Functional (Netlist) simulation

Post-Translate, -Map, -PAR: Timing simulation most accurate after PAR

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 11

FPGA

Des

ign

Implem

enta

tion

Page 12: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Simulation (2/3)Simulation (2/3)

ARCHITECTURE behaviour OF tb_gates IS

-- Component Declaration for the Unit Under Test (UUT)

COMPONENT gates

PORT( A, B : IN std_logic;

Q, R : OUT std_logic; );

END COMPONENT;

BEGIN

-- Instantiate the Unit Under Test (UUT)

uut: gates PORT MAP (A => A, B => B, Q => Q, R => R);

-- Stimulus process

stim_proc: process

begin

A <= '0'; B <= '0';

-- insert stimulus here

wait for 100 ns; A <= '1';

wait for 200 ns; B <= '1';

wait for 200 ns; A <= '0';

wait for 200 ns; B <= '0';

wait;

end process;

END;

Testbench

Behavioural Simulation – Output Waveform

VHDL design (UUT)

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 12

entity gates isport( A,B: in std_logic;

Q,R: out std_logic);end gates;

architecture implement of gates isbegin

Q <= A and B;R <= A or B;

end implement;

FPGA

Des

ign

Implem

enta

tion

Page 13: FPGA Design Flow - DESY-Konferenzverwaltung (Indico)

Simulation (3/3)Simulation (3/3)

ARCHITECTURE behaviour OF tb_gates IS

-- Component Declaration for the Unit Under Test (UUT)

COMPONENT gates

PORT( A, B : IN std_logic;

Q, R : OUT std_logic; );

END COMPONENT;

BEGIN

-- Instantiate the Unit Under Test (UUT)

uut: gates PORT MAP (A => A, B => B, Q => Q, R => R);

-- Stimulus process

stim_proc: process

begin

A <= '0'; B <= '0';

-- insert stimulus here

wait for 100 ns; A <= '1';

wait for 200 ns; B <= '1';

wait for 200 ns; A <= '0';

wait for 200 ns; B <= '0';

wait;

end process;

END;

Testbench

VHDL design (UUT)

Victor Andrei, KIPHelmholtz Alliance, 6th Detector Workshop, Mainz, 26/02/2013 13

entity gates isport( A,B: in std_logic;

Q,R: out std_logic);end gates;

architecture implement of gates isbegin

Q <= A and B;R <= A or B;

end implement;

Timing Simulation – Output Waveform

FPGA

Des

ign

Implem

enta

tion