PyXL
lastmod 2025-04-29created 2025-04-291 edits
A hardware processor that runs Python
About
- A custom processor that runs Python directly in hardware, operating without an interpreter or JIT
- PyXL's GPIO round-trip time is 480ns, 30x faster than MicroPython's PyBoard
- Runs on a Zynq-7000 FPGA, with an ARM CPU handling setup and memory
- GPIO stands for general-purpose input/output, and PyXL executes it directly in hardware without going through a VM or software stack
- Provides deterministic and consistent performance in real-time control systems, robotics, embedded industrial systems, etc.
Introduction to PyXL
- PyXL is a custom processor that runs Python directly in hardware
- Runs Python code on silicon without an interpreter or JIT
- Converts CPython ByteCode to custom assembly and runs it on a pipelined processor
Features of PyXL
- Not C or inline loops
- Not MicroPython or a JIT
- Does not run Linux or an operating system
- A Python-only processor that is deterministic and designed for speed
PyXL's execution environment
- Runs on a Zynq-7000 FPGA, using the Arty-Z7-20 development board
- The PyXL core runs at 100MHz
- The ARM CPU handles setup and memory, and the Python code runs directly in hardware
What is GPIO?
- GPIO stands for general-purpose input/output, and lets software control LEDs, buttons, sensors, motors, etc.
- In MicroPython, Python code interacts with C functions to handle hardware registers
- PyXL executes Python bytecode directly in hardware, running on native hardware without an interpreter or function calls
GPIO test
- Tested by connecting two pins of the Arty board with a jumper cable
- Wrote a Python program to measure the time from setting GPIO pin 1 to 1 until 1 is measured on the other pin
- The performance difference is shown in a video comparing PyXL with the MicroPython VM on PyBoard
PyXL's program structure
- The Python program is compiled to CPython Bytecode and then converted to PyXL assembly
- A binary is generated and sent over the network to the Arty board
- The ARM CPU receives the application, copies it to memory shared with the PyXL hardware, and runs it
Platform comparison
- GPIO round-trip latency: PyXL 480ns, MicroPython (PyBoard) 14,741ns
- PyXL is 30x faster than PyBoard, and 50x faster when normalized for clock speed
Advantages of PyXL
- Python VMs are based on software interpreters, which introduces overhead and complexity
- PyXL removes these barriers and runs Python code directly in hardware
- GPIO access is physical, and control flow is predictable with consistent performance
Applications of PyXL
- Real-time control systems can be implemented in pure Python
- Meets strict timing constraints in ML inference and sensor response loops
- Handles motor feedback and sensor fusion in robotics with cycle-level precision
- Suitable for embedded industrial systems where timing and reliability matter