1 welcome idpasc school on digital counting photosensors for extreme low light levels lisboa, 16-20...

61
1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Upload: susanna-jasmin-martin

Post on 17-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

1

WelcomeIDPASC school on

Digital Counting Photosensors for

Extreme Low Light Levels

Lisboa, 16-20 April 2012

Page 2: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Introduction to FPGAS and Verilog

Pedro Assis

2

Page 3: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

3

FPGAs in DAQ

Page 4: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

4

DAQ – Data Acquisition

Detector

PC

Electronics

Page 5: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

5

DAQ

Detector

PC

Electronics

Analog

Digital

Page 6: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

6

Detector

Preamp Amplifier Shaper

ADC

FPGA

PC

Analog

Digital

Page 7: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

7

Where are FPGAs

Where you need to take care of a lot of data very fast.Where you need reprogrammable logic

One of the standard places is the

Trigger system!

Lots of data;Very fast decision-to reduce data to be manageable

Page 8: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

FPGAPlease don’t be afraid...

8

Page 10: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

10

How does it work?

MAGIC?

Page 11: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

ProgrammingDigital Logic ?Everything works based on magic or gnomes

Programming microprocessors

(assembly, c++, etc.)

Give the “gnome” a list (consecutive) of operations to

perform

1 Machine executes several tasks consecutively

Programming Digital Logic

(FPGAs+HDL)

Give the gnome a list of objects/ machines to build

Many Machines execute several tasks in parallel

In High level languages sometimes they get confused

2+2?Result x 2?

A=2+2Cout << AA=A*2Cout << A

A=2+2Output AA=A*2Output A

A=44!A=88!

time

Adder: A=4“at the same time”Multiplier: A=A*2Output ?? (glitches?)

11

Page 12: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

FPGA is not a computer, although you can implement one inside

FPGA is not a toy, although you can implement one inside

12

Page 13: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

FPGA

13

Field Programmable Gate Array:Set of “chips” in a “bread board”Programmming:Chip functionsConnections between chips

Page 14: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Logic elements – “the Chips”

14

Page 15: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

74LS…. vs FPGAs

HDLcode

15

Page 16: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Software - Schematic

Logic

Schematicprogramming

OutputInput

16

Page 17: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Software - verilog

Logic

VerilogProgramming

Output

Input

17

Page 18: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

18

Implementing a Multiplexer

module mux(f, a, b, sel); output f; input a, b, sel;

and g1(f1, a, nsel), g2(f2, b, sel);or g3(f, f1, f2);not g4(nsel, sel);

endmodule

module mux(f, a, b, sel);output f;input a, b, sel;

reg f;

always @(a or b or sel) if (sel) f = a; else f = b;

endmodule

module mux(f, a, b, sel);output f;input a, b, sel;

assign f = sel ? a : b;

endmodule

a

b

a

bf f

Page 19: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

19

Verilog syntax basicsIt follows C like syntax: don’t get confused it is NOT C!

input in;output out;wire a;reg b;reg [7:0] c;

assign a=7’hFF;assign a=15;

always @ (*)begin

a=in;end

always @ (posedge clk)begin

c<=c+1;end

Page 20: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

20

Verilog syntax basicsIt follows C like syntax: don’t get confused it is NOT C!

module cont(clk, c);input clk;output c;

reg [7:0] c;always@ (posedge clk)begin

c<=c+1;endendmodule

module cont(input clk, output reg [7:0] c);always@ (posedge clk)begin

c<=c+1;endendmodule

cont c1(clk_50, LEDR[7:0]);

Modules Definition

Modules instantiation

Page 21: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

reduction operators: Logical operators:

21

Verilog syntax basicsIt follows C like syntax: don’t get confused it is NOT C!

Bitwise operators:if (a==1)begin...endelsebegin...end

~a NOT

a&b AND

a|b OR

a^b XOR

&a AND

~&a NAND

|a OR

~|a NOR

^a XOR

!a NOT

