Type hinting cleanup

This commit is contained in:
Alex Mykyta
2025-03-03 21:36:57 -08:00
parent 0258cac186
commit 40687abd6b
13 changed files with 69 additions and 45 deletions

View File

@@ -99,6 +99,7 @@ class NextStateConditional:
<field>.next = <next value>
<field>.load_next = '1;
"""
raise NotImplementedError
def get_extra_combo_signals(self, field: 'FieldNode') -> List[SVLogic]:
"""

View File

@@ -46,7 +46,7 @@ class WEWrite(AlwaysWrite):
def is_match(self, field: 'FieldNode') -> bool:
return (
field.is_hw_writable
and field.get_property('we')
and bool(field.get_property('we'))
)
def get_predicate(self, field: 'FieldNode') -> str:
@@ -64,7 +64,7 @@ class WELWrite(AlwaysWrite):
def is_match(self, field: 'FieldNode') -> bool:
return (
field.is_hw_writable
and field.get_property('wel')
and bool(field.get_property('wel'))
)
def get_predicate(self, field: 'FieldNode') -> str:

View File

@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, List
from typing import TYPE_CHECKING, List, Optional
from systemrdl.rdltypes import OnWriteType
@@ -10,7 +10,7 @@ if TYPE_CHECKING:
# TODO: implement sw=w1 "write once" fields
class _OnWrite(NextStateConditional):
onwritetype = None # type: OnWriteType
onwritetype: Optional[OnWriteType] = None
def is_match(self, field: 'FieldNode') -> bool:
return field.is_sw_writable and field.get_property('onwrite') == self.onwritetype