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

@@ -27,20 +27,21 @@ if TYPE_CHECKING:
from systemrdl.rdltypes import UserEnum
class RegblockExporter:
hwif: Hwif
cpuif: CpuifBase
address_decode: AddressDecode
field_logic: FieldLogic
readback: Readback
write_buffering: WriteBuffering
read_buffering: ReadBuffering
dereferencer: Dereferencer
ds: 'DesignState'
def __init__(self, **kwargs: Any) -> None:
# Check for stray kwargs
if kwargs:
raise TypeError(f"got an unexpected keyword argument '{list(kwargs.keys())[0]}'")
self.hwif = None # type: Hwif
self.cpuif = None # type: CpuifBase
self.address_decode = None # type: AddressDecode
self.field_logic = None # type: FieldLogic
self.readback = None # type: Readback
self.write_buffering = None # type: WriteBuffering
self.read_buffering = None # type: ReadBuffering
self.dereferencer = None # type: Dereferencer
self.ds = None # type: DesignState
loader = jj.ChoiceLoader([
jj.FileSystemLoader(os.path.dirname(__file__)),