Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter...

40
fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund

Transcript of Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter...

Page 1: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

fakultät für informatikinformatik 12

technische universität dortmund

Applications (2)

Peter MarwedelInformatik 12, TU Dortmund

Page 2: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 2 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Gliederung

Einführung SystemC

Vorlesungen und Programmierung FPGAs

- Vorlesungen- VHDL-basierte Konfiguration von FPGAs

mit dem XUP VII Pro Entwicklungssystem

Algorithmen- Mikroarchitektur-Synthese- Automatensynthese- Logiksynthese- Layoutsynthese

Zeitplan

3,5 Wochen

3,5 Wochen

6 Wochen

Page 3: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 3 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Typical applications

Diploma theses @ Dortmund: real-time computations Graphics accelerators Encryption/decryption Bio-sequence database scanning Network applications (e.g. network intrusion detection) Parallel pattern recognition in physics Emulation (of new hardware processors)

Page 4: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 4 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Survey: Use of FPGAs in Bioinformatics

Bioinformatics applications:– little I/O– dynamic programming– big lookup tables

Ideal for FPGA

Currently one company (TimeLogic) sells FPGA cards for BLAST and Smith-Waterman

Cost: ~$20,000 for cards

Used routinely in biotech / pharma companies

Page 5: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 5 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Mid-Grain: Amalgam

So

urc

e:

cou

rse

s.e

ce.u

iuc.

ed

u/e

ce4

12

/lect

ure

s/le

ctu

re1

7.p

pt

Page 6: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 6 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Amalgam Performance

0

2

4

6

8

10

12

14

16

18

20

22

24

1 2 3 4 5 6 7 80

2

4

6

8

10

12

14

16

18

20

22

24

Number of Clusters

N-Queens2D IDCTRijndael EncryptionImage DitheringDNA Pattern Match

0

2

4

6

8

10

12

14

16

18

20

22

24

1 2 3 4 5 6 7 80

2

4

6

8

10

12

14

16

18

20

22

24

Number of Clusters

Page 7: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 7 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

• The genome, and the proteins, are very complex and difficult to decipher:

• A genome is a string of DNA bases, A, C, G or T; from ½ million (mycoplasma) to 10 billon (lilly).

• The genome is interpreted by working out which regions of the DNA code for protein, and what the likely function of these proteins is.

• We currently do this by matching sequences to those of DNA or proteins used in previous experiments.

• A priori prediction of structure/function still a distant dream. Simplified diagram of the smallest genome

known, Mycoplasma pneumoniae

Bioinformatics 1: Sequence Alignment

Page 8: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 8 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Bioinformatics 2: Reconstruction of

regulatory networks

An emerging field

Attempts to model the complex interactions between DNA and the protein it encodes, that ultimately control the processes of life.

Often uses analogies to circuitry. However biological data is always incomplete, sometimes very sparse.

SANs, PetriNets, locally Mobius utilized.

Page 9: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 9 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Typical applications

Diploma theses @ Dortmund: real-time computations

Graphics accelerators

Encryption/decryption

Bio-sequence database scanning

Network applications (e.g. network intrusion detection)

Parallel pattern recognition in physics

Emulation (of new hardware processors)

Page 10: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 10 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

High Energy Physics

FermiLab Accelerator

BTeV Experiment

Source:http://false2002.vanderbilt.edu/talks/Bapty.ppt

Page 11: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 11 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Particle Measurement

0 12 m

pp

DipoleRICH

EM

Ca

l

Ha

dro

n

A

bso

rbe

r

Mu

on

To

roid

± 3

00

m

rad

Magnet

Forward tracker provides:•Momentum measurement•Pattern recognition for tracks born in decays downstream of vertex detector•Projection of tracks into particle ID devices

Detector Grids

Problem: -Massive amounts of data (Terabytes/Sec)-Determine the set of particle trajectories-Decide if it is interesting, keep or toss-Hardware => 2500 DSP’s + 2500 PC’s-Never Fail (ok to degrade)

Page 12: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 12 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Trigger System(20,000 ft. view)

