amaranth-stubs 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amaranth_stubs-0.1.0/.github/workflows/publish-to-pypi.yml +105 -0
- amaranth_stubs-0.1.0/.gitignore +22 -0
- amaranth_stubs-0.1.0/LICENSE +24 -0
- amaranth_stubs-0.1.0/PKG-INFO +13 -0
- amaranth_stubs-0.1.0/amaranth-stubs/__init__.pyi +7 -0
- amaranth_stubs-0.1.0/amaranth-stubs/_toolchain/yosys.pyi +144 -0
- amaranth_stubs-0.1.0/amaranth-stubs/_unused.pyi +13 -0
- amaranth_stubs-0.1.0/amaranth-stubs/_utils.pyi +27 -0
- amaranth_stubs-0.1.0/amaranth-stubs/asserts.pyi +4 -0
- amaranth_stubs-0.1.0/amaranth-stubs/back/__init__.pyi +4 -0
- amaranth_stubs-0.1.0/amaranth-stubs/back/verilog.pyi +14 -0
- amaranth_stubs-0.1.0/amaranth-stubs/build/__init__.pyi +8 -0
- amaranth_stubs-0.1.0/amaranth-stubs/build/dsl.pyi +107 -0
- amaranth_stubs-0.1.0/amaranth-stubs/build/plat.pyi +102 -0
- amaranth_stubs-0.1.0/amaranth-stubs/build/res.pyi +53 -0
- amaranth_stubs-0.1.0/amaranth-stubs/build/run.pyi +122 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/__init__.pyi +30 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_ast.pyi +977 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_cd.pyi +21 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_dsl.pyi +180 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_ir.pyi +203 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_mem.pyi +197 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_nir.pyi +915 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/_xfrm.pyi +324 -0
- amaranth_stubs-0.1.0/amaranth-stubs/hdl/rec.pyi +209 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/data.pyi +272 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/enum.pyi +206 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/fifo.pyi +70 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/io.pyi +658 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/memory.pyi +356 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/meta.pyi +97 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/scheduler.pyi +13 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/stream.pyi +102 -0
- amaranth_stubs-0.1.0/amaranth-stubs/lib/wiring.pyi +1175 -0
- amaranth_stubs-0.1.0/amaranth-stubs/sim/__init__.pyi +11 -0
- amaranth_stubs-0.1.0/amaranth-stubs/sim/_async.pyi +192 -0
- amaranth_stubs-0.1.0/amaranth-stubs/sim/_base.pyi +93 -0
- amaranth_stubs-0.1.0/amaranth-stubs/sim/_pycoro.pyi +50 -0
- amaranth_stubs-0.1.0/amaranth-stubs/sim/core.pyi +66 -0
- amaranth_stubs-0.1.0/amaranth-stubs/sim/pysim.pyi +138 -0
- amaranth_stubs-0.1.0/amaranth-stubs/tracer.pyi +9 -0
- amaranth_stubs-0.1.0/amaranth-stubs/utils.pyi +23 -0
- amaranth_stubs-0.1.0/amaranth-stubs/vendor/__init__.pyi +8 -0
- amaranth_stubs-0.1.0/amaranth-stubs/vendor/_lattice_ecp5.pyi +129 -0
- amaranth_stubs-0.1.0/amaranth-stubs/vendor/_lattice_ice40.pyi +125 -0
- amaranth_stubs-0.1.0/amaranth_stubs.egg-info/PKG-INFO +13 -0
- amaranth_stubs-0.1.0/amaranth_stubs.egg-info/SOURCES.txt +53 -0
- amaranth_stubs-0.1.0/amaranth_stubs.egg-info/dependency_links.txt +1 -0
- amaranth_stubs-0.1.0/amaranth_stubs.egg-info/requires.txt +4 -0
- amaranth_stubs-0.1.0/amaranth_stubs.egg-info/top_level.txt +2 -0
- amaranth_stubs-0.1.0/amaranth_types/__init__.py +1 -0
- amaranth_stubs-0.1.0/amaranth_types/memory.py +83 -0
- amaranth_stubs-0.1.0/amaranth_types/types.py +194 -0
- amaranth_stubs-0.1.0/pyproject.toml +27 -0
- amaranth_stubs-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- 'master'
|
|
7
|
+
tags:
|
|
8
|
+
- 'v**'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
name: Build distribution
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.11'
|
|
23
|
+
- name: Install pypa/build
|
|
24
|
+
run: python3 -m pip install build --user
|
|
25
|
+
- name: Build a binary wheel and a source tarball
|
|
26
|
+
run: python3 -m build
|
|
27
|
+
- name: Store the distribution packages
|
|
28
|
+
uses: actions/upload-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: python-package-distributions
|
|
31
|
+
path: dist/
|
|
32
|
+
|
|
33
|
+
publish-to-pypi:
|
|
34
|
+
name: Publish to PyPI
|
|
35
|
+
if: ${{ github.repository == 'kuznia-rdzeni/amaranth-stubs' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && !contains(github.event.ref, 'dev') }}
|
|
36
|
+
needs:
|
|
37
|
+
- build
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
environment:
|
|
40
|
+
name: pypi
|
|
41
|
+
url: https://pypi.org/p/amaranth-stubs
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write
|
|
44
|
+
steps:
|
|
45
|
+
- name: Download all the dists
|
|
46
|
+
uses: actions/download-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: python-package-distributions
|
|
49
|
+
path: dist/
|
|
50
|
+
- name: Publish to PyPI
|
|
51
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
52
|
+
|
|
53
|
+
publish-to-testpypi:
|
|
54
|
+
name: Publish to TestPyPI
|
|
55
|
+
if: ${{ github.repository == 'kuznia-rdzeni/amaranth-stubs' && github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
|
|
56
|
+
needs:
|
|
57
|
+
- build
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
environment:
|
|
60
|
+
name: testpypi
|
|
61
|
+
url: https://test.pypi.org/p/amaranth-stubs
|
|
62
|
+
permissions:
|
|
63
|
+
id-token: write
|
|
64
|
+
steps:
|
|
65
|
+
- name: Download all the dists
|
|
66
|
+
uses: actions/download-artifact@v4
|
|
67
|
+
with:
|
|
68
|
+
name: python-package-distributions
|
|
69
|
+
path: dist/
|
|
70
|
+
- name: Publish to PyPI
|
|
71
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
72
|
+
with:
|
|
73
|
+
repository-url: https://test.pypi.org/legacy/
|
|
74
|
+
|
|
75
|
+
github-release:
|
|
76
|
+
name: Github Release
|
|
77
|
+
needs:
|
|
78
|
+
- publish-to-pypi
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
permissions:
|
|
81
|
+
contents: write
|
|
82
|
+
id-token: write
|
|
83
|
+
steps:
|
|
84
|
+
- name: Download all the dists
|
|
85
|
+
uses: actions/download-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: python-package-distributions
|
|
88
|
+
path: dist/
|
|
89
|
+
- name: Determine release metadata
|
|
90
|
+
id: metadata
|
|
91
|
+
env:
|
|
92
|
+
REF_NAME: ${{ github.ref_name }}
|
|
93
|
+
run: |
|
|
94
|
+
echo name=${REF_NAME/v/} >>$GITHUB_OUTPUT
|
|
95
|
+
- name: Create GitHub Release
|
|
96
|
+
env:
|
|
97
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
98
|
+
run: |
|
|
99
|
+
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --notes ""
|
|
100
|
+
- name: Upload to GitHub Release
|
|
101
|
+
env:
|
|
102
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
103
|
+
run:
|
|
104
|
+
gh release upload "$GITHUB_REF_NAME" dist/** --repo "$GITHUB_REPOSITORY"
|
|
105
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Environments
|
|
7
|
+
.env
|
|
8
|
+
.venv
|
|
9
|
+
env/
|
|
10
|
+
venv/
|
|
11
|
+
ENV/
|
|
12
|
+
env.bak/
|
|
13
|
+
venv.bak/
|
|
14
|
+
|
|
15
|
+
# Build
|
|
16
|
+
/build/
|
|
17
|
+
|
|
18
|
+
# Egg
|
|
19
|
+
*.egg-info
|
|
20
|
+
|
|
21
|
+
# Editors
|
|
22
|
+
*.swp
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Copyright (c) 2022-2024, University of Wroclaw
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
* Redistributions of source code must retain the above copyright
|
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
|
10
|
+
documentation and/or other materials provided with the distribution.
|
|
11
|
+
* Neither the name of the University of Wroclaw nor the
|
|
12
|
+
names of its contributors may be used to endorse or promote products
|
|
13
|
+
derived from this software without specific prior written permission.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
16
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
17
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF WROCLAW BE LIABLE FOR ANY
|
|
19
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
20
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
21
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
22
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: amaranth-stubs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
7
|
+
Classifier: Programming Language :: Python
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: amaranth==0.5.3
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pyright==1.1.332; extra == "dev"
|
|
13
|
+
Dynamic: license-file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .hdl import *
|
|
6
|
+
|
|
7
|
+
__all__ = ["Shape", "unsigned", "signed", "Value", "Const", "C", "Mux", "Cat", "Array", "Signal", "ClockSignal", "ResetSignal", "Module", "ClockDomain", "Elaboratable", "Fragment", "Instance", "Memory", "Record", "DomainRenamer", "ResetInserter", "EnableInserter"]
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__all__ = ["YosysError", "YosysBinary", "find_yosys"]
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class YosysError(Exception):
|
|
11
|
+
...
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class YosysWarning(Warning):
|
|
15
|
+
...
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class YosysBinary:
|
|
19
|
+
@classmethod
|
|
20
|
+
def available(cls) -> bool:
|
|
21
|
+
"""Check for Yosys availability.
|
|
22
|
+
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
available : bool
|
|
26
|
+
``True`` if Yosys is installed, ``False`` otherwise. Installed binary may still not
|
|
27
|
+
be runnable, or might be too old to be useful.
|
|
28
|
+
"""
|
|
29
|
+
...
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def version(cls) -> Optional[tuple[int, int, int]]:
|
|
33
|
+
"""Get Yosys version.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
``None`` if version number could not be determined, or a 3-tuple ``(major, minor, distance)`` if it could.
|
|
38
|
+
|
|
39
|
+
major : int
|
|
40
|
+
Major version.
|
|
41
|
+
minor : int
|
|
42
|
+
Minor version.
|
|
43
|
+
distance : int
|
|
44
|
+
Distance to last tag per ``git describe``. May not be exact for system Yosys.
|
|
45
|
+
"""
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def data_dir(cls) -> Path:
|
|
50
|
+
"""Get Yosys data directory.
|
|
51
|
+
|
|
52
|
+
Returns
|
|
53
|
+
-------
|
|
54
|
+
data_dir : pathlib.Path
|
|
55
|
+
Yosys data directory (also known as "datdir").
|
|
56
|
+
"""
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def run(cls, args: list[str], stdin: str=...) -> str:
|
|
61
|
+
"""Run Yosys process.
|
|
62
|
+
|
|
63
|
+
Parameters
|
|
64
|
+
----------
|
|
65
|
+
args : list of str
|
|
66
|
+
Arguments, not including the program name.
|
|
67
|
+
stdin : str
|
|
68
|
+
Standard input.
|
|
69
|
+
|
|
70
|
+
Returns
|
|
71
|
+
-------
|
|
72
|
+
stdout : str
|
|
73
|
+
Standard output.
|
|
74
|
+
|
|
75
|
+
Exceptions
|
|
76
|
+
----------
|
|
77
|
+
YosysError
|
|
78
|
+
Raised if Yosys returns a non-zero code. The exception message is the standard error
|
|
79
|
+
output.
|
|
80
|
+
"""
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class _BuiltinYosys(YosysBinary):
|
|
86
|
+
YOSYS_PACKAGE = ...
|
|
87
|
+
@classmethod
|
|
88
|
+
def available(cls): # -> bool:
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def version(cls): # -> tuple[int, int, int]:
|
|
93
|
+
...
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def data_dir(cls): # -> Traversable:
|
|
97
|
+
...
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def run(cls, args, stdin=..., *, ignore_warnings=..., src_loc_at=...):
|
|
101
|
+
...
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class _SystemYosys(YosysBinary):
|
|
106
|
+
YOSYS_BINARY = ...
|
|
107
|
+
@classmethod
|
|
108
|
+
def available(cls) -> bool:
|
|
109
|
+
...
|
|
110
|
+
|
|
111
|
+
@classmethod
|
|
112
|
+
def version(cls): # -> tuple[int, int, int] | None:
|
|
113
|
+
...
|
|
114
|
+
|
|
115
|
+
@classmethod
|
|
116
|
+
def data_dir(cls) -> Path:
|
|
117
|
+
...
|
|
118
|
+
|
|
119
|
+
@classmethod
|
|
120
|
+
def run(cls, args, stdin=..., *, ignore_warnings=..., src_loc_at=...):
|
|
121
|
+
...
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def find_yosys(requirement):
|
|
126
|
+
"""Find an available Yosys executable of required version.
|
|
127
|
+
|
|
128
|
+
Parameters
|
|
129
|
+
----------
|
|
130
|
+
requirement : function
|
|
131
|
+
Version check. Should return ``True`` if the version is acceptable, ``False`` otherwise.
|
|
132
|
+
|
|
133
|
+
Returns
|
|
134
|
+
-------
|
|
135
|
+
yosys_binary : subclass of YosysBinary
|
|
136
|
+
Proxy for running the requested version of Yosys.
|
|
137
|
+
|
|
138
|
+
Exceptions
|
|
139
|
+
----------
|
|
140
|
+
YosysError
|
|
141
|
+
Raised if required Yosys version is not found.
|
|
142
|
+
"""
|
|
143
|
+
...
|
|
144
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__all__ = ["flatten", "union", "memoize", "final", "deprecated", "get_linter_options", "get_linter_option"]
|
|
6
|
+
|
|
7
|
+
def flatten(i): # -> Generator[str | Unknown, Unknown, None]:
|
|
8
|
+
...
|
|
9
|
+
|
|
10
|
+
def union(i, start=...): # -> None:
|
|
11
|
+
...
|
|
12
|
+
|
|
13
|
+
def memoize(f): # -> _Wrapped[..., Unknown, (*args: Unknown), Unknown]:
|
|
14
|
+
...
|
|
15
|
+
|
|
16
|
+
def final(cls):
|
|
17
|
+
...
|
|
18
|
+
|
|
19
|
+
def deprecated(message, stacklevel=...): # -> (f: Unknown) -> _Wrapped[..., Unknown, (*args: Unknown, **kwargs: Unknown), Unknown]:
|
|
20
|
+
...
|
|
21
|
+
|
|
22
|
+
def get_linter_options(filename): # -> dict[str, str] | dict[Unknown, Unknown]:
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
def get_linter_option(filename, name, type, default): # -> int | bool:
|
|
26
|
+
...
|
|
27
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .._toolchain.yosys import *
|
|
6
|
+
from ..hdl._ast import SignalDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["YosysError", "convert", "convert_fragment"]
|
|
9
|
+
def convert_fragment(*args, strip_internal_attrs=..., **kwargs) -> tuple[str, SignalDict]:
|
|
10
|
+
...
|
|
11
|
+
|
|
12
|
+
def convert(elaboratable, name=..., platform=..., *, ports=..., emit_src=..., strip_internal_attrs=..., **kwargs) -> str:
|
|
13
|
+
...
|
|
14
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from collections import OrderedDict
|
|
6
|
+
from collections.abc import Iterator, Mapping
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
__all__ = ["Pins", "PinsN", "DiffPairs", "DiffPairsN", "Attrs", "Clock", "Subsignal", "Resource", "Connector"]
|
|
10
|
+
class Pins:
|
|
11
|
+
def __init__(self, names: str, *, dir: str=..., invert: bool=..., conn: Optional[tuple[str, int|str]]=..., assert_width: Optional[int]=...) -> None:
|
|
12
|
+
...
|
|
13
|
+
|
|
14
|
+
def __len__(self) -> int:
|
|
15
|
+
...
|
|
16
|
+
|
|
17
|
+
def __iter__(self) -> Iterator[str]:
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
def map_names(self, mapping: Mapping[str, str], resource) -> list[str]:
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
def __repr__(self) -> str:
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def PinsN(*args, **kwargs) -> Pins:
|
|
29
|
+
...
|
|
30
|
+
|
|
31
|
+
class DiffPairs:
|
|
32
|
+
def __init__(self, p: str, n: str, *, dir: str=..., invert: bool=..., conn: Optional[tuple[str, int|str]]=..., assert_width: Optional[int]=...) -> None:
|
|
33
|
+
...
|
|
34
|
+
|
|
35
|
+
def __len__(self) -> int:
|
|
36
|
+
...
|
|
37
|
+
|
|
38
|
+
def __iter__(self) -> Iterator[tuple[str, str]]:
|
|
39
|
+
...
|
|
40
|
+
|
|
41
|
+
def __repr__(self) -> str:
|
|
42
|
+
...
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def DiffPairsN(*args, **kwargs) -> DiffPairs:
|
|
47
|
+
...
|
|
48
|
+
|
|
49
|
+
class Attrs(OrderedDict):
|
|
50
|
+
def __init__(self, **attrs) -> None:
|
|
51
|
+
...
|
|
52
|
+
|
|
53
|
+
def __repr__(self) -> str:
|
|
54
|
+
...
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class Clock:
|
|
59
|
+
def __init__(self, frequency: float | int) -> None:
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def period(self) -> float:
|
|
64
|
+
...
|
|
65
|
+
|
|
66
|
+
def __repr__(self) -> str:
|
|
67
|
+
...
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class Subsignal:
|
|
72
|
+
def __init__(self, name: str, *args: Pins | DiffPairs | Subsignal | Attrs | Clock) -> None:
|
|
73
|
+
...
|
|
74
|
+
|
|
75
|
+
def __repr__(self) -> str:
|
|
76
|
+
...
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class Resource(Subsignal):
|
|
81
|
+
@classmethod
|
|
82
|
+
def family(cls, name_or_number: str | int, number: Optional[int]=..., *, ios, default_name: str, name_suffix: str=...): # -> Self@Resource:
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
def __init__(self, name, number, *args) -> None:
|
|
86
|
+
...
|
|
87
|
+
|
|
88
|
+
def __repr__(self) -> str:
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class Connector:
|
|
94
|
+
def __init__(self, name: str, number: int, io: str | dict[str, str], *, conn: Optional[tuple[str, int|str]]=...) -> None:
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
def __repr__(self) -> str:
|
|
98
|
+
...
|
|
99
|
+
|
|
100
|
+
def __len__(self) -> int:
|
|
101
|
+
...
|
|
102
|
+
|
|
103
|
+
def __iter__(self) -> Iterator[tuple[str, str]]:
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from abc import ABCMeta, abstractmethod
|
|
6
|
+
from .._toolchain import *
|
|
7
|
+
from ..hdl import *
|
|
8
|
+
from .res import *
|
|
9
|
+
from .run import *
|
|
10
|
+
|
|
11
|
+
__all__ = ["Platform", "TemplatedPlatform"]
|
|
12
|
+
class Platform(ResourceManager, metaclass=ABCMeta):
|
|
13
|
+
resources = ...
|
|
14
|
+
connectors = ...
|
|
15
|
+
default_clk = ...
|
|
16
|
+
default_rst = ...
|
|
17
|
+
required_tools = ...
|
|
18
|
+
def __init__(self) -> None:
|
|
19
|
+
...
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def default_clk_constraint(self):
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def default_clk_frequency(self):
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
def add_file(self, filename, content): # -> None:
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
def iter_files(self, *suffixes): # -> Generator[Unknown, Any, None]:
|
|
33
|
+
...
|
|
34
|
+
|
|
35
|
+
def build(self, elaboratable, name=..., build_dir=..., do_build=..., program_opts=..., do_program=..., **kwargs): # -> None:
|
|
36
|
+
...
|
|
37
|
+
|
|
38
|
+
def has_required_tools(self): # -> bool:
|
|
39
|
+
...
|
|
40
|
+
|
|
41
|
+
def create_missing_domain(self, name): # -> Module | None:
|
|
42
|
+
...
|
|
43
|
+
|
|
44
|
+
def prepare(self, elaboratable, name=..., **kwargs):
|
|
45
|
+
...
|
|
46
|
+
|
|
47
|
+
def iter_port_constraints_bits(self):
|
|
48
|
+
...
|
|
49
|
+
|
|
50
|
+
@abstractmethod
|
|
51
|
+
def toolchain_prepare(self, fragment, name, **kwargs):
|
|
52
|
+
"""
|
|
53
|
+
Convert the ``fragment`` and constraints recorded in this :class:`Platform` into
|
|
54
|
+
a :class:`BuildPlan`.
|
|
55
|
+
"""
|
|
56
|
+
...
|
|
57
|
+
|
|
58
|
+
def toolchain_program(self, products, name, **kwargs):
|
|
59
|
+
"""
|
|
60
|
+
Extract bitstream for fragment ``name`` from ``products`` and download it to a target.
|
|
61
|
+
"""
|
|
62
|
+
...
|
|
63
|
+
|
|
64
|
+
def get_input(self, pin, port, attrs, invert): # -> Module:
|
|
65
|
+
...
|
|
66
|
+
|
|
67
|
+
def get_output(self, pin, port, attrs, invert): # -> Module:
|
|
68
|
+
...
|
|
69
|
+
|
|
70
|
+
def get_tristate(self, pin, port, attrs, invert): # -> Module:
|
|
71
|
+
...
|
|
72
|
+
|
|
73
|
+
def get_input_output(self, pin, port, attrs, invert): # -> Module:
|
|
74
|
+
...
|
|
75
|
+
|
|
76
|
+
def get_diff_input(self, pin, port, attrs, invert): # -> None:
|
|
77
|
+
...
|
|
78
|
+
|
|
79
|
+
def get_diff_output(self, pin, port, attrs, invert): # -> None:
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
def get_diff_tristate(self, pin, port, attrs, invert): # -> None:
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
def get_diff_input_output(self, pin, port, attrs, invert): # -> None:
|
|
86
|
+
...
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class TemplatedPlatform(Platform):
|
|
91
|
+
toolchain = ...
|
|
92
|
+
file_templates = ...
|
|
93
|
+
command_templates = ...
|
|
94
|
+
build_script_templates = ...
|
|
95
|
+
def iter_clock_constraints(self): # -> Generator[tuple[Unknown, Unknown | None, Unknown], Any, None]:
|
|
96
|
+
...
|
|
97
|
+
|
|
98
|
+
def toolchain_prepare(self, fragment, name, **kwargs): # -> BuildPlan:
|
|
99
|
+
...
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This type stub file was generated by pyright.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
from ..hdl._ast import *
|
|
7
|
+
from ..hdl.rec import *
|
|
8
|
+
from ..lib.io import *
|
|
9
|
+
from .dsl import *
|
|
10
|
+
from collections.abc import Iterable, Iterator
|
|
11
|
+
|
|
12
|
+
__all__ = ["ResourceError", "ResourceManager"]
|
|
13
|
+
class ResourceError(Exception):
|
|
14
|
+
...
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PortGroup:
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ResourceManager:
|
|
22
|
+
def __init__(self, resources: Iterable[Resource], connectors: Iterable[Connector]) -> None:
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
def add_resources(self, resources: Iterable[Resource]) -> None:
|
|
26
|
+
...
|
|
27
|
+
|
|
28
|
+
def add_connectors(self, connectors: Iterable[Connector]) -> None:
|
|
29
|
+
...
|
|
30
|
+
|
|
31
|
+
def lookup(self, name: str, number: int=...) -> Resource:
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
def request(self, name: str, number: int=..., *, dir=..., xdr=...) -> Pin | PortLike | PortGroup:
|
|
35
|
+
...
|
|
36
|
+
|
|
37
|
+
def iter_single_ended_pins(self): # -> Generator[tuple[Unknown, Unknown, Unknown, Unknown], Any, None]:
|
|
38
|
+
...
|
|
39
|
+
|
|
40
|
+
def iter_differential_pins(self): # -> Generator[tuple[Unknown, Unknown, Unknown, Unknown], Any, None]:
|
|
41
|
+
...
|
|
42
|
+
|
|
43
|
+
def should_skip_port_component(self, port, attrs, component) -> bool:
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
def add_clock_constraint(self, clock: Signal, frequency: int | float) -> None:
|
|
47
|
+
...
|
|
48
|
+
|
|
49
|
+
def iter_clock_constraints(self) -> Iterator[tuple[Signal, Any, int | float]]:
|
|
50
|
+
...
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|