Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on: [push, pull_request]
jobs:
build:
name: Python ${{matrix.python-version}}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ To use these modules, import the one you need and connect it to the DUT:

To send data into a design with a `UartSource`, call `write()` or `write_nowait()`. Accepted data types are iterables of ints, including lists, bytes, bytearrays, etc. Optionally, call `wait()` to wait for the transmit operation to complete. Example:

await uart_source.send(b'test data')
await uart_source.write(b'test data')
# wait for operation to complete (optional)
await uart_source.wait()

To receive data with a `UartSink`, call `read()` or `read_nowait()`. Optionally call `wait()` to wait for new receive data. `read()` will block until at least 1 data byte is available. Both `read()` and `read_nowait()` will return up to _count_ bytes from the receive queue, or the entire contents of the receive queue if not specified.

data = await uart_sink.recv()
data = await uart_sink.read()

#### Constructor parameters:

Expand Down
4 changes: 2 additions & 2 deletions cocotbext/uart/uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, data, baud=9600, bits=8, stop_bits=1, *args, **kwargs):
def _restart(self):
if self._run_cr is not None:
self._run_cr.kill()
self._run_cr = cocotb.fork(self._run(self._data, self._baud, self._bits, self._stop_bits))
self._run_cr = cocotb.start_soon(self._run(self._data, self._baud, self._bits, self._stop_bits))

@property
def baud(self):
Expand Down Expand Up @@ -182,7 +182,7 @@ def __init__(self, data, baud=9600, bits=8, stop_bits=1, *args, **kwargs):
def _restart(self):
if self._run_cr is not None:
self._run_cr.kill()
self._run_cr = cocotb.fork(self._run(self._data, self._baud, self._bits, self._stop_bits))
self._run_cr = cocotb.start_soon(self._run(self._data, self._baud, self._bits, self._stop_bits))

@property
def baud(self):
Expand Down
16 changes: 9 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# package information
[metadata]
name = cocotbext-uart
name = cocotbext_uart
version = attr: cocotbext.uart.version.__version__
description = UART modules for cocotb
keywords = uart, cocotb
Expand All @@ -25,7 +25,7 @@ classifiers =

[options]
packages = find_namespace:
python_requires = >=3.6
python_requires = >=3.7
install_requires =
cocotb

Expand All @@ -46,14 +46,16 @@ addopts =

# tox configuration
[tox:tox]
envlist = py36, py37, py38, py39
envlist = py38, py39, py310, py311, py312, py313

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312S
3.13: py313

[testenv]
setenv =
Expand All @@ -70,7 +72,7 @@ commands =
pytest --cov=cocotbext --cov=tests --cov-branch -n auto
bash -c 'find . -type f -name "\.coverage" | xargs coverage combine --append'

whitelist_externals =
allowlist_externals =
bash

# combine if paths are different
Expand All @@ -82,4 +84,4 @@ source =
# do not report dependencies
[coverage:report]
omit =
.tox/*
.tox/*