diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 600a752..a5ac86f 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -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 }} diff --git a/README.md b/README.md index c21d08f..9cd81b9 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/cocotbext/uart/uart.py b/cocotbext/uart/uart.py index c64e603..d6dd0f5 100644 --- a/cocotbext/uart/uart.py +++ b/cocotbext/uart/uart.py @@ -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): @@ -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): diff --git a/setup.cfg b/setup.cfg index 5d067e4..051366a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -25,7 +25,7 @@ classifiers = [options] packages = find_namespace: -python_requires = >=3.6 +python_requires = >=3.7 install_requires = cocotb @@ -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 = @@ -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 @@ -82,4 +84,4 @@ source = # do not report dependencies [coverage:report] omit = - .tox/* \ No newline at end of file + .tox/*