Python module for managing files using xscope
Project description
This library allows a program on the xCore to access binary files on the host machine via xscope.
Features:
Read and write binary files on the host machine from the xCore.
“wb” or “rb” file access mode only
6-8MBytes/s Device to Host speed (compared to 2kBytes/s for standard fielio).
Up to 1MBytes/s Host to Device speed.
Installation
Xscope fileio module consist of two parts:
A python module: launches the device application and simultaneously launches the host application to communicate xscope data to/from.
A host application: an executable that runs on the host machine and communicates with the device application.
To install the xscope fileio python module, simply run:
pip install .
For Linux and Mac, the host application is installed alongside the python module. For Windows, you will have to build the host application yourself. For more information for building the host app in windows see host/README.
Host side API
The host-side interface is written in Python. To run an xcore binary with access to xscope fileIO, use:
import xscope_fileio
xscope_fileio.run_on_target(adapter_id, firmware_xe, use_xsim=False)
This can be combined with xtagctl e.g.:
with xtagctl.acquire("XCORE-AI-EXPLORER") as adapter_id:
xscope_fileio.run_on_target(adapter_id, device_xe)
Device side API
Source and header files for device code are found in the xscope_fileio directory.
The device side application requires a multi-tile main since it uses the xscope_host_data(xscope_chan); service to communicate with the host, which requires this. See examples for XC and C applications for how to do this.
You will also need a copy of config.xscope in your firmware directory. This enables xscope in the tools and sets up the xscope probes used by fileio for communicating with the host app. You can find a copy in xscope_fileio/config.xscope xscope_fileio/config.xscope.txt which you should rename to config.xscope.
System Architecture
The run_on_target function calls xrun --xscope-port with the binary and specified target adapter, and simultaneously launches a host application to communicate xscope data to/from the xrun process via sockets. The host application responds to xscope_fileio API calls in the firmware code, reading/writing to the host file system.
The call to run_on_target returns when the firmware exits.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file xscope_fileio-1.3.0.tar.gz
.
File metadata
- Download URL: xscope_fileio-1.3.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19ffdd8a22eac0158c8c02666557db2ea98a9737c575f99b526513931315bf37 |
|
MD5 | e685bbffb7ecbf6d0a0db9dac2d7c693 |
|
BLAKE2b-256 | 04f92fe0a7c3b01979d697a55c6a06c24536d9dd70d34cfc9267d5a8acab4dfd |
File details
Details for the file xscope_fileio-1.3.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: xscope_fileio-1.3.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 25.2 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e333c8154485787203c9f0cba2e760f71dc0033262acfd82bf7fc29ca0bc82fe |
|
MD5 | ff09c04268d017c1b3cf6d21486195d3 |
|
BLAKE2b-256 | 8d1527e1927b9944525f06c047f354ce5978a239236c866ab6943ec7a85a767e |
File details
Details for the file xscope_fileio-1.3.0-cp310-cp310-manylinux_2_35_x86_64.whl
.
File metadata
- Download URL: xscope_fileio-1.3.0-cp310-cp310-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 24.2 kB
- Tags: CPython 3.10, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.6 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7bbaaf3e9e2e03b93fcd4b8825e87ce3c7f45f7f7c9049d6cc1bb0d4bd4355e |
|
MD5 | 5bc8f510c9d1285814b0f24db38eb336 |
|
BLAKE2b-256 | 1223422af5eee961632706541983f1d986a0b52698d6ae4f45b0e1954972adb1 |