Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2790e84
rtl: add AXI4-Lite to Avalon-MM bridge
karolbudniak Aug 19, 2022
2b743df
rtl: add Avalon-MM address conversion module
karolbudniak Sep 27, 2022
58cf5eb
rtl: add xfcp_mod_avmm.v
karolbudniak Oct 24, 2022
440bbd4
python/xfcp: add ltile_htile_node.py with first helper functions to a…
karolbudniak Aug 31, 2022
7239e4f
python/xfcp/ltile_htile_node.py: add check for parameters before writ…
karolbudniak Oct 24, 2022
636a94b
python/xfcp/ltile_htile_node.py: fix prints
karolbudniak Oct 25, 2022
c0cd92a
python/xfcp/ltile_htile_node.py: add helper function combining more w…
karolbudniak Oct 25, 2022
32b2015
python/xfcp/ltile_htile_node.py: prepare functions to return PCS PMA …
karolbudniak Oct 26, 2022
fdb799d
python/xfcp/ltile_htile_node.py: use lane address offset in each L-Ti…
karolbudniak Nov 18, 2022
c0f592f
python/xfcp/ltile_htile_node.py: squash set_prbs_generator and set_pr…
karolbudniak Nov 22, 2022
18d17c9
python/xfcp/ltile_htile_node.py: add method for transceiver bounded c…
karolbudniak Nov 22, 2022
9fd8e93
python/xfcp/ltile_htile_node.py: add configurable call for reverse en…
karolbudniak Nov 22, 2022
05114b8
python: node.py, add get_by_name to retrieve a named xfcp instance
sessl3r Dec 11, 2023
f703cb4
python: ltile_htile_node, replace all exit calls with raising exceptions
sessl3r Dec 13, 2023
0531849
python: build paython package of xfcp library
Basseuph Sep 26, 2023
c7f7e4d
xfcp/python: add alternative packaging method support via setup.py
Basseuph Sep 27, 2023
f481504
python/packaging: add version check to support old and new style inst…
Basseuph Nov 17, 2023
5bdd4b6
Changes to use Labgrid with XFCP
Oct 3, 2022
5066e4d
python/xfcp: ltile_htile_node, fix dump_reg_space function
sessl3r Dec 18, 2023
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
*.pyc
*.vvp
*.kate-swp

python/xfcp.egg-info
python/build/
python/venv/
python/.eggs/
37 changes: 37 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MKFILE_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
VENVDIR = venv
VENVACTIVATE = $(VENVDIR)/bin/activate
XFCP_DIR = $(MKFILE_DIR)/
PYTHON_VERSION=$(shell python3 -c "import sys; v = list(sys.version_info[:2]); print(f'{int(v[0])}.{int(v[1])}')")
ifeq ($(PYTHON_VERSION), 3.6)
$(info Python Version supported)
else ifeq ($(PYTHON_VERSION), 3.10)
$(info Python Version supported)
else
$(error Python Version not supported, the supported versions are 3.6 and 3.10)
endif

.PHONY: xfcp

venv: $(VENVACTIVATE)

xfcp: venv
. $(VENVACTIVATE) && \
if [ $(PYTHON_VERSION) = "3.6" ]; then \
python setup.py install; \
else \
pip install $(XFCP_DIR); \
fi \

$(VENVACTIVATE): requirements.txt
test -d $(VENVDIR) || python3 -m venv $(VENVDIR) --copies
. $(VENVACTIVATE) && \
pip3 install wheel && \
pip3 install -r requirements.txt && \
touch $(VENVACTIVATE)

clean:
rm -rf __pycache__

mrproper: clean
rm -rf $(VENVDIR)
39 changes: 39 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
##Copyright (c) 2023 Jakob Arndt Missing Link Electronics, Inc.
##
##Permission is hereby granted, free of charge, to any person obtaining a copy
##of this software and associated documentation files (the "Software"), to deal
##in the Software without restriction, including without limitation the rights
##to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
##copies of the Software, and to permit persons to whom the Software is
##furnished to do so, subject to the following conditions:
##
##The above copyright notice and this permission notice shall be included in
##all copies or substantial portions of the Software.
##
##THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
##IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
##FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
##AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
##LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
##OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
##THE SOFTWARE.

[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "xfcp"
authors = [{name="Alex Forencich", email="jforenci@eng.ucsd.edu"}]
description="This python package enables the use of xfcp as a library for your python implementation."
version = "1.0"
requires-python = ">=3.6"
dependencies = [
"pyserial"
]

[tool.setuptools]
packages = ['xfcp']

[tool.setuptools.package-dir]
"xfcp" = "xfcp"
1 change: 1 addition & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyserial
38 changes: 38 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
##Copyright (c) 2023 Jakob Arndt Missing Link Electronics, Inc.
##
##Permission is hereby granted, free of charge, to any person obtaining a copy
##of this software and associated documentation files (the "Software"), to deal
##in the Software without restriction, including without limitation the rights
##to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
##copies of the Software, and to permit persons to whom the Software is
##furnished to do so, subject to the following conditions:
##
##The above copyright notice and this permission notice shall be included in
##all copies or substantial portions of the Software.
##
##THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
##IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
##FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
##AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
##LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
##OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
##THE SOFTWARE.

from setuptools import setup

setup(
name="xfcp",
version="1.0.0",
description="This python package enables you to control the NPAP Test FPGA",
author="Alex Forencich",
author_email="jforenci@eng.ucsd.edu",
packages=[
'xfcp'],
package_dir={
"xfcp": "xfcp"
},
setup_requires=['setuptools_scm'],
install_requires=[
'pyserial',
]
)
12 changes: 10 additions & 2 deletions python/xfcp/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ def get_root(self):


class SerialInterface(Interface):
def __init__(self, port='/dev/ttyUSB0', baud=115200, timeout=10):
def __init__(self, port='/dev/ttyUSB0', baud=115200, timeout=10, driver=None):
"""
driver is expected to be a SerialDriver class from the labgrid module
"""
super().__init__()

self.port = port
self.baud = baud
self.serial_port = serial.Serial(port, baud, timeout=timeout)

# if labgrid driver is given, use labgrid driver
if driver is None:
self.serial_port = serial.Serial(port, baud, timeout=timeout)
else:
self.serial_port = driver.serial

@property
def timeout(self):
Expand Down
Loading