pySystemRDLModel

Summary

Doc-string:

documented

File

Expected

Covered

Uncovered

Coverage

__init__.py

18

18

0

100.0%

Overall (1 files)

18

18

0

100.0%

Source

pySystemRDLModel/__init__.pydocumentedundocumentedignoredexcludednot counted
31"""
32**An abstract SystemRDL language model.**
33
34This package provides a unified abstract language model for SystemRDL. Projects reading from source files can derive own
35classes and implement additional logic to create a concrete language model for their tools.
36
37Projects consuming pre-processed SystemRDL data can build higher level features and services on such a model, while
38supporting multiple frontends.
39"""
...
44
46__author__ =            "Patrick Lehmann"
47__email__ =             "Paebbels@gmail.com"
48__copyright__ =         "2023-2026, Electronic Design Automation Abstraction (EDA²)"
49__license__ =           "Apache License, Version 2.0"
50__version__ =           "0.4.1"
52__project_url__ =       "https://github.com/edaa-org/pySystemRDLModel"
53__documentation_url__ = "https://edaa-org.github.io/pySystemRDLModel"
54__issue_tracker_url__ = "https://GitHub.com/edaa-org/pySystemRDLModel/issues"
55
57@export
58@unique
59class SystemRDLVersion(Enum):
60	"""
61	An enumeration for all possible version numbers for SystemRDL.
62
63	A version can be given as integer or string and is represented as a unified
64	enumeration value.
65
66	This enumeration supports compare operators.
67	"""
68	Any =              -1  #: Any
69
70	SystemRDL2005 =  2005  #: SystemRDL-2005
71	SystemRDL2009 =  2009  #: SystemRDL-2009
72	SystemRDL2012 =  2012  #: SystemRDL-2012
73	SystemRDL2017 =  2017  #: SystemRDL-2017
74
75	Latest =        10000  #: Latest SystemRDL (2017)
76
77	__VERSION_MAPPINGS__: Dict[Union[int, str], Enum] = {
78		-1:       Any,
79		5:        SystemRDL2005,
80		9:        SystemRDL2009,
81		12:       SystemRDL2012,
82		17:       SystemRDL2017,
83		2005:     SystemRDL2005,
84		2009:     SystemRDL2009,
85		2012:     SystemRDL2012,
86		2017:     SystemRDL2017,
87		10000:    Latest,
88		"Any":    Any,
89		"05":     SystemRDL2005,
90		"09":     SystemRDL2009,
91		"12":     SystemRDL2012,
92		"17":     SystemRDL2017,
93		"2005":   SystemRDL2005,
94		"2009":   SystemRDL2009,
95		"2012":   SystemRDL2012,
96		"2017":   SystemRDL2017,
97		"Latest": SystemRDL2017,
98	}  #: Dictionary of SystemRDL year codes variants as integer and strings for mapping to unique enum values.
99
100	def __init__(self, *_) -> None:
101		"""Patch the embedded MAP dictionary"""
		...
106
107	@classmethod
108	def Parse(cls, value: Union[int, str]) -> "SystemRDLVersion":
109		"""
110		Parses a SystemRDL year code as integer or string to an enum value.
111
112		:param value:       SystemRDL year code.
113		:returns:           Enumeration value.
114		:raises ValueError: If the year code is not recognized.
115		"""
		...
120
121	def __lt__(self, other: Any) -> bool:
122		"""
123		Compare two SystemRDL versions if the version is less than the second operand.
124
125		:param other:      Parameter to compare against.
126		:returns:          True if version is less than the second operand.
127		:raises TypeError: If parameter ``other`` is not of type :class:`SystemRDLVersion`.
128		"""
		...
133
134	def __le__(self, other: Any) -> bool:
135		"""
136		Compare two SystemRDL versions if the version is less or equal than the second operand.
137
138		:param other:      Parameter to compare against.
139		:returns:          True if version is less or equal than the second operand.
140		:raises TypeError: If parameter ``other`` is not of type :class:`SystemRDLVersion`.
141		"""
		...
146
147	def __gt__(self, other: Any) -> bool:
148		"""
149		Compare two SystemRDL versions if the version is greater than the second operand.
150
151		:param other:      Parameter to compare against.
152		:returns:          True if version is greater than the second operand.
153		:raises TypeError: If parameter ``other`` is not of type :class:`SystemRDLVersion`.
154		"""
		...
159
160	def __ge__(self, other: Any) -> bool:
161		"""
162		Compare two SystemRDL versions if the version is greater or equal than the second operand.
163
164		:param other:      Parameter to compare against.
165		:returns:          True if version is greater or equal than the second operand.
166		:raises TypeError: If parameter ``other`` is not of type :class:`SystemRDLVersion`.
167		"""
		...
172
173	def __ne__(self, other: Any) -> bool:
174		"""
175		Compare two SystemRDL versions if the version is unequal to the second operand.
176
177		:param other:      Parameter to compare against.
178		:returns:          True if version is unequal to the second operand.
179		:raises TypeError: If parameter ``other`` is not of type :class:`SystemRDLVersion`.
180		"""
		...
185
186	def __eq__(self, other: Any) -> bool:
187		"""
188		Compare two SystemRDL versions if the version is equal to the second operand.
189
190		:param other:      Parameter to compare against.
191		:returns:          True if version is equal to the second operand.
192		:raises TypeError: If parameter ``other`` is not of type :class:`SystemRDLVersion`.
193		"""
		...
201
202	def __str__(self) -> str:
203		"""
204		Formats the SystemRDLVersion version to pattern ``SystemRDL'xx``.
205
206		:returns: Formatted SystemRDL version.
207		"""
		...
215
216	def __repr__(self) -> str:
217		"""
218		Formats the SystemRDL version to pattern ``xxxx``.
219
220		:returns: Formatted SystemRDL version.
221		"""
		...