Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@r6
with:
package_name: 'pyVHDLModel'
unittest_python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
bandit: 'true'
pylint: 'false'
codecov: 'true'
Expand Down
2 changes: 1 addition & 1 deletion .idea/pyVHDLModel.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions doc/Dependency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ the mandatory dependencies too.
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `pytest-cov <https://GitHub.com/pytest-dev/pytest-cov>`__ | ≥7.0 | `MIT <https://GitHub.com/pytest-dev/pytest-cov/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `Coverage <https://GitHub.com/nedbat/coveragepy>`__ | ≥7.10 | `Apache License, 2.0 <https://GitHub.com/nedbat/coveragepy/blob/master/LICENSE.txt>`__ | *Not yet evaluated.* |
| `Coverage <https://GitHub.com/nedbat/coveragepy>`__ | ≥7.11 | `Apache License, 2.0 <https://GitHub.com/nedbat/coveragepy/blob/master/LICENSE.txt>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `mypy <https://GitHub.com/python/mypy>`__ | ≥1.18 | `MIT <https://GitHub.com/python/mypy/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
Expand Down Expand Up @@ -101,7 +101,7 @@ the mandatory dependencies too.
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
| !! `sphinx_fontawesome <https://GitHub.com/fraoustin/sphinx_fontawesome>`__ | ≥0.0.6 | `GPL 2.0 <https://GitHub.com/fraoustin/sphinx_fontawesome/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
| `sphinx_autodoc_typehints <https://GitHub.com/agronholm/sphinx-autodoc-typehints>`__ | ≥3.1 | `MIT <https://GitHub.com/agronholm/sphinx-autodoc-typehints/blob/master/LICENSE>`__ | *Not yet evaluated.* |
| `sphinx_autodoc_typehints <https://GitHub.com/agronholm/sphinx-autodoc-typehints>`__ | ≥3.5 | `MIT <https://GitHub.com/agronholm/sphinx-autodoc-typehints/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+


Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ sphinxcontrib-mermaid ~= 1.0
autoapi >= 2.0.1
sphinx_design ~= 0.6
sphinx-copybutton >= 0.5
sphinx_autodoc_typehints ~= 3.1
sphinx_autodoc_typehints ~= 3.5
sphinx_reports ~= 0.9
73 changes: 72 additions & 1 deletion pyVHDLModel/Expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

All declarations for literals, aggregates, operators forming an expressions.
"""
from typing import Tuple, List, Iterable, Union
from enum import Flag
from typing import Tuple, List, Iterable, Union, ClassVar

from pyTooling.Decorators import export, readonly

Expand Down Expand Up @@ -196,14 +197,32 @@ def __str__(self) -> str:
return "\"" + self._value + "\""


@export
class BitStringBase(Flag):
NoBase = 0
Binary = 2
Octal = 8
Decimal = 10
Hexadecimal = 16
Unsigned = 32
Signed = 64


@export
class BitStringLiteral(Literal):
# _base: ClassVar[BitStringBase]
_value: str
_bits: int

def __init__(self, value: str) -> None:
super().__init__()
self._bits = len(value)
self._value = value

@readonly
def Bits(self) -> int:
return self._bits

@readonly
def Value(self) -> str:
return self._value
Expand All @@ -212,6 +231,58 @@ def __str__(self) -> str:
return "\"" + self._value + "\""


@export
class BinaryBitStringLiteral(BitStringLiteral):
_base: ClassVar[BitStringBase] = BitStringBase.Binary

def __init__(self, value: str, bits: int = 0) -> None:
super().__init__(value)
if bits > 0:
self._bits = bits

def __str__(self) -> str:
return "b\"" + self._value + "\""


@export
class OctalBitStringLiteral(BitStringLiteral):
_base: ClassVar[BitStringBase] = BitStringBase.Octal

def __init__(self, value: str, bits: int = 0) -> None:
super().__init__(value)
if bits > 0:
self._bits = bits

def __str__(self) -> str:
return "o\"" + self._value + "\""


@export
class DecimalBitStringLiteral(BitStringLiteral):
_base: ClassVar[BitStringBase] = BitStringBase.Decimal

def __init__(self, value: str, bits: int = 0) -> None:
super().__init__(value)
if bits > 0:
self._bits = bits

def __str__(self) -> str:
return "d\"" + self._value + "\""


@export
class HexadecimalBitStringLiteral(BitStringLiteral):
_base: ClassVar[BitStringBase] = BitStringBase.Hexadecimal

def __init__(self, value: str, bits: int = 0) -> None:
super().__init__(value)
if bits > 0:
self._bits = bits

def __str__(self) -> str:
return "x\"" + self._value + "\""


@export
class ParenthesisExpression: #(Protocol):
__slots__ = () # FIXME: use ExtendedType?
Expand Down
2 changes: 1 addition & 1 deletion pyVHDLModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
__email__ = "[email protected]"
__copyright__ = "2016-2025, Patrick Lehmann"
__license__ = "Apache License, Version 2.0"
__version__ = "0.31.3"
__version__ = "0.32.0"


from enum import unique, Enum, Flag, auto
Expand Down
8 changes: 4 additions & 4 deletions run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Param(
)

$PackageName = "pyVHDLModel"
$PackageVersion = "0.31.2"
$PackageVersion = "0.32.0"

# set default values
$EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"]
Expand Down Expand Up @@ -89,7 +89,7 @@ if ($build)
rm -Force .\build\bdist.win-amd64
rm -Force .\build\lib
Write-Host -ForegroundColor Yellow "[live][BUILD] Building $PackageName package as wheel ..."
py -3.13 -m build --wheel --no-isolation
py -3.14 -m build --wheel --no-isolation

Write-Host -ForegroundColor Yellow "[live][BUILD] Building wheel finished"
}
Expand All @@ -103,9 +103,9 @@ if ($install)
}
else
{ Write-Host -ForegroundColor Cyan "[ADMIN][UNINSTALL] Uninstalling $PackageName ..."
py -3.13 -m pip uninstall -y $PackageName
py -3.14 -m pip uninstall -y $PackageName
Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Installing $PackageName from wheel ..."
py -3.13 -m pip install .\dist\$PackageName-$PackageVersion-py3-none-any.whl
py -3.14 -m pip install .\dist\$($PackageName.Replace(".", "_").ToLower())-$PackageVersion-py3-none-any.whl

Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Closing window in 5 seconds ..."
Start-Sleep -Seconds 5
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@
gitHubNamespace=gitHubNamespace,
keywords="Python3 VHDL Language Model Abstract",
sourceFileWithVersion=packageInformationFile,
developmentStatus="beta",
classifiers=list(DEFAULT_CLASSIFIERS) + [
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Compilers",
],
developmentStatus="beta",
pythonVersions=("3.11", "3.12", "3.13", "3.14"),
dataFiles={
packageName: ["py.typed"]
},
Expand Down
4 changes: 2 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r ../requirements.txt

# Coverage collection
Coverage ~= 7.10
Coverage ~= 7.11

# Test Runner
pytest ~= 8.4
Expand All @@ -10,4 +10,4 @@ pytest-cov ~= 7.0
# Static Type Checking
mypy[reports] ~= 1.18
typing_extensions ~= 4.15
lxml ~= 6.0
lxml >= 5.4, <7.0
Loading