Skip to main content

Boundary scan test library

Project description

EByST

Boundary scan test framework for board validation

Basic example

# initialize JTAG interface driver (currently only FTDI chips with MPSSE are supported)
drv = ebyst.drivers.MPSSE(ebyst.drivers.MPSSE.list_devices()[0])
ctl = ebyst.TapController(drv)
ctl.detect_chain()

# Add device(s) to chain
dev = ebyst.Device.from_bsdl("bsdl/BSDLLCMXO2-256HCQFN32.BSM")
ctl.add_device(dev)
ctl.validate_chain()

# Start test
ctl.extest()

# Loopback test (assuming loopback on pins
dev.pinmap['O'].output_enable(True)
dev.pinmap['I'].output_enable(False)
dev.pinmap['O'].set_value(1)
await ctl.cycle() # drive output
await ctl.cycle() # sample input
print(dev.pinmap['I'].get_value())
dev.pinmap['O'].set_value(0)
await ctl.cycle() # drive output
await ctl.cycle() # sample input
print(dev.pinmap['I'].get_value())

# I2C test
i2c = ebyst.interfaces.I2C(ctl, dev.pinmap['PB9A'], dev.pinmap['PB4B'])
await i2c.init()
dev_address = 0xa0
reg_address = 0x10
data = 0xa5
print(f"Writing {dev_address:02x}:{reg_address:02x} <= {data:02x}")
await i2c.write(0xa0, 0x10, 0xa5)
print(f"Reading {dev_address:02x}:{reg_address:02x} => ", end='')
await x = i2c.read(0xa0, 0x10)
print(f"{x:02x}")

ctl.reset()

Async

The library uses asyncio to allow running multiple tests in parallel. When the loopback test and I2C test above are put in different tasks, they share the same boundary scan cycles, meaning they run completely parallel (Note that this only works when they are not using different pins, if pins are shared between tests, make sure to schedule them appropriately)

Example;

async def main():
    drv = ebyst.drivers.MPSSE(ebyst.drivers.MPSSE.list_devices()[0])
    dev = ebyst.Device.from_bsdl("bsdl/BSDLLCMXO2-256HCQFN32.BSM")
    ctl = ebyst.TapController(drv)
    ctl.detect_chain()
    ctl.add_device(dev)
    ctl.validate_chain()
    ctl.extest()
    async with asyncio.TaskGroup() as tg:
        tg.create_task(loopback_test(ctl, dev.pinmap['PB2C'], dev.pinmap['PB2A']))
        tg.create_task(loopback_test(ctl, dev.pinmap['PB4C'], dev.pinmap['PB4D']))

if __name__ == "__main__":
    logging.basicConfig()
    logging.getLogger().setLevel(logging.INFO)
    asyncio.run(main())

see also tests/test_async.py

Tracing

Generate .vcd traces for selected pins;

    pins = {
        'MDC':      dev.pinmap["IO_Y12"],
        'MDIO':     dev.pinmap["IO_Y13"],
    }
    ctl.trace("mdio.vcd", **pins)
    mdio = MDIO(ctl, **pins)

AC coupled nets

1149.6 is supported to test AC coupled nets;

# Start test
ctl.extest_pulse()

# Loopback test (assuming loopback on pins
dev.pinmap['O'].output_enable(True)
dev.pinmap['I'].output_enable(False)
dev.pinmap['O'].set_value(1) # generate a pulse
await ctl.cycle() # drive output
print(dev.pinmap['I'].get_value())
await ctl.cycle() # sample input
print(dev.pinmap['I'].get_value()) # should be 1
await ctl.cycle()
print(dev.pinmap['I'].get_value()) # should be 0

STAPL player

ebyst comes with a basic stapl player called stapyl;

staplay ftdi://0x1514:0x2008:001UD001/1 polarfire.stapl READ_IDCODE

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

ebyst-0.4.0.tar.gz (117.9 kB view details)

Uploaded Source

Built Distribution

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

ebyst-0.4.0-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file ebyst-0.4.0.tar.gz.

File metadata

  • Download URL: ebyst-0.4.0.tar.gz
  • Upload date:
  • Size: 117.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ebyst-0.4.0.tar.gz
Algorithm Hash digest
SHA256 efcee05c63fc78583892b38240b090396afca9418d1a929f786ea2110c754b66
MD5 594efbaf51f94fab16fb164ca33761b8
BLAKE2b-256 eebe0cfb94fc422916d3b37d2e4c3f909ee9d60b157e4c53ba93d37f8cc23ce4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ebyst-0.4.0.tar.gz:

Publisher: publish-to-pypi.yml on swolix/ebyst

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

File details

Details for the file ebyst-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ebyst-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ebyst-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9df01c197938aee6e1996ac1c2e5794bb1e9e565c4a54b4356cc204b699e0ff
MD5 e9b40ee153cb16ad1718dfbbe6fe0dbd
BLAKE2b-256 be49c57d0a562cb092be445beda6206fa7189160a31436c344b53bd446444e45

See more details on using hashes here.

Provenance

The following attestation bundles were made for ebyst-0.4.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on swolix/ebyst

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