Skip to main content

Chriesibaum's BSDL file parser

Project description

Chriesibaum's BSDL File Parser

pypi python PyPI - Downloads GitHub stars
Tests Status Coverage Status

When I was tinkering around with JTAG and BSDL files, I realized that there was no truly functional BSDL file parser for Python. Perhaps I simply didn't search hard enough. In any case, many packages are no longer up to date or have broken dependencies. Let's get our hands dirty - a few moments later and here is what I needed. If you can use it too, I'm happy to receive any inputs.

Basic usage:

Download and install the package from pypi.org. It's recommended to install the package into a virtual Python environment.

pip install cb_bsdl_parser

There are two tools available to examine BSDL files:

  • cb_bsdl_check: To check a BSDL file
  • cb_bsdl_info: To get basic data and info from a BSDL file
cb_bsdl_check <bsdl_file> [options]
cb_bsdl_info <bsdl_file> [--cell CELL] [--print-bsr-table]

To use it in your Python project, create a BSDL object and extract the needed data:

bsdl = CBBsdl('bsdl_file.bsdl')

bsdl.get_entity_name()

# get the pin mapping as a dict:
pin_map = bsdl.get_pin_map()

# or just print the boundary scan table:
bsdl.print_bsr_table()

There is a handful of more methods available to extract other data from the BSDL file.

Development

Dev tool installation

The development is mainly being done on an Ubuntu 24.04 box. To set up a dev environment, use Python 3 and install the following packages:

pip install -r requirements.txt
pip install -r requirements_dev.txt

To use antlr4, install it from the deb package sources/store:

sudo apt install antlr4

Note: If a Python virtual environment installs antlr4-tools, its antlr4 wrapper may fail offline with a .m2/repository/org/antlr/antlr4 error.

Current parser generation setup (no VSCode ANTLR required):

  • Preferred: venv-local jar at /tmp/venv_cb_bsdl_parser/tools/antlr4-4.13.2-complete.jar
  • Fallback: /usr/bin/antlr4
  • Last fallback: antlr4 from PATH

If needed, place a local ANTLR jar into the active venv:

source envsetup.sh
mkdir -p "$VIRTUAL_ENV/tools"
curl -fL -o "$VIRTUAL_ENV/tools/antlr4-4.13.2-complete.jar" \
	https://repo1.maven.org/maven2/org/antlr/antlr4/4.13.2/antlr4-4.13.2-complete.jar

About Café - The source of coding! ;-)

Do you like this project and would like to support it? I am delighted about every single Café- It keeps me running! Or would you sponsor the project on github sponsors? Thanks for your support!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cb_bsdl_parser-0.9.0.tar.gz (163.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cb_bsdl_parser-0.9.0-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file cb_bsdl_parser-0.9.0.tar.gz.

File metadata

  • Download URL: cb_bsdl_parser-0.9.0.tar.gz
  • Upload date:
  • Size: 163.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cb_bsdl_parser-0.9.0.tar.gz
Algorithm Hash digest
SHA256 e5d277fb7001d0a47f7686ff97c6230e91e76553a1c18a9a5b8b0e01a9ba787c
MD5 6911c544d9fd3012de17ec4f93dd6231
BLAKE2b-256 7e8ceb3364ab0c1d007fc260f237b9dc105129f8d9a367626a4c9cd0fd0249c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cb_bsdl_parser-0.9.0.tar.gz:

Publisher: publish_to_pypi.yml on chriesibaum/cb_bsdl_parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cb_bsdl_parser-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: cb_bsdl_parser-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 69.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cb_bsdl_parser-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66d0404fdc63f699ad6a1350be9fa11a0dd181eacb61d4663fea8e1c06fb49b8
MD5 6185749407b03952f17744223821ebe8
BLAKE2b-256 ca1fd5ed28e3c498b6401b176f051dc6c11e6bbb7f5dea0d8f19575c8e48a249

See more details on using hashes here.

Provenance

The following attestation bundles were made for cb_bsdl_parser-0.9.0-py3-none-any.whl:

Publisher: publish_to_pypi.yml on chriesibaum/cb_bsdl_parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page