Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to run with cocotb 1.72 #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:

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

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
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
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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,14 @@ addopts =

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

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
setenv =
Expand Down Expand Up @@ -82,4 +82,4 @@ source =
# do not report dependencies
[coverage:report]
omit =
.tox/*
.tox/*