a&&b AND

a||b OR

a==b EQUAL

a!=b NOT EQUAL

operators:a?b:c if a then b else c

a>b greater than

a>=b greater than or equal

a<b less than

a<=b less than or equal

Page 22: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

22

Page 23: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

23

Hardware: buy and hack it

Page 24: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Hardware

24

~200€ for

academic

Page 25: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Hardware

25

Page 26: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

HardwareDE2_Pin_Table.pdf

26

Page 27: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

27

Page 28: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

30 seconds to light a LEDFileOpen ProjectDE2_top

28

Page 29: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

29

Build your own computer...

Page 30: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Connecting modules to build complex machines

30

Page 31: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Modules

31

Page 32: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Top-Level: connect the modules

32

Page 33: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

33

Example: A simple counterDo you know a simple way to count 10 ns pulses? Lots of them?

Page 34: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

34

Tools - SimulationQuartus II

Define the signals :Inputs – stimulusOutputs - results

Define the stimulus to the system

Run the simulation and you get the result

Page 35: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

35

Tools – Measurement instrumentsWaveform

s

Logic Levels

Page 36: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

36

Tools – Internal Logic AnalyserSignal-TAP embedded Logic

AnalyserQuartus II Handbook Version 9.0 Volume 3: Verification

14. Design Debugging Using theSignalTap II Embedded Logic Analyzer

Page 37: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

37

Tools – Internal Logic Analyser

CONTROL

The signal you want to

“see”

Trigger definition

Clock definition

Page 38: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

38

Tools – Internal Logic Analyser

The logic analyser will collect data from the registers and output it through the JTAG programming interface

Tools – Signal probeInternal signals can be extracted to output pins and connected to na external logic analyser. Signals can be exchanged easily…

Page 39: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

44

data!!

• Select the four signals;• Editgroup

• Select the group• EditBus Display FormatUnsigned Line Chart

• Unzoom

Page 40: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

45

Tools – Mega Wizard

Page 41: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

46

Page 42: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

47

Page 43: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

48

Page 44: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

49

Mega Wizard – What you get

ftp://ftp.altera.com/up/pub/Tutorials/DE2/Digital_Logic/tut_lpms_verilog.pdf

Page 45: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

52

And finally… Microprocessors

http://www.altera.com/education/demonstrations/sopc-builder/sopc-builder-demo.html

The SOPC Builder is a tool used in conjuction with the Quartus II CAD software. It allows the user to easily create a system based on the Nios II processor, by simply selecting the desired functional units and specifying their parameters.

ftp://ftp.altera.com/up/pub/Tutorials/DE2/Computer_Organization/tut_sopc_introduction_verilog.pdf

Tools – SOPC builder

Lots of tools and tutorials…e.g. NIOS IDE (Integrated Development Environment)DE2 demonstrations

There are other choices of μ-processors to implements. E.g.: mipsOperating systems can be used. E.g. μ-Clinux™

Page 46: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

cronographThe lab exercise

Page 47: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Thank you!

54

Page 48: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

*******************

55

Page 49: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

56

SiPMs …

Page 50: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

SiPM – Silicon PhotoMultiplier

Foto-Diodo de avalanche em modo Geiger com resistência Quenching Resitor

SiPM pixel

SiPM Matrix

SiPMs – CMOS binário1 célula tem sempre o mesmo sinalSaída: Soma de várias célulasSinais “digitalizados” Ideiais para “Single Photon Counting”EficientesPodem ser expostos a luzTensões baixas (<100v)

Problemas:Dependência com a temperatura;Dependência com a tensãoRuídoCrosstalk

Page 51: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

No LIP…

1 p.e.

2 p.e.

3 p.e.

4 p.e.

5 p.e.

Caracterização dos SiPMSistema controlo temperatura (~ -20ºC)Sistema leitura 64 canais

Substituir uma câmara de Auger:Auger: 800 mm x 800 mm = 6.4 x 105 mm2

