02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA)...
Transcript of 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA)...
![Page 1: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/1.jpg)
1 1
Embedded and Reconfigurable Systems M
02 – Hello LED
Stefano Mattoccia, DISI - University of Bologna
![Page 2: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/2.jpg)
Creazione periferiche (C/C++) e validazione (C/C++)
Design entry grafico
Sviluppo software C/C++ per uno specifico OS
Fasi di sviluppo di un progetto Zynq
Questa parte sarà oggetto della mggior parte delle prossime lezioni
![Page 3: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/3.jpg)
ARM Memory Controller
Custom Module (FPGA) (e.g., GPIO)
DDR
AXI Lite
Esempio: accensione LED mediante ARM
Consideriamo, per il momento una periferica già esistente in forma di IP Core denominata GPIO.
![Page 4: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/4.jpg)
DDR
GPIO AXI INT
![Page 5: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/5.jpg)
La memoria (esterna) e lo spazio di indirizzamento (32 bit) sono condivisi tra:
• ARM Cortex A9_0
• ARM Cortex A9_1
• FPGA
Vi è un unico memory controller (all’interno del PS) e un unico spazio di indirizzamento per le memorie e le periferiche (sia ARM sia FPGA) che sono pertanto memory mapped tra:
0x00000000 -> 0xFFFFFFFF
La PL (FPGA), è connessa al controllore della memoria DDR mediante le porte High Performance HP 0, 1, 2, 3. Elevate prestazioni (GB/s) in lettura e scrittura
Zynq: spazio di indirizzamento
![Page 6: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/6.jpg)
0x00000000
0xFFFFFFFF
DDR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0x00100000
0x1FFFFFFF
GPIO 0x41200000
![Page 7: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/7.jpg)
Il progetto Vivado risultante per il controllo di 8 led mediante un IP core (GPIO) con interfaccia AXI lite è il seguente:
Ne progetto è stato inserito (automaticamente) un hub (AXI interconnect) nel caso si decidesse in futuro di utilizzare altre periferiche AXI lite. Inoltre, è stato inserito (automaticamente) un modulo per il controlle del reset del sistema (Processor System Reset).
Progetto Vivado
![Page 8: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/8.jpg)
#include <stdio.h> #include "platform.h" #include "xil_io.h" #include <unistd.h> int main() { init_platform(); int c; useconds_t sleeping_time_us = 50000; printf("Hello LED\n"); for (c=0;c<=255;c++) { printf("Xil_Out start %d\n",c); Xil_Out8(0x41200000, c); printf("Xil_Out done, sleeping for %d us\n",sleeping_time_us); usleep(sleeping_time_us); } for (c=255;c>=0;c--) { printf("Xil_Out start %d\n",c); Xil_Out8(0x41200000, c); printf("Xil_Out done, sleeping for %d us\n",sleeping_time_us); usleep(sleeping_time_us); } cleanup_platform(); return 0; }
Codice ARM/SDK (Baremetal OS)
![Page 9: 02 – Hello LEDvision.deis.unibo.it/~smatt/DIDATTICA/Sistemi_Embedded_M...Custom Module (FPGA) (e.g., GPIO) DDR AXI Lite Esempio: accensione LED mediante ARM Consideriamo, per il](https://reader030.fdocument.pub/reader030/viewer/2022041112/5f1b8a1b435bdb73d232b1a4/html5/thumbnails/9.jpg)