Skip to content

Commit 5724f86

Browse files
authored
v0.31.0
2 parents fade0c9 + a11f7fa commit 5724f86

File tree

11 files changed

+267
-31
lines changed

11 files changed

+267
-31
lines changed

doc/Dependency.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pyVHDLModel Package
2323
+--------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
2424
| **Package** | **Version** | **License** | **Dependencies** |
2525
+========================================================+=============+==========================================================================================+=================================================================================================================================+
26-
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.1 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/master/LICENSE.txt>`__ | *None* |
26+
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.2 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/master/LICENSE.txt>`__ | *None* |
2727
+--------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
2828

2929

@@ -89,9 +89,9 @@ the mandatory dependencies too.
8989
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
9090
| **Package** | **Version** | **License** | **Dependencies** |
9191
+=================================================================================================+==============+==========================================================================================================+======================+
92-
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.1 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
92+
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.2 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
9393
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
94-
| `Sphinx <https://GitHub.com/sphinx-doc/sphinx>`__ | ≥8.1 | `BSD 3-Clause <https://GitHub.com/sphinx-doc/sphinx/blob/master/LICENSE>`__ | *Not yet evaluated.* |
94+
| `Sphinx <https://GitHub.com/sphinx-doc/sphinx>`__ | ≥8.2 | `BSD 3-Clause <https://GitHub.com/sphinx-doc/sphinx/blob/master/LICENSE>`__ | *Not yet evaluated.* |
9595
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
9696
| `sphinxcontrib-mermaid <https://GitHub.com/mgaitan/sphinxcontrib-mermaid>`__ | ≥1.0 | `BSD <https://GitHub.com/mgaitan/sphinxcontrib-mermaid/blob/master/LICENSE.rst>`__ | *Not yet evaluated.* |
9797
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
@@ -101,7 +101,7 @@ the mandatory dependencies too.
101101
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
102102
| !! `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.* |
103103
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
104-
| `sphinx_autodoc_typehints <https://GitHub.com/agronholm/sphinx-autodoc-typehints>`__ | ≥3.0 | `MIT <https://GitHub.com/agronholm/sphinx-autodoc-typehints/blob/master/LICENSE>`__ | *Not yet evaluated.* |
104+
| `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.* |
105105
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+----------------------+
106106

107107

@@ -129,7 +129,7 @@ install the mandatory dependencies too.
129129
+----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
130130
| **Package** | **Version** | **License** | **Dependencies** |
131131
+============================================================================+==============+==========================================================================================================+======================================================================================================================================================+
132-
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.1 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
132+
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.2 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
133133
+----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
134134
| `wheel <https://GitHub.com/pypa/wheel>`__ | ≥0.45 | `MIT <https://github.com/pypa/wheel/blob/main/LICENSE.txt>`__ | *Not yet evaluated.* |
135135
+----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+

doc/Installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Ensure :ref:`packaging requirements <DEP/packaging>` are installed.
192192
python -m pip uninstall -y pyVHDLModel
193193
194194
# Install from wheel
195-
python -m pip install ./dist/pyVHDLModel-0.29.1-py3-none-any.whl
195+
python -m pip install ./dist/pyVHDLModel-0.31.0-py3-none-any.whl
196196
197197
.. tab-item:: Windows
198198
:sync: Windows
@@ -208,4 +208,4 @@ Ensure :ref:`packaging requirements <DEP/packaging>` are installed.
208208
py -m pip uninstall -y pyVHDLModel
209209
210210
# Install from wheel
211-
py -m pip install .\dist\pyVHDLModel-0.29.1-py3-none-any.whl
211+
py -m pip install .\dist\pyVHDLModel-0.31.0-py3-none-any.whl

doc/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r ../requirements.txt
22

33
# Enforce latest version on ReadTheDocs
4-
sphinx ~= 8.1
4+
sphinx ~= 8.2
55
docutils ~= 0.21
66
docutils_stubs ~= 0.0.22
77

@@ -13,5 +13,5 @@ sphinxcontrib-mermaid ~= 1.0
1313
autoapi >= 2.0.1
1414
sphinx_design ~= 0.6.1
1515
sphinx-copybutton >= 0.5.2
16-
sphinx_autodoc_typehints ~= 3.0
16+
sphinx_autodoc_typehints ~= 3.1
1717
sphinx_reports ~= 0.7

