diff --git a/src/systemrdl/node.py b/src/systemrdl/node.py index b43a1e4..3b6d1fc 100644 --- a/src/systemrdl/node.py +++ b/src/systemrdl/node.py @@ -4,10 +4,11 @@ from collections import deque from typing import TYPE_CHECKING, Optional, Iterator, Any, List, Dict, Union, overload, TypeVar, Type +from typing_extensions import Literal + from . import component as comp from . import rdltypes from .core import rdlformatcode, helpers -from typing_extensions import Literal if TYPE_CHECKING: from .compiler import RDLEnvironment @@ -403,19 +404,19 @@ def find_by_path(self, path: str) -> Optional['Node']: def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @@ -855,25 +856,25 @@ class AddressableNode(Node): def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -1095,25 +1096,25 @@ class VectorNode(Node): def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -1179,67 +1180,67 @@ class SignalNode(VectorNode): def get_property(self, prop_name: Literal["signalwidth"], *, default: T)-> Union[int, T]: ... @overload - def get_property(self, prop_name: Literal["signalwidth"])-> int: ... + def get_property(self, prop_name: Literal["signalwidth"], **kwargs: Any)-> int: ... @overload def get_property(self, prop_name: Literal["sync"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["sync"])-> bool: ... + def get_property(self, prop_name: Literal["sync"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["async"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["async"])-> bool: ... + def get_property(self, prop_name: Literal["async"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["cpuif_reset"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["cpuif_reset"])-> bool: ... + def get_property(self, prop_name: Literal["cpuif_reset"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["field_reset"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["field_reset"])-> bool: ... + def get_property(self, prop_name: Literal["field_reset"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["activelow"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["activelow"])-> bool: ... + def get_property(self, prop_name: Literal["activelow"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["activehigh"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["activehigh"])-> bool: ... + def get_property(self, prop_name: Literal["activehigh"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -1253,361 +1254,361 @@ class FieldNode(VectorNode): def get_property(self, prop_name: Literal["dontcompare"], *, default: T)-> Union[Union[int, bool], T]: ... @overload - def get_property(self, prop_name: Literal["dontcompare"])-> Union[int, bool]: ... + def get_property(self, prop_name: Literal["dontcompare"], **kwargs: Any)-> Union[int, bool]: ... @overload def get_property(self, prop_name: Literal["donttest"], *, default: T)-> Union[Union[int, bool], T]: ... @overload - def get_property(self, prop_name: Literal["donttest"])-> Union[int, bool]: ... + def get_property(self, prop_name: Literal["donttest"], **kwargs: Any)-> Union[int, bool]: ... @overload def get_property(self, prop_name: Literal["hdl_path_slice"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_slice"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_slice"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["hdl_path_gate_slice"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_gate_slice"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_gate_slice"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["hw"], *, default: T)-> Union['rdltypes.AccessType', T]: ... @overload - def get_property(self, prop_name: Literal["hw"])-> 'rdltypes.AccessType': ... + def get_property(self, prop_name: Literal["hw"], **kwargs: Any)-> 'rdltypes.AccessType': ... @overload def get_property(self, prop_name: Literal["sw"], *, default: T)-> Union['rdltypes.AccessType', T]: ... @overload - def get_property(self, prop_name: Literal["sw"])-> 'rdltypes.AccessType': ... + def get_property(self, prop_name: Literal["sw"], **kwargs: Any)-> 'rdltypes.AccessType': ... @overload def get_property(self, prop_name: Literal["next"], *, default: T)-> Union[Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["next"])-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["next"], **kwargs: Any)-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["reset"], *, default: T)-> Union[Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["reset"])-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["reset"], **kwargs: Any)-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["resetsignal"], *, default: T)-> Union[Optional[SignalNode], T]: ... @overload - def get_property(self, prop_name: Literal["resetsignal"])-> Optional[SignalNode]: ... + def get_property(self, prop_name: Literal["resetsignal"], **kwargs: Any)-> Optional[SignalNode]: ... @overload def get_property(self, prop_name: Literal["rclr"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["rclr"])-> bool: ... + def get_property(self, prop_name: Literal["rclr"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["rset"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["rset"])-> bool: ... + def get_property(self, prop_name: Literal["rset"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["onread"], *, default: T)-> Union[Optional['rdltypes.OnReadType'], T]: ... @overload - def get_property(self, prop_name: Literal["onread"])-> Optional['rdltypes.OnReadType']: ... + def get_property(self, prop_name: Literal["onread"], **kwargs: Any)-> Optional['rdltypes.OnReadType']: ... @overload def get_property(self, prop_name: Literal["woclr"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["woclr"])-> bool: ... + def get_property(self, prop_name: Literal["woclr"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["woset"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["woset"])-> bool: ... + def get_property(self, prop_name: Literal["woset"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["onwrite"], *, default: T)-> Union[Optional['rdltypes.OnWriteType'], T]: ... @overload - def get_property(self, prop_name: Literal["onwrite"])-> Optional['rdltypes.OnWriteType']: ... + def get_property(self, prop_name: Literal["onwrite"], **kwargs: Any)-> Optional['rdltypes.OnWriteType']: ... @overload def get_property(self, prop_name: Literal["swwe"], *, default: T)-> Union[Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["swwe"])-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["swwe"], **kwargs: Any)-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["swwel"], *, default: T)-> Union[Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["swwel"])-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["swwel"], **kwargs: Any)-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["swmod"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["swmod"])-> bool: ... + def get_property(self, prop_name: Literal["swmod"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["swacc"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["swacc"])-> bool: ... + def get_property(self, prop_name: Literal["swacc"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["singlepulse"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["singlepulse"])-> bool: ... + def get_property(self, prop_name: Literal["singlepulse"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["we"], *, default: T)-> Union[Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["we"])-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["we"], **kwargs: Any)-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["wel"], *, default: T)-> Union[Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["wel"])-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["wel"], **kwargs: Any)-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["anded"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["anded"])-> bool: ... + def get_property(self, prop_name: Literal["anded"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["ored"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ored"])-> bool: ... + def get_property(self, prop_name: Literal["ored"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["xored"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["xored"])-> bool: ... + def get_property(self, prop_name: Literal["xored"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["fieldwidth"], *, default: T)-> Union[int, T]: ... @overload - def get_property(self, prop_name: Literal["fieldwidth"])-> int: ... + def get_property(self, prop_name: Literal["fieldwidth"], **kwargs: Any)-> int: ... @overload def get_property(self, prop_name: Literal["hwclr"], *, default: T)-> Union[Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["hwclr"])-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["hwclr"], **kwargs: Any)-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["hwset"], *, default: T)-> Union[Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["hwset"])-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["hwset"], **kwargs: Any)-> Union[bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["hwenable"], *, default: T)-> Union[Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["hwenable"])-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["hwenable"], **kwargs: Any)-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["hwmask"], *, default: T)-> Union[Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["hwmask"])-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["hwmask"], **kwargs: Any)-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["counter"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["counter"])-> bool: ... + def get_property(self, prop_name: Literal["counter"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["threshold"], *, default: T)-> Union[Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["threshold"])-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["threshold"], **kwargs: Any)-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["incrthreshold"], *, default: T)-> Union[Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["incrthreshold"])-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["incrthreshold"], **kwargs: Any)-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["saturate"], *, default: T)-> Union[Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["saturate"])-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["saturate"], **kwargs: Any)-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["incrsaturate"], *, default: T)-> Union[Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["incrsaturate"])-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["incrsaturate"], **kwargs: Any)-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["overflow"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["overflow"])-> bool: ... + def get_property(self, prop_name: Literal["overflow"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["underflow"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["underflow"])-> bool: ... + def get_property(self, prop_name: Literal["underflow"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["incr"], *, default: T)-> Union[Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["incr"])-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["incr"], **kwargs: Any)-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["incrvalue"], *, default: T)-> Union[Optional[Union[int, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["incrvalue"])-> Optional[Union[int, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["incrvalue"], **kwargs: Any)-> Optional[Union[int, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["incrwidth"], *, default: T)-> Union[Optional[int], T]: ... @overload - def get_property(self, prop_name: Literal["incrwidth"])-> Optional[int]: ... + def get_property(self, prop_name: Literal["incrwidth"], **kwargs: Any)-> Optional[int]: ... @overload def get_property(self, prop_name: Literal["decrvalue"], *, default: T)-> Union[Optional[Union[int, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["decrvalue"])-> Optional[Union[int, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["decrvalue"], **kwargs: Any)-> Optional[Union[int, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["decr"], *, default: T)-> Union[Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["decr"])-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["decr"], **kwargs: Any)-> Optional[Union[SignalNode, 'FieldNode', 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["decrwidth"], *, default: T)-> Union[Optional[int], T]: ... @overload - def get_property(self, prop_name: Literal["decrwidth"])-> Optional[int]: ... + def get_property(self, prop_name: Literal["decrwidth"], **kwargs: Any)-> Optional[int]: ... @overload def get_property(self, prop_name: Literal["decrsaturate"], *, default: T)-> Union[Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["decrsaturate"])-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["decrsaturate"], **kwargs: Any)-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["decrthreshold"], *, default: T)-> Union[Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference'], T]: ... @overload - def get_property(self, prop_name: Literal["decrthreshold"])-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... + def get_property(self, prop_name: Literal["decrthreshold"], **kwargs: Any)-> Union[int, bool, SignalNode, 'FieldNode', 'rdltypes.PropertyReference']: ... @overload def get_property(self, prop_name: Literal["intr"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["intr"])-> bool: ... + def get_property(self, prop_name: Literal["intr"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["intr type"], *, default: T)-> Union[Optional['rdltypes.InterruptType'], T]: ... @overload - def get_property(self, prop_name: Literal["intr type"])-> Optional['rdltypes.InterruptType']: ... + def get_property(self, prop_name: Literal["intr type"], **kwargs: Any)-> Optional['rdltypes.InterruptType']: ... @overload def get_property(self, prop_name: Literal["enable"], *, default: T)-> Union[Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["enable"])-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["enable"], **kwargs: Any)-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["mask"], *, default: T)-> Union[Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["mask"])-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["mask"], **kwargs: Any)-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["haltenable"], *, default: T)-> Union[Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["haltenable"])-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["haltenable"], **kwargs: Any)-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["haltmask"], *, default: T)-> Union[Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']], T]: ... @overload - def get_property(self, prop_name: Literal["haltmask"])-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... + def get_property(self, prop_name: Literal["haltmask"], **kwargs: Any)-> Optional[Union['FieldNode', SignalNode, 'rdltypes.PropertyReference']]: ... @overload def get_property(self, prop_name: Literal["sticky"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["sticky"])-> bool: ... + def get_property(self, prop_name: Literal["sticky"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["stickybit"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["stickybit"])-> bool: ... + def get_property(self, prop_name: Literal["stickybit"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["encode"], *, default: T)-> Union[Optional[Type['rdltypes.UserEnum']], T]: ... @overload - def get_property(self, prop_name: Literal["encode"])-> Optional[Type['rdltypes.UserEnum']]: ... + def get_property(self, prop_name: Literal["encode"], **kwargs: Any)-> Optional[Type['rdltypes.UserEnum']]: ... @overload def get_property(self, prop_name: Literal["precedence"], *, default: T)-> Union['rdltypes.PrecedenceType', T]: ... @overload - def get_property(self, prop_name: Literal["precedence"])-> 'rdltypes.PrecedenceType': ... + def get_property(self, prop_name: Literal["precedence"], **kwargs: Any)-> 'rdltypes.PrecedenceType': ... @overload def get_property(self, prop_name: Literal["paritycheck"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["paritycheck"])-> bool: ... + def get_property(self, prop_name: Literal["paritycheck"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -1900,73 +1901,73 @@ class RegNode(AddressableNode): def get_property(self, prop_name: Literal["dontcompare"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["dontcompare"])-> bool: ... + def get_property(self, prop_name: Literal["dontcompare"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["donttest"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["donttest"])-> bool: ... + def get_property(self, prop_name: Literal["donttest"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["errextbus"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["errextbus"])-> bool: ... + def get_property(self, prop_name: Literal["errextbus"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["hdl_path"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["hdl_path_gate"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_gate"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_gate"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["regwidth"], *, default: T)-> Union[int, T]: ... @overload - def get_property(self, prop_name: Literal["regwidth"])-> int: ... + def get_property(self, prop_name: Literal["regwidth"], **kwargs: Any)-> int: ... @overload def get_property(self, prop_name: Literal["accesswidth"], *, default: T)-> Union[int, T]: ... @overload - def get_property(self, prop_name: Literal["accesswidth"])-> int: ... + def get_property(self, prop_name: Literal["accesswidth"], **kwargs: Any)-> int: ... @overload def get_property(self, prop_name: Literal["shared"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["shared"])-> bool: ... + def get_property(self, prop_name: Literal["shared"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -2152,67 +2153,67 @@ class RegfileNode(AddressableNode): def get_property(self, prop_name: Literal["dontcompare"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["dontcompare"])-> bool: ... + def get_property(self, prop_name: Literal["dontcompare"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["donttest"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["donttest"])-> bool: ... + def get_property(self, prop_name: Literal["donttest"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["errextbus"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["errextbus"])-> bool: ... + def get_property(self, prop_name: Literal["errextbus"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["hdl_path"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["hdl_path_gate"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_gate"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_gate"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["alignment"], *, default: T)-> Union[Optional[int], T]: ... @overload - def get_property(self, prop_name: Literal["alignment"])-> Optional[int]: ... + def get_property(self, prop_name: Literal["alignment"], **kwargs: Any)-> Optional[int]: ... @overload def get_property(self, prop_name: Literal["sharedextbus"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["sharedextbus"])-> bool: ... + def get_property(self, prop_name: Literal["sharedextbus"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -2230,115 +2231,115 @@ class AddrmapNode(AddressableNode): def get_property(self, prop_name: Literal["dontcompare"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["dontcompare"])-> bool: ... + def get_property(self, prop_name: Literal["dontcompare"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["donttest"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["donttest"])-> bool: ... + def get_property(self, prop_name: Literal["donttest"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["errextbus"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["errextbus"])-> bool: ... + def get_property(self, prop_name: Literal["errextbus"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["hdl_path"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["hdl_path_gate"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_gate"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_gate"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["alignment"], *, default: T)-> Union[Optional[int], T]: ... @overload - def get_property(self, prop_name: Literal["alignment"])-> Optional[int]: ... + def get_property(self, prop_name: Literal["alignment"], **kwargs: Any)-> Optional[int]: ... @overload def get_property(self, prop_name: Literal["sharedextbus"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["sharedextbus"])-> bool: ... + def get_property(self, prop_name: Literal["sharedextbus"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["bigendian"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["bigendian"])-> bool: ... + def get_property(self, prop_name: Literal["bigendian"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["littleendian"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["littleendian"])-> bool: ... + def get_property(self, prop_name: Literal["littleendian"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["addressing"], *, default: T)-> Union[rdltypes.AddressingType, T]: ... @overload - def get_property(self, prop_name: Literal["addressing"])-> rdltypes.AddressingType: ... + def get_property(self, prop_name: Literal["addressing"], **kwargs: Any)-> rdltypes.AddressingType: ... @overload def get_property(self, prop_name: Literal["rsvdset"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["rsvdset"])-> bool: ... + def get_property(self, prop_name: Literal["rsvdset"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["rsvdsetX"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["rsvdsetX"])-> bool: ... + def get_property(self, prop_name: Literal["rsvdsetX"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["msb0"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["msb0"])-> bool: ... + def get_property(self, prop_name: Literal["msb0"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["lsb0"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["lsb0"])-> bool: ... + def get_property(self, prop_name: Literal["lsb0"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["bridge"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["bridge"])-> bool: ... + def get_property(self, prop_name: Literal["bridge"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) @@ -2356,55 +2357,55 @@ class MemNode(AddressableNode): def get_property(self, prop_name: Literal["hdl_path_slice"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_slice"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_slice"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["hdl_path_gate_slice"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["hdl_path_gate_slice"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["hdl_path_gate_slice"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["sw"], *, default: T)-> Union[rdltypes.AccessType, T]: ... @overload - def get_property(self, prop_name: Literal["sw"])-> rdltypes.AccessType: ... + def get_property(self, prop_name: Literal["sw"], **kwargs: Any)-> rdltypes.AccessType: ... @overload def get_property(self, prop_name: Literal["mementries"], *, default: T)-> Union[int, T]: ... @overload - def get_property(self, prop_name: Literal["mementries"])-> int: ... + def get_property(self, prop_name: Literal["mementries"], **kwargs: Any)-> int: ... @overload def get_property(self, prop_name: Literal["memwidth"], *, default: T)-> Union[int, T]: ... @overload - def get_property(self, prop_name: Literal["memwidth"])-> int: ... + def get_property(self, prop_name: Literal["memwidth"], **kwargs: Any)-> int: ... @overload def get_property(self, prop_name: Literal["name"], *, default: T)-> Union[str, T]: ... @overload - def get_property(self, prop_name: Literal["name"])-> str: ... + def get_property(self, prop_name: Literal["name"], **kwargs: Any)-> str: ... @overload def get_property(self, prop_name: Literal["desc"], *, default: T)-> Union[Optional[str], T]: ... @overload - def get_property(self, prop_name: Literal["desc"])-> Optional[str]: ... + def get_property(self, prop_name: Literal["desc"], **kwargs: Any)-> Optional[str]: ... @overload def get_property(self, prop_name: Literal["ispresent"], *, default: T)-> Union[bool, T]: ... @overload - def get_property(self, prop_name: Literal["ispresent"])-> bool: ... + def get_property(self, prop_name: Literal["ispresent"], **kwargs: Any)-> bool: ... @overload def get_property(self, prop_name: str, *, default: T)-> Union[Any, T]: ... @overload - def get_property(self, prop_name: str)-> Any: ... + def get_property(self, prop_name: str, **kwargs: Any)-> Any: ... def get_property(self, prop_name: str, **kwargs: Any)-> Any: return super().get_property(prop_name, **kwargs) diff --git a/test/run.sh b/test/run.sh index 919715c..5624764 100755 --- a/test/run.sh +++ b/test/run.sh @@ -2,7 +2,7 @@ set -e -this_dir="$( cd "$(dirname "$0")" ; pwd -P )" +cd "$(dirname "$0")" exists () { type "$1" >/dev/null 2>/dev/null @@ -15,15 +15,12 @@ if exists ccache; then fi # Initialize venv -venv_bin=$this_dir/.venv/bin -python3 -m venv $this_dir/.venv -source $this_dir/.venv/bin/activate +python3 -m venv .venv +source .venv/bin/activate # Install export SYSTEMRDL_REQUIRE_BINARY_BUILD=1 -cd $this_dir/../ -python -m pip install . -cd $this_dir +python -m pip install .. python -m pip install -r requirements.txt pytest-parallel # Run unit tests while collecting coverage @@ -32,15 +29,15 @@ export SYSTEMRDL_DISABLE_ACCELERATOR=1 pytest # Generate coverage report -coverage html -i -d $this_dir/htmlcov +coverage html -i -d htmlcov # Also run examples in order to make sure output is up-to-date -$this_dir/../examples/print_hierarchy.py $this_dir/../examples/atxmega_spi.rdl > $this_dir/../docs/examples/print_hierarchy_spi.stdout -$this_dir/../examples/export_json.py $this_dir/../examples/tiny.rdl -mv $this_dir/out.json $this_dir/../examples/tiny.json +../examples/print_hierarchy.py ../examples/atxmega_spi.rdl > ../docs/examples/print_hierarchy_spi.stdout +../examples/export_json.py ../examples/tiny.rdl +mv out.json ../examples/tiny.json # Run lint -pylint --rcfile $this_dir/pylint.rc -j 0 systemrdl +pylint --rcfile pylint.rc -j 0 systemrdl # Run static type checking -mypy $this_dir/../src/systemrdl +mypy ../src/systemrdl