Memory Queue, ~ms

2nd Level(PC)

Pre-Proces

s(FPGA)

1st Level(DSP)

Store

~2000Nodes

~2000Nodes

Page 13: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 13 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Typical applications

Fast Object recognition• Medical, security, …• Military

Graphics accelerators Encryption/decryption Bio-sequence database scanning Network applications (e.g. network intrusion detection) Parallel pattern recognition in physics Emulation (of new hardware processors)

Page 14: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

fakultät für informatikinformatik 12

technische universität dortmund

January 12, 2004 BWRC, UC Berkeley 14

High-End Reconfigurable Computing

Berkeley Wireless Research CenterJanuary 2004

John Wawrzynek, Robert W. Brodersen, Chen Chang, Vason Srini, Brian Richards

Source: http://bwrc.eecs.berkeley.edu/Presentations/Retreats/Winter_Retreat_2004/Monday%20PM/Wawrzynek-HERC_BEE2v1.ppt

Page 15: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 15 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

BBerkeley EEmulation EEngine

FPGA-based system for real-time hardware emulation:

• Emulation speeds up to 60 MHz

• Emulation capacity of 10 Million ASIC gate-equivalents, corresponding to 600 Gops (16-bit adds) (although not a logic gate emulator.)

• 2400 external parallel I/Os providing 192 Gbps raw bandwidth.

Page 16: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 16 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Status

Four BEE processing units built Three in continuous “production” use Supported universities

CMU, USC, Tampere, UMass, Stanford Successful tapeout of:

3.2M transistor pico-radio chip 1.8M transistor LDPC decoder chip

System emulated: QPSK radio transceiver BCJR decoder MPEG IDCT

On-going projects UWB mix-signal SOC MPEG transcoder Pico radio multi-node system Infineon SIMD processor for SDR

Page 17: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 17 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Lessons from BEEBEE

Simulink based tool-flow very effective FPGA programming model in DSP domain.

Many system emulation tasks are significant computations in their own right – high-performance emulation hardware makes for high-performance general computing.

Is this the right way to build supercomputers? BEE could be scaled up with latest FPGAs and by

using multiple boards TeraBEE (B2).

Page 18: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 18 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Is Reconfigurable Going Mainstream?

Cray XD1:

– 12 Opterons per chassis– 6 Xilinx Virtex Pro 50 FPGAs– Communication

network/processor SGI Altix 350:

– 1-32 Itanium2s – 1 Xilinx XCV6000 per processor

pair – Fast interconnect technology

SRC:

– Pentium 4 Xeons– MAPs: multiple XCV6000

FPGAs– X-bar

TimeLogic, Starbridge, others… NCSA is exploring this technology.

Page 19: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 19 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Vendors other than Xilinx?

1

2

6

10

31

49

Share [%]

25Atmel7

33Quicklogic6

??Cypress5

135Actel4

235Lattice3

~30712Altera2

~551,125Xilinx1

FPGA-Share 2004* [%]

Sales (M$)CompanyRank