pyVHDLModel/DesignUnit.py

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ class Package(PrimaryUnit, DesignUnitWithContextMixin, ConcurrentDeclarationRegi
426426
end package;
427427
"""
428428

429+
_allowBlackbox: Nullable[bool] #: Allow blackboxes for components in this package.
429430
_packageBody: Nullable["PackageBody"]
430431

431432
_genericItems: List[GenericInterfaceItemMixin]
@@ -440,12 +441,25 @@ def __init__(
440441
genericItems: Nullable[Iterable[GenericInterfaceItemMixin]] = None,
441442
declaredItems: Nullable[Iterable] = None,
442443
documentation: Nullable[str] = None,
444+
allowBlackbox: Nullable[bool] = None,
443445
parent: ModelEntity = None
444446
) -> None:
447+
"""
448+
Initialize a package.
449+
450+
:param identifier: Name of the VHDL package.
451+
:param contextItems:
452+
:param genericItems:
453+
:param declaredItems:
454+
:param documentation:
455+
:param allowBlackbox: Specify if blackboxes are allowed in this design.
456+
:param parent: The parent model entity (library) of this VHDL package.
457+
"""
445458
super().__init__(identifier, contextItems, documentation, parent)
446459
DesignUnitWithContextMixin.__init__(self)
447460
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
448461

462+
self._allowBlackbox = allowBlackbox
449463
self._packageBody = None
450464

451465
# TODO: extract to mixin
@@ -458,6 +472,22 @@ def __init__(
458472
self._deferredConstants = {}
459473
self._components = {}
460474

475+
@property
476+
def AllowBlackbox(self) -> bool:
477+
"""
478+
Read-only property to check if a design supports blackboxes (:attr:`_allowBlackbox`).
479+
480+
:returns: If blackboxes are allowed.
481+
"""
482+
if self._allowBlackbox is None:
483+
return self._parent.AllowBlackbox
484+
else:
485+
return self._allowBlackbox
486+
487+
@AllowBlackbox.setter
488+
def AllowBlackbox(self, value: Nullable[bool]) -> None:
489+
self._allowBlackbox = value
490+
461491
@property
462492
def PackageBody(self) -> Nullable["PackageBody"]:
463493
return self._packageBody
@@ -565,6 +595,8 @@ class Entity(PrimaryUnit, DesignUnitWithContextMixin, ConcurrentDeclarationRegio
565595
end entity;
566596
"""
567597

598+
_allowBlackbox: Nullable[bool] #: Allow blackboxes for components in this package.
599+
568600
_genericItems: List[GenericInterfaceItemMixin]
569601
_portItems: List[PortInterfaceItemMixin]
570602

@@ -579,13 +611,16 @@ def __init__(
579611
declaredItems: Nullable[Iterable] = None,
580612
statements: Nullable[Iterable[ConcurrentStatement]] = None,
581613
documentation: Nullable[str] = None,
614+
allowBlackbox: Nullable[bool] = None,
582615
parent: ModelEntity = None
583616
) -> None:
584617
super().__init__(identifier, contextItems, documentation, parent)
585618
DesignUnitWithContextMixin.__init__(self)
586619
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
587620
ConcurrentStatementsMixin.__init__(self, statements)
588621

622+
self._allowBlackbox = allowBlackbox
623+
589624
# TODO: extract to mixin
590625
self._genericItems = []
591626
if genericItems is not None:
@@ -602,6 +637,22 @@ def __init__(
602637

603638
self._architectures = {}
604639

640+
@property
641+
def AllowBlackbox(self) -> bool:
642+
"""
643+
Read-only property to check if a design supports blackboxes (:attr:`_allowBlackbox`).
644+
645+
:returns: If blackboxes are allowed.
646+
"""
647+
if self._allowBlackbox is None:
648+
return self._parent.AllowBlackbox
649+
else:
650+
return self._allowBlackbox
651+
652+
@AllowBlackbox.setter
653+
def AllowBlackbox(self, value: Nullable[bool]) -> None:
654+
self._allowBlackbox = value
655+
605656
# TODO: extract to mixin for generics
606657
@property
607658
def GenericItems(self) -> List[GenericInterfaceItemMixin]:
@@ -645,7 +696,8 @@ class Architecture(SecondaryUnit, DesignUnitWithContextMixin, ConcurrentDeclarat
645696
end architecture;
646697
"""
647698

648-
_entity: EntitySymbol
699+
_allowBlackbox: Nullable[bool] #: Allow blackboxes for components in this package.
700+
_entity: EntitySymbol
649701

650702
def __init__(
651703
self,
@@ -655,20 +707,39 @@ def __init__(
655707
declaredItems: Nullable[Iterable] = None,
656708
statements: Iterable['ConcurrentStatement'] = None,
657709
documentation: Nullable[str] = None,
710+
allowBlackbox: Nullable[bool] = None,
658711
parent: ModelEntity = None
659712
) -> None:
660713
super().__init__(identifier, contextItems, documentation, parent)
661714
DesignUnitWithContextMixin.__init__(self)
662715
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
663716
ConcurrentStatementsMixin.__init__(self, statements)
664717

718+
self._allowBlackbox = allowBlackbox
719+
665720
self._entity = entity
666721
entity._parent = self
667722

668723
@property
669724
def Entity(self) -> EntitySymbol:
670725
return self._entity
671726

727+
@property
728+
def AllowBlackbox(self) -> bool:
729+
"""
730+
Read-only property to check if a design supports blackboxes (:attr:`_allowBlackbox`).
731+
732+
:returns: If blackboxes are allowed.
733+
"""
734+
if self._allowBlackbox is None:
735+
return self._parent.AllowBlackbox
736+
else:
737+
return self._allowBlackbox
738+
739+
@AllowBlackbox.setter
740+
def AllowBlackbox(self, value: Nullable[bool]) -> None:
741+
self._allowBlackbox = value
742+
672743
def __str__(self) -> str:
673744
lib = self._parent._identifier if self._parent is not None else "%"
674745
ent = self._entity._name._identifier if self._entity is not None else "%"
@@ -696,6 +767,9 @@ class Component(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
696767
end component;
697768
"""
698769

770+
_allowBlackbox: Nullable[bool] #: Allow component to be a blackbox.
771+
_isBlackBox: Nullable[bool] #: Component is a blackbox.
772+
699773
_genericItems: List[GenericInterfaceItemMixin]
700774
_portItems: List[PortInterfaceItemMixin]
701775

@@ -707,12 +781,17 @@ def __init__(
707781
genericItems: Nullable[Iterable[GenericInterfaceItemMixin]] = None,
708782
portItems: Nullable[Iterable[PortInterfaceItemMixin]] = None,
709783
documentation: Nullable[str] = None,
784+
allowBlackbox: Nullable[bool] = None,
710785
parent: ModelEntity = None
711786
) -> None:
712787
super().__init__(parent)
713788
NamedEntityMixin.__init__(self, identifier)
714789
DocumentedEntityMixin.__init__(self, documentation)
715790

791+
self._allowBlackbox = allowBlackbox
792+
self._isBlackBox = None
793+
self._entity = None
794+
716795
# TODO: extract to mixin
717796
self._genericItems = []
718797
if genericItems is not None:
@@ -727,6 +806,31 @@ def __init__(
727806
self._portItems.append(item)
728807
item._parent = self
729808

809+
@property
810+
def AllowBlackbox(self) -> bool:
811+
"""
812+
Read-only property to check if a design supports blackboxes (:attr:`_allowBlackbox`).
813+
814+
:returns: If blackboxes are allowed.
815+
"""
816+
if self._allowBlackbox is None:
817+
return self._parent.AllowBlackbox
818+
else:
819+
return self._allowBlackbox
820+
821+
@AllowBlackbox.setter
822+
def AllowBlackbox(self, value: Nullable[bool]) -> None:
823+
self._allowBlackbox = value
824+
825+
@property
826+
def IsBlackbox(self) -> bool:
827+
"""
828+
Read-only property returning true, if this component is a blackbox (:attr:`_isBlackbox`).
829+
830+
:returns: If this component is a blackbox.
831+
"""
832+
return self._isBlackBox
833+
730834
@property
731835
def GenericItems(self) -> List[GenericInterfaceItemMixin]:
732836
return self._genericItems
@@ -742,6 +846,7 @@ def Entity(self) -> Nullable[Entity]:
742846
@Entity.setter
743847
def Entity(self, value: Entity) -> None:
744848
self._entity = value
849+
self._isBlackBox = False
745850

746851

747852
@export

pyVHDLModel/IEEE.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def __init__(self, flavor: Nullable[IEEEFlavor] = None) -> None:
108108
self.LoadSynopsysPackages()
109109
else:
110110
raise VHDLModelException(f"Unknown IEEE library flavor '{flavor}'.")
111-
self._flavor = flavor
112111

113112
@readonly
114113
def Flavor(self) -> IEEEFlavor:

pyVHDLModel/Interface.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from pyTooling.MetaClasses import ExtendedType
4141

4242
from pyVHDLModel.Symbol import Symbol
43-
from pyVHDLModel.Base import ModelEntity, DocumentedEntityMixin, ExpressionUnion, Mode
43+
from pyVHDLModel.Base import ModelEntity, DocumentedEntityMixin, ExpressionUnion, Mode, NamedEntityMixin
4444
from pyVHDLModel.Object import Constant, Signal, Variable, File
4545
from pyVHDLModel.Subprogram import Procedure, Function
4646
from pyVHDLModel.Type import Type
@@ -130,7 +130,15 @@ def __init__(self, identifier: str, documentation: Nullable[str] = None, parent:
130130

131131

132132
@export
133-
class GenericPackageInterfaceItem(GenericInterfaceItemMixin):
133+
class InterfacePackage(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
134+
def __init__(self, identifier: str, documentation: Nullable[str] = None, parent: ModelEntity = None) -> None:
135+
super().__init__(parent)
136+
NamedEntityMixin.__init__(self, identifier)
137+
DocumentedEntityMixin.__init__(self, documentation)
138+
139+
140+
@export
141+
class GenericPackageInterfaceItem(InterfacePackage, GenericInterfaceItemMixin):
134142
def __init__(self, identifier: str, documentation: Nullable[str] = None, parent: ModelEntity = None) -> None:
135143
super().__init__(identifier, documentation, parent)
136144
GenericInterfaceItemMixin.__init__(self)

pyVHDLModel/Symbol.py

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,20 +455,57 @@ class ConstrainedScalarSubtypeSymbol(SubtypeSymbol):
455455

456456

457457
@export
458-
class ConstrainedCompositeSubtypeSymbol(SubtypeSymbol):
458+
class Constraint:
459459
pass
460460

461461

462462
@export
463-
class ConstrainedArraySubtypeSymbol(ConstrainedCompositeSubtypeSymbol):
464-
pass
463+
class ArrayConstraint(Constraint):
464+
_constraints: List[Range]
465+
466+
def __init__(self, constraints: Iterable[Range]) -> None:
467+
self._constraints = [constraint for constraint in constraints]
468+
469+
@readonly
470+
def Constraints(self) -> List[Range]:
471+
return self._constraints
472+
473+
474+
@export
475+
class RecordConstraint(Constraint):
476+
_constraints: Dict[RecordElementSymbol, Range]
477+
478+
def __init__(self, constraints: Mapping[RecordElementSymbol, Range]) -> None:
479+
self._constraints = {key: value for key, value in constraints.items()}
480+
481+
@readonly
482+
def Constraints(self) -> Dict[RecordElementSymbol, Range]:
483+
return self._constraints
465484

466485

467486
@export
468-
class ConstrainedRecordSubtypeSymbol(ConstrainedCompositeSubtypeSymbol):
487+
class ConstrainedCompositeSubtypeSymbol(SubtypeSymbol):
469488
pass
470489

471490

491+
@export
492+
class ConstrainedArraySubtypeSymbol(ConstrainedCompositeSubtypeSymbol, ArrayConstraint):
493+
_constraints: List
494+
495+
def __init__(self, name: Name, constraints: Iterable) -> None:
496+
super().__init__(name)
497+
ArrayConstraint.__init__(self, constraints)
498+
499+
500+
@export
501+
class ConstrainedRecordSubtypeSymbol(ConstrainedCompositeSubtypeSymbol, RecordConstraint):
502+
_constraints: Dict[RecordElementSymbol, Any]
503+
504+
def __init__(self, name: Name, constraints: Mapping) -> None:
505+
super().__init__(name)
506+
RecordConstraint.__init__(self, constraints)
507+
508+
472509
@export
473510
class SimpleObjectOrFunctionCallSymbol(Symbol):
474511
def __init__(self, name: Name) -> None:

0 commit comments

Comments
 (0)