"""
This type stub file was generated by pyright.
"""

from typing import Any
from contextlib import contextmanager
from ..hdl import *
from ._base import *

__all__ = ["PySimEngine"]

class _VCDWriter:
    @staticmethod
    def decode_to_vcd(signal, value):
        ...
    
    def __init__(self, state, design, *, vcd_file, gtkw_file=..., traces=..., fs_per_delta=..., processes=...) -> None:
        ...
    
    def update(self, timestamp, signal, value): # -> None:
        ...
    
    def close(self, timestamp):
        ...
    
    vcd_file: Any
    gtkw_file: Any
    gtkw_save: Any
    gtkw_signal_names: Any
    gtkw_memory_names: Any
    vcd_writer: Any

class _PyTimeline:
    def __init__(self) -> None:
        ...
    
    def reset(self): # -> None:
        ...
    
    def set_waker(self, interval, waker):
        ...

    def advance(self): # -> bool:
        ...
    


class _PySignalState(BaseSignalState):
    __slots__ = ...
    def __init__(self, signal, pending) -> None:
        ...

    def reset(self):
        ...

    def add_waker(self, waker):
        ...

    def update(self, value):
        ...
    
    def commit(self): # -> bool:
        ...
    


class _PyEngineState(BaseEngineState):
    def __init__(self) -> None:
        ...
    
    def reset(self): # -> None:
        ...
    
    def get_signal(self, signal): # -> int:
        ...
    
    def get_memory(self, memory): # -> int:
        ...
    
    def set_delay_waker(self, interval, waker):
        ...

    def add_signal_waker(self, signal, waker):
        ...

    def add_memory_waker(self, memory, waker):
        ...

    def commit(self, changed=...): # -> bool:
        ...
    


class PySimEngine(BaseEngine):
    def __init__(self, fragment) -> None:
        ...
    
    @property
    def state(self) -> BaseEngineState:
        ...

    @property
    def now(self): # -> int | None:
        ...
    
    def reset(self): # -> None:
        ...
    
    def advance(self): # -> bool:
        ...

    def add_clock_process(self, clock, *, phase, period):
        ...

    def add_async_process(self, simulator, process):
        ...

    def add_async_testbench(self, simulator, process, *, background):
        ...

    def add_trigger_combination(self, combination, *, oneshot):
        ...

    def get_value(self, expr):
        ...

    def set_value(self, expr, value):
        ...

    def step_design(self):
        ...

    @contextmanager
    def write_vcd(self, *, vcd_file, gtkw_file, traces, fs_per_delta): # -> Generator[None, None, None]:
        ...
    


