Real Time Embedded Systems
"System On Programmable Chip"
NIOS II – Avalon Bus
René Beuchat
Laboratoire d'Architecture des Processeurs rene.beuchat@epfl.ch
RB-P2012 4
To be able to construct a full system based on a standard softcore - - PowerPoint PPT Presentation
Real Time Embedded Systems "System On Programmable Chip" NIOS II Avalon Bus Ren Beuchat Laboratoire d'Architecture des Processeurs rene.beuchat@epfl.ch 4 RB-P2012 Embedded system on Altera FPGA Goal : To understand the
RB-P2012 4
6 RB-P2012
7 RB-P2012
8 RB-P2012
Embedded system NIOSII/Avalon Architecture
9 RB-P2012
Note: The same principles are available for Altera, Xilinx, Actel or others FPGA
11 RB-P2012
Some Avalon specifications : Multi-Master Arbitrage « slave-side » Concurrent Master-Slave Access Synchronous transfers
12 RB-P2012
14 RB-P2012
15 RB-P2012
NIOS II Processor, hardware accelerator
16 RB-P2012
NIOS II Processor, hardware accelerator
17 RB-P2012
19 RB-P2012
21 RB-P2012
example
22 RB-P2012
example
23 RB-P2012
24 RB-P2012
Signal Type
Direction
Required
clk 1 In (No)
Global clk for system module and Avalon bus
clk rising edge
nReset 1 In No
Global Reset of the system
address 1..32 In No
Address for Avalon bus modules
ChipSelect 1 In Old signal
Selection of the Avalon bus module
read/
read_n
1 In No
Read request to the slave
ReadData
8, 16, 32, .. (1024)
Out No
Read data from the slave module
write/
write_n
1 In No
Write request to the slave
WriteData
8, 16, 32, .. (1024)
In No
Data from Master to Slave module
Irq 1 Out No
Interrupt request to the master
25 RB-P2012
26 RB-P2012
27 RB-P2012
28 RB-P2012
29 RB-P2012
ByteEnable_n[3..0] Transfer action 0 0 0 0 Full 32 bits access 1 1 0 0 Lower 2 Bytes access 0 0 1 1 Upper 2 Bytes access 1 1 1 0 Lower Byte (0) access 1 1 0 1 Mid Low Byte (1) access 1 0 1 1 Mid Upper Byte (2) access 0 1 1 1 Upper Byte (3) access
Master Add
BE 3 BE 2 BE 1 BE Slave Add BE 0x..0 1 2 3 0x..4 4 5 6 7 0x..8 8 Word = Byte (8 bits) 9 Byte Address A B
30 RB-P2012
Master Add
BE 3 BE 2 BE 1 BE Slave Add BE 1 BE 0x..0 1 0x..4 2 3 0x..8 4 Word = Doublet (16 bits) Byte Address 5
31 RB-P2012
Master Add
BE 3 BE 2 BE 1 BE Slave Add BE 3 BE 2 BE 1 BE 0x..0 0x..4 1 0x..8 2 Word = Quadlet (32 bits) Byte Address
32 RB-P2012
Master Add
BE 3 BE 2 BE 1 BE Slave Add BE 7 BE 6 BE 5 BE 4 BE 3 BE 2 BE 1 BE 0x..0 0x..4 0x..8 1 Word = Octlet (64 bits) Byte Address
33 RB-P2012
Signal Type
Required
WaitRequest/
WaitRequest_n
1 Out No
Assert by the slave when it is not able to answer in this clock cycle to read or write access
ByteEnable/
ByteEnable_n
1, 2, 4, 8, .., 128 In No The bytes to transfer BeginTransfer 1 In No
Inserted by Avalon fabric at and only at first clock of each transfer
ReadDataValid/
ReadDataValid_n
1 Out No
For read transfer with variable latency, means data are valid to master
BurstCount 1..11 In No
Number of burst transfers BeginBurstTransfer 1
In No
First cycle of a burst transfer, valid for 1 clock cycle
34 RB-P2012
Signal Type
Direction
Required
ReadyForData 1 Out No DataAvailable
1
Out No ResetRequest/
ResetRequest_n
1 Out No ArbiterLock/
ArbiterLock_n
1 In No
35 RB-P2012
36 RB-P2012
37 RB-P2012
ReadData available at next rising edge of clk (E)
38 RB-P2012
39 RB-P2012
40 RB-P2012
41 RB-P2012
42 RB-P2012
43 RB-P2012
44 RB-P2012
45 RB-P2012
46 RB-P2012
47 RB-P2012
48 RB-P2012
Read transfers with latency, and readdatavalid generated by slave
49 RB-P2012
50 RB-P2012
51 RB-P2012
52 RB-P2012
53 RB-P2012
54 RB-P2012
55 RB-P2012
56 RB-P2012
57 RB-P2012
58 RB-P2012
59 RB-P2012
60 RB-P2012
61 RB-P2012
Data bus seen on the Avalon Master side Master addresses 31..24 23..16 15..8 7..0 Slave addresses 0x….00 0x….04 0x….08 0x….0C 0x….10 0x….14 Data Bus seen on the slave side 7..0 Slave addresses 0x…00 0x…01 0x…02 0x…03 0x…04 0x…05 RB-P2012 62
Data bus seen on the Avalon Master side Master addresses BE3 31..24 BE2 23..16 BE1 15..8 BE0 7..0 Slave addresses 0x….00 0x….00 0x….04 0x….04 0x….08 0x….08 0x….0C 0x….0C 0x….10 0x….10 0x….14 0x….14 RB-P2012 63 Data Bus seen on the slave side 7..0 Slave addresses 0x…00 0x…01 0x…02 0x…03 0x…04 0x…05
64 RB-P2012
Avalon Bus Switch
dec
Data bus seen on the Avalon Master side Master addresses BE3 31..24 BE2 23..16 BE1 15..8 BE0 7..0 Slave addresses 0x….00 0x….00 0x….04 0x….01 0x….08 0x….02 0x….0C 0x….03 0x….10 0x….04 0x….14 0x….05 RB-P2012 65 Data Bus seen on the slave side 7..0 Slave addresses 0x…00 0x…01 0x…02 0x…03 0x…04 0x…05
66 RB-P2012
Avalon Bus Switch
dec
8 32 undefined extension
A[7..2]
67 RB-P2012
FLASH SDRAM 64MB 16Mx32 CAMERA 128 x 100 LCD 96 x 40
Capteurs TCRT 1000 + AD
Moteurs + Odométrie MODULE RF HEVs LEDS DS2720 ALTERA CYCLONE EP1C12 UART0 UART1 JTAG NIOS II FLASH SDRAM 64MB 16Mx32 CAMERA 128 x 100 LCD 96 x 40
Capteurs TCRT 1000 + AD
Moteurs + Odométrie MODULE RF HEVs LEDS DS2720 ALTERA CYCLONE EP1C12
Instruction Cache 2k bytes Data Cache 2k bytes Cpu Clk 50 MHz
UART0 UART1 JTAG NIOS II FLASH SDRAM 64MB 16Mx32 GPIO SLAVE SLAVE MASTER Contrôleur SDRAM SLAVE Contrôleur EPCS4 SLAVE GPIO SLAVE CAMERA 128 x 100 LCD 96 x 40
Capteurs TCRT 1000 + AD
Moteurs + Odométrie MODULE RF HEVs LEDS DS2720 SLAVE ALTERA CYCLONE EP1C12
Instruction Cache 2k bytes Data Cache 2k bytes Cpu Clk 50 MHz
2 x UART UART0 UART1 JTAG JTAG NIOS II FLASH SDRAM 64MB 16Mx32
CAPTEURS
GPIO SLAVE SLAVE SLAVE MASTER Contrôleur SDRAM Contrôleur EPCS4 SLAVE I2C SLAVE GPIO SLAVE SLAVE LCD 96 x 40
Capteurs TCRT 1000 + AD
Moteurs + Odométrie MODULE RF HEVs LEDS DS2720 OneWire Dallas SLAVE SLAVE MOTEURS PWM ALTERA CYCLONE EP1C12
Instruction Cache 2k bytes Data Cache 2k bytes Cpu Clk 50 MHz
2 x UART UART0 UART1 JTAG JTAG SLAVE SLAVE CAMERA 128 x 100 CAMERA NIOS II FLASH SDRAM 64MB 16Mx32
CAPTEURS
GPIO SLAVE SLAVE SLAVE MASTER SLAVE DMA MASTER MASTER Contrôleur SDRAM SLAVE Contrôleur EPCS4 SLAVE I2C SLAVE CAMERA SLAVE GPIO SLAVE SLAVE CAMERA 128 x 100 LCD 96 x 40
Capteurs TCRT 1000 + AD
Moteurs + Odométrie MODULE RF HEVs LEDS DS2720 OneWire Dallas SLAVE SLAVE MOTEURS PWM ALTERA CYCLONE EP1C12
Instruction Cache 2k bytes Data Cache 2k bytes Cpu Clk 50 MHz
2 x UART UART0 UART1 JTAG JTAG NIOS II FLASH SDRAM 64MB 16Mx32
CAPTEURS
GPIO SLAVE SLAVE SLAVE MASTER SLAVE DMA MASTER MASTER Contrôleur SDRAM SLAVE Contrôleur EPCS4 SLAVE I2C SLAVE CAMERA SLAVE GPIO SLAVE SLAVE CAMERA 128 x 100 LCD 96 x 40
Capteurs TCRT 1000 + AD
Moteurs + Odométrie MODULE RF HEVs LEDS DS2720 OneWire Dallas SLAVE SLAVE MOTEURS PWM ALTERA CYCLONE EP1C12
7'430 / 12'000 LE (61%) 76'032 / 239'613 Mb (31%) 1 /2 PLL (50%) Instruction Cache 2k bytes Data Cache 2k bytes Cpu Clk 50 MHz
2 x UART UART0 UART1 JTAG JTAG
68 RB-P2012
Architecture of EP1C12 12’000 logic Elements (LE) 52 x 4 Kbits RAM 2 x PLLs 180 IOs on 4 bancs Proprietary Configuration Bus JTAG Port Quelques limites de fonctionnement multiplexor 161 : fmax LE = 275 MHz counter 64 bits : fmax LE = 160 MHz memory : fmax M4K = 220 MHz PLL : fmax PLL = 275 MHz
IOs Logic Array PLL M4K Blocs EP1C12
69 RB-P2012
Function Generator Register (T,D,JK,SR)
Look-Up Table (LUT) Carry Chain D ENA Q Data[3..0] Clock Enable LUT Chain Row, Col, Local Routing Register Chain Out Row, Col, Local Routing Carry In Carry Out Register Chain In Clear Preset
70 RB-P2012 Quartus II Hardware Description Schematic Editor, VHDL, … Synthesis + placement routing Simulation (graphical éditor ) Signal TAP SOPC Builder SOC NIOS II 2011 QSys Configuration + SOC generation Programmable Interface library Own Programmable Interfaces. Generation SDK NIOS II IDE NIOS II Code 2010 SBP Project management Compiler + Link Editor Debugger SOC Programmer
71 RB-P2012
Status Messages Console Script Editio n Project Navigator
Quartus //
Compilation
Working processus Edition Simulation Vérification Synthèse Autres Contraintes Téléchargement OK
72 RB-P2012
SOPC Builder
Components Library Interrupts Memory Map SOC Bus Arbitration Processor Nios II
73 RB-P2012
NIOS II IDE (development)
Source Project Navigator Edition Windows messages
74 RB-P2012
Objects tree Source Console messages Memory Variables source
NIOS II IDE (debugger)
Debugging
77 RB-P2012
Some positives points of a softcore architecture Fast implementation Modular Architecture Simplicity Good documentation Nice for teaching complex integrated embedded systems Ease of development of our own programmable interface on internal bus (i.e. Avalon in VHDL, Verilog) Full system on FPGA, easily adaptable Operating System included (uC/OS II) Some negate points Quite big tools to develop a system Thus tools to learn