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

from ..hdl import *
from ..build import *

class LatticeICE40Platform(TemplatedPlatform):
    """
    .. rubric:: IceStorm toolchain

    Required tools:
        * ``yosys``
        * ``nextpnr-ice40``
        * ``icepack``

    The environment is populated by running the script specified in the environment variable
    ``AMARANTH_ENV_ICESTORM``, if present.

    Available overrides:
        * ``verbose``: enables logging of informational messages to standard error.
        * ``read_verilog_opts``: adds options for ``read_verilog`` Yosys command.
        * ``synth_opts``: adds options for ``synth_ice40`` Yosys command.
        * ``script_after_read``: inserts commands after ``read_ilang`` in Yosys script.
        * ``script_after_synth``: inserts commands after ``synth_ice40`` in Yosys script.
        * ``yosys_opts``: adds extra options for ``yosys``.
        * ``nextpnr_opts``: adds extra options for ``nextpnr-ice40``.
        * ``add_pre_pack``: inserts commands at the end in pre-pack Python script.
        * ``add_constraints``: inserts commands at the end in the PCF file.

    Build products:
        * ``{{name}}.rpt``: Yosys log.
        * ``{{name}}.json``: synthesized RTL.
        * ``{{name}}.tim``: nextpnr log.
        * ``{{name}}.asc``: ASCII bitstream.
        * ``{{name}}.bin``: binary bitstream.

    .. rubric:: iCECube2 toolchain

    This toolchain comes in two variants: ``LSE-iCECube2`` and ``Synplify-iCECube2``.

    Required tools:
        * iCECube2 toolchain
        * ``tclsh``

    The environment is populated by setting the necessary environment variables based on
    ``AMARANTH_ENV_ICECUBE2``, which must point to the root of the iCECube2 installation, and
    is required.

    Available overrides:
        * ``verbose``: enables logging of informational messages to standard error.
        * ``lse_opts``: adds options for LSE.
        * ``script_after_add``: inserts commands after ``add_file`` in Synplify Tcl script.
        * ``script_after_options``: inserts commands after ``set_option`` in Synplify Tcl script.
        * ``add_constraints``: inserts commands in SDC file.
        * ``script_after_flow``: inserts commands after ``run_sbt_backend_auto`` in SBT
          Tcl script.

    Build products:
        * ``{{name}}_lse.log`` (LSE) or ``{{name}}_design/{{name}}.htm`` (Synplify): synthesis log.
        * ``sbt/outputs/router/{{name}}_timing.rpt``: timing report.
        * ``{{name}}.edf``: EDIF netlist.
        * ``{{name}}.bin``: binary bitstream.
    """
    toolchain = ...
    device = ...
    package = ...
    _nextpnr_device_options = ...
    _nextpnr_package_options = ...
    _icestorm_required_tools = ...
    _icestorm_file_templates = ...
    _icestorm_command_templates = ...
    _icecube2_required_tools = ...
    _icecube2_file_templates = ...
    _lse_icecube2_command_templates = ...
    _synplify_icecube2_command_templates = ...
    def __init__(self, *, toolchain=...) -> None:
        ...
    
    @property
    def family(self): # -> Literal['iCE40', 'iCE5']:
        ...
    
    @property
    def required_tools(self): # -> list[str]:
        ...
    
    @property
    def file_templates(self): # -> dict[str, str]:
        ...
    
    @property
    def command_templates(self): # -> list[str]:
        ...
    
    @property
    def default_clk_constraint(self): # -> Clock:
        ...
    
    def create_missing_domain(self, name): # -> Module | None:
        ...
    
    def should_skip_port_component(self, port, attrs, component): # -> bool:
        ...
    
    def get_input(self, pin, port, attrs, invert): # -> Module:
        ...
    
    def get_output(self, pin, port, attrs, invert): # -> Module:
        ...
    
    def get_tristate(self, pin, port, attrs, invert): # -> Module:
        ...
    
    def get_input_output(self, pin, port, attrs, invert): # -> Module:
        ...
    
    def get_diff_input(self, pin, port, attrs, invert): # -> Module:
        ...
    
    def get_diff_output(self, pin, port, attrs, invert): # -> Module:
        ...
    


