Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
PyXL, Python eseguito in hardware con prestazioni ai massimi livelli

PyXL, Python eseguito in hardware con prestazioni ai massimi livelli

Il progetto PyXL dimostra la possibilità di usare Python anche nei sistemi embedded mission-critical, grazie a un chip su FPGA (AMD Zynq-7000) che esegue Bytecode con latenza di soli 480 ns.

Quando si parla di sviluppo embedded, ad esempio per programmare sistemi informatici “incorporati” all’interno di dispositivi fisici, come elettrodomestici, auto, sensori, robot, dispositivi medici, la scelta del linguaggio di programmazione ha sempre rappresentato un compromesso tra facilità d’uso, performance e controllo a basso livello. Python, celebre per la sua semplicità ed espressività, è stato per anni escluso dai contesti ad alta criticità temporale (situazioni in cui è fondamentale rispondere entro tempi precisi e molto brevi, come nei sistemi in tempo reale) per via della sua architettura interpretata e delle latenze introdotte dai runtime.

Uno sviluppatore indipendente ha presentato PyXL, un progetto che ambisce a portare Python anche nelle applicazioni mission-critical, sfruttando un chip in grado di eseguire il codice con una latenza minima, misurata in appena 480 nanosecondi. Niente male se si pensa che si tratta di una dimostrazione, svolta con un approccio non professionale, lontano dai laboratori delle più note aziende.

PyXL velocizza l’esecuzione di codice Python in hardware

Come anticipato nell’introduzione, l’obiettivo di PyXL è chiaro: portare Python nei contesti real-time, offrendo temporizzazione deterministica, accesso diretto all’hardware e prestazioni comparabili — se non superiori — a quelle del codice C embedded, senza rinunciare all’eleganza e alla leggibilità proprie di Python.

PyXL si appoggia sull’uso di un processore custom implementato su FPGA (AMD Zynq-7000), progettato per eseguire codice Python senza alcun interprete, sistema operativo o macchina virtuale. Il flusso di compilazione parte da un file .py, tradotto in Bytecode CPython, poi in linguaggio assembly e infine convertito in un binario eseguibile dalla pipeline hardware del processore.

Il progetto, descritto nel dettaglio in queste pagine, non esegue Python direttamente ma i binari compilati proprio come qualsiasi altra CPU; non prende il normale codice Python e lo esegue lato silicio. Inoltre, al momento, PyXL supporta un sottoinsieme di Python reale. Molte funzionalità di CPython non sono ancora implementate: la prima versione serve principalmente a dimostrare che è possibile eseguire Python in modo efficiente in hardware.

Il test: GPIO round-trip a 480ns

Per dimostrare l’efficacia di PyXL, l’autore ha condotto un test di latenza su operazioni GPIO, confrontando i risultati con quelli ottenuti avvalendosi di una PyBoard (MicroPython). Due pin sono stati collegati tramite jumper: il programma imposta il primo pin a 1 e attende che il secondo legga lo stesso valore, misurando il tempo intercorso.

Il risultato è che PyXL si mette appunto in evidenza per la sua contenutissima latenza di 480 ns, con temporizzazione completamente deterministica, senza jitter. Al contrario, MicroPython mostra risultati oscillanti tra 14µs e 25µs. Con prestazioni che vedono in vantaggio PyXL tra le 30 e le 40 volte rispetto alla configurazione PyBoard/MicroPython.

Il motivo principale risiede nella differente architettura: MicroPython passa per un interprete in C; PyXL esegue direttamente il Bytecode Python in hardware.

Il “nocciolo” di PyXL è integrato su FPGA, dove le funzioni GPIO sono fisicamente cablate. La memoria utilizzata è a bassa latenza e prevedibile, garantendo un comportamento identico a parità di input. Il processore è controllato da una CPU ARM sullo stesso SoC Zynq: essa si occupa della configurazione iniziale e del caricamento del binario compilato. Da quel momento, l’intera esecuzione avviene lato hardware.

Perché è vera innovazione

Al netto di tutta una serie di dettagli ancora ampiamente migliorabili, il progetto PyXL ci restituisce la concreta possibilità i usare Python nei contesti real-time: motion control, sensori industriali, robotica, automazione di precisione e sistemi embedded critici.

In questo modo, gli sviluppatori possono pensare di creare soluzioni Python per il controllo in tempo reale, per svolgere operazioni di inferenza (uso dei modelli AI) senza dover passare per un sistema operativo, per elaborare segnali e attuazione entro microsecondi (robotica di precisione), per mettere a punto sistemi industriali deterministici senza necessità di ricorrere al C o ad assembly.

Credit immagine in apertura: video dimostrativo PyXL

Ti consigliamo anche

Link copiato negli appunti