Source: *: Altera (http://biz.yahoo.com/e/050311/altr10-k.html), other numbers from IC Insights

PLD=FPGA+CPLD Sales 2002

Page 20: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 20 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Altera support tools

http://www.altera.com/technology/dsp/devices/fpga/dsp-fpga_coprocessor.html

Anwendung: Video-Dekodierung

Page 21: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

fakultät für informatikinformatik 12

technische universität dortmund

Stile der FPGA-Synthese

fakultät für informatikinformatik 12

technische universität dortmund

Peter MarwedelTU Dortmund, Informatik 12

Germany

Page 22: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 22 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Synthese

Def.: Synthese ist das Zusammensetzen von Komponenten oder Teilen einer niedrigen (Modell-) Ebene zu einem Ganzen mit dem Ziel, ein auf einer höheren Ebene beschriebenes Verhalten zu erzielen.[Advanced Learners Dictionary of Contemporary English].

Spezifikation

Implementierung

Page 23: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 23 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

„correctness by construction“

Sofern Synthesemethoden garantiert korrekte Entwürfe erstellen, brauchen diese nicht mehr per Simulation überprüft zu werden.Die Korrektheit der Methoden ist allerdings bisher nur in wenigen Fällen nachgewiesen worden. Simulationen sind daher weiterhin sinnvoll, aber weniger wichtig.

Ideal: für alle Entwurfsaufgaben gute Syntheseverfahren.

Page 24: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 24 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Ideal und Wirklichkeit

Für alle Entwurfsaufgaben gute Synthese: kaum erreichbar.

Nach H. de Man liegt ist dies prinzipiell begründet:

EDA-Hersteller mit der Pflegevorhandener Software beschäftigt.

Anwender wollen aufgrund der für Wartung aufzuwenden-den Kosten keine Werkzeuge selbst entwickeln und pflegen.

Forschungsinstitute müssen Probleme erfahren, Lösungen erarbeiten & mit EDA-Firmen in Produkte umsetzen.Dissertationen: ca. 5 Jahre vom Auftauchen des Problems bis zur breiten Markteinführung knapp 10 Jahre.

de Man: tomorrow's tools solve yesterday's problems.

Termingerechter Entwurf ohne Synthese nicht möglich.

Page 25: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 25 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Formen der Synthese

Unterschiedliche Ziele und Quellen;mögliche Darstellung:

Algorithmus, “behavioral” (untimed)

Algorithmus, “behavioral” (timed)

RT-Verhalten

RT-Struktur-Ebene

Gatter

Layout

XST

Catapult

Celoxica, u.a.

Page 26: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 26 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Nachteile einer Spezifikation auf RT-Ebene

Nachteile einer Spezifikation wie bei XST Man gibt die Schaltungsblöcke bereits vor. Man muss sich überlegen, was in welchem Taktzyklus

stattfindet. Die Vorteile von VHDL, Algorithmen beschreiben zu

können, werden kaum genutzt. Liegt die ursprüngliche Spezifikation on C oder

SystemC vor, so muss die VHDL-Beschreibung manuell neu erstellt werden.

• Es können sich viele Fehler einschleichen.

• Der Aufwand ist enorm.

Page 27: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 27 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Synthese von „timed behavioral descriptions“

… Co-Centric Celoxica: DK design suite (Handel-C),

Agility (SystemC)

Page 28: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 28 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

SystemC Synthese Ablauf

1. Produce a simulation model of your design in SystemC/C++.2. Produce a testbench (also in SystemC/C++).3. Simulate and test the model.4. Refine the simulation design into synthesizable code.

Carry this out manually. Good practice to split your design into header (.h) files and the corresponding implementations in .cpp files for easier recompilation.

5. Compile your design into RTL SystemC using Agility.6. Test the synthesizable model.7. Compile your design into HDL (EDIF, Verilog or VHDL) using

Agility. Different synthesis flags and optimizations available.8. Examine the synthesis reports.9. If constraints not met: refine your design and repeat. 10.Once requirements are met, run Place and Route tools.

[Celoxica: Agility Compiler manual, v 1.1, 2006]

Page 29: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 29 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Agility code requirements

The source code and header files include: header files appropriate for simulation or synthesis (as

specified in a preprocessor directive) an ag_main function, used for synthesis, comprising an

instantiation of a top-level module and any user constraints an sc_main function, called for simulation, and comprising

an instantiation of a top-level module & user constraints a top-level module, instantiating modules to be synthesized modules, threads, methods describing the logic of your

design Signals, FIFOs, channels describing communication

[© Celoxica]

Page 30: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 30 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Supported types

Type Available for compile-time evaluation

Available for synthesis

char ok ok

short int

int

long int

long long int

float ok no

double

long double

bool ok ok

Pointers ok If compile-time resolvable

References ok If compile-time resolvable

Unions no no

Bit fields no no

Arrays ok Depends on contents

Structs ok Depends on contents

sc_ufixed no no

sc_int, sc_uintsc_bigint, sc_biguint, sc_fixed

ok ok

Page 31: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 31 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Steps used in the Agility compiler

[© Celoxica]

Page 32: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 32 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Compile-time evaluation

Agility unrolls loops, resolves pointers, inlines functions, evaluates values of variables known at compile-time. Loop unrolling

Loop unroller unrolls loops that must be unrolled and skips over those that do not. Any loops without wait() statements unrolled to produce combinational logic.

[© Celoxica]

Page 33: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 33 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Loop unrolling limitations

The loop unroller cannot unroll loops containing: wait statements loop conditions including unknown variables.

Loops containing wait() statements are skipped and the values of variables in their bodies are tagged as unknown.If the condition of a loop that must be unrolled contains a variable with an unknown value, it causes an error. Exampleint k = 0;for (int i=0; i<10; i++) { k = k + 5; wait(); }for (int j=0;j<k; j++) { ... code without waits }1st loop is skipped due to wait statement k = unknown. 2nd loop cannot be unrolled. [© Celoxica]

Page 34: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 34 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Compile-time recursive definitions

Synthesis of recursive definitions whose arguments can be determined at compile time.Be sure recursive definitions terminate!

Example: Fibonacci functionint Fibonacci( int n ){ if (n == 0) // check for termination return 0; if (n == 1) // check for termination return 1; if (n > 1) return ( Fibonacci(n-1) + Fibonacci(n-2) ); }

Call to Fibonacci(6) returns 8. [© Celoxica]

Page 35: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 35 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Function inlining

Agility inlines all function definitions.

Example:int multiply_and_accumulate(int x, int y, int z){return (x * y + z);}would be replaced by function body (suitably instantiated).For 2 calls to the function within the same clock cycle, 2 multipliers, 2 adders would be introduced.

Effect on the overall circuit size depends on the sharing that Agility may impose.

[© Celoxica]

Page 36: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 36 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Pointer resolution

Agility can synthesize pointers that are resolved at compile-time i.e. pointers that are not dynamically changed during the execution of the program.

Example:

SC_MODULE(MyModule){ DaughterModule * DaughterA;...SC_CTOR(MyModule){ DaughterA = new DaughterModule();...}}

[© Celoxica]

Page 37: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 37 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

High-level synthesis: Register inference

Registers are inferred from the use of variables.Example:int i = 1, j = 2, k;for (;;) {k = i + j; j++; i = k; // Clock cycle 1 wait(); i++; // Clock cycle 2 wait(); } k only set and read on the same clock cycle and does

not persist to another clock cycle: k is a wire. i is set and read in every clock cycle: i is a register. j is read in 1st clock cycle and this value is read in the

next execution of the loop: j is a register. [© Celoxica]

Page 38: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 38 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Fine-grained logic sharing

Logic can be shared within a thread if resource constraints exist. Constraints can be defined for: multipliers, adders, subtractors, relational operators.

Agility can share operators when: Operations in different branches of conditional block Operations in different clock cycles

Example:a = b*c;wait();d = e*f;wait();if (Condition) a = b*c; else d = e*f;

single multiplier

[© Celoxica]

Page 39: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 39 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Special Case

It is not always possible to share entire expressions to produce the minimum hardware. Example:a = (b * c) + d; // multiply followed by addwait();e = f * (g + h); // add followed by multiplyThe order of evaluation of the operations is different.

If a user placed a constraint of 1 multiplier and 1 adder on this code, Agility could not satisfy these constraints (it does not add the necessary multiplexers and control state logic).

Instead, Agility would automatically add an extra resource for an operation. [© Celoxica]

Page 40: Fakultät für informatik informatik 12 technische universität dortmund Applications (2) Peter Marwedel Informatik 12, TU Dortmund.

- 40 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

Summary

Applications (2) Bio-sequence database scanning Parallel pattern recognition in physics Emulation (of new hardware processors)

General view on synthesis Definition of synthesis Different source and target levels of abstractions Synthesis from SystemC or C slowly becoming available Restrictions for Celoxica-Agility:

• Using timed behaviors …