1 SiPM: 3 mm x 3 mm = 9 mm2

Nº canais da ordem de 7 x 104

Ganhos:ResoluçãoEficiência do detector

Page 52: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Photon counting

Threshold simples: DigitalVários Thresholds: Aumentar gama dinâmicaPode ser implementado num ASIC: Muitos Canais

Page 53: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

O ASIC de front-end

Baseline OptionASIC MAROC3

64 pré-amplificadores Ganho programável por canal64 sinais digitais de saída ADC 12 bits

Page 54: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

ERC - Elementary Readout CellA

syn

chro

no

us

Syn

chro

no

us

Fotões

Sinais Analógicos

64x Sinais Digitais

2x links série

FPGA: trigger local; Compressão; Gestão

Page 55: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Aquisição de Dados em pirâmide…

Page 56: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

L2/L3 boards

Altera® Stratix® IV GX FPGA 16 x 6.25 GHz SerDes transceiversOptical Links (3.125 Gbps) or SFP+ (6.25 Gbps)2 x 1 GB SDRAM

Optical LinksBackplane

Scalable solution

PC Optical Link Board

Solução Comercial:Placas MicroTCA (industria Telecomunicações)Vários links opticos por placaPodem ser instalados numa crate com busFPGAs RápidasReprogramáveis

As Placas podem ser programadas como placas de trigger de nível L2 ou L3

Page 57: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Hardware

64

http://www.altera.comhttp://www.terasic.com.tw/en/

Development boards from ~$100

Page 58: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

4 exercícios:• “Olá Mundo”• “Breitling”• Mira Técnica• Jogo

1 Trabalho final “negociado”Caderno de encargos define requisitos

3-4 semanas aulas14 semanas laboratório

PCLD

Page 59: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

SiPM Multi-Pixel Arrays

Zecotek Photonics, MAPD3-N device

Gain: 7x104 – 1x105 (11-15 fC for 1 p.e.)

Dark current: 1-3 MHz per 3x3 mm2 pixel

Temperature sensitivity (dM/dV) ~5%/ºC

Crosstalk: 5-15%

Bias supply: 90 V, common cathode

1 p.e.

2 p.e. 3 p.e.

4 p.e.

5 p.e.

6 p.e.

7 p.e.

8 p.e.

8x8 configuration

CERN, Y. Musienko

Anfimov et al., NIM A in press 2010

Page 60: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

ERC - Elementary Readout Cell

64 SiPM (8x8 configuration) array

64 input channel ASIC with 64 discriminators

Charge output available as option

Local clock at 40/80 MHz

Total bandwidth between ASIC and ERC FPGA: 2.56 Gbps at 40 MHz or 6.4 Gbps at 100 MHz

ERC FPGA performs zero suppressionand local threshold

Asy

nch

ron

ou

sS

ynch

ron

ou

s

Output serial links (LVDS, min 100 MHz)

Typical payload: 64 bits + 40 bit Timestamp (clock counter) + overhead + trailer ~ 110-120b

2x100 Mbps LVDS link compatible with ~2 MHz event rate / 64 channels)

Page 61: 1 Welcome IDPASC school on Digital Counting Photosensors for Extreme Low Light Levels Lisboa, 16-20 April 2012

Main options

Bonus: DAQ architecture can re-use standard MA-PMTs

From Industry: Fast Data transfer standards. E.g.• xTCA from Telecom Industry• Inherent asynchronous (network switching)• Data and slow-control data streams can be send over the same data lines, reducing the

number of cables required

Signals Digitized and time-tagged “as soon as possible”. Data forward @ max bandwith using off-the-shelf links and boards.

• A clock is distributed only to front-end boards, for time marker assignment• Each trigger primitive has a time marker assigned by the front-end board• All trigger primitives from front-end boards sent asynchronously to trigger boards via

data links running at their own clocks, for maximum bandwidth• In an asynchronous system, each trigger level works at its own clock frequency• No timing procedures are required