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

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

class LatticeECP5Platform(TemplatedPlatform):
    """
    .. rubric:: Trellis toolchain

    Required tools:
        * ``yosys``
        * ``nextpnr-ecp5``
        * ``ecppack``

    The environment is populated by running the script specified in the environment variable
    ``AMARANTH_ENV_TRELLIS``, 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_ecp5`` Yosys command.
        * ``script_after_read``: inserts commands after ``read_ilang`` in Yosys script.
        * ``script_after_synth``: inserts commands after ``synth_ecp5`` in Yosys script.
        * ``yosys_opts``: adds extra options for ``yosys``.
        * ``nextpnr_opts``: adds extra options for ``nextpnr-ecp5``.
        * ``ecppack_opts``: adds extra options for ``ecppack``.
        * ``add_preferences``: inserts commands at the end of the LPF file.

    Build products:
        * ``{{name}}.rpt``: Yosys log.
        * ``{{name}}.json``: synthesized RTL.
        * ``{{name}}.tim``: nextpnr log.
        * ``{{name}}.config``: ASCII bitstream.
        * ``{{name}}.bit``: binary bitstream.
        * ``{{name}}.svf``: JTAG programming vector.

    .. rubric:: Diamond toolchain

    Required tools:
        * ``pnmainc``
        * ``ddtcmd``

    The environment is populated by running the script specified in the environment variable
    ``AMARANTH_ENV_DIAMOND``, if present. On Linux, diamond_env as provided by Diamond
    itself is a good candidate. On Windows, the following script (named ``diamond_env.bat``,
    for instance) is known to work::

        @echo off
        set PATH=C:\\lscc\\diamond\\%DIAMOND_VERSION%\\bin\\nt64;%PATH%

    Available overrides:
        * ``script_project``: inserts commands before ``prj_project save`` in Tcl script.
        * ``script_after_export``: inserts commands after ``prj_run Export`` in Tcl script.
        * ``add_preferences``: inserts commands at the end of the LPF file.
        * ``add_constraints``: inserts commands at the end of the XDC file.

    Build products:
        * ``{{name}}_impl/{{name}}_impl.htm``: consolidated log.
        * ``{{name}}.bit``: binary bitstream.
        * ``{{name}}.svf``: JTAG programming vector.
    """
    toolchain = ...
    device = ...
    package = ...
    speed = ...
    grade = ...
    _nextpnr_device_options = ...
    _nextpnr_package_options = ...
    _trellis_required_tools = ...
    _trellis_file_templates = ...
    _trellis_command_templates = ...
    _diamond_required_tools = ...
    _diamond_file_templates = ...
    _diamond_command_templates = ...
    def __init__(self, *, toolchain=...) -> None:
        ...
    
    @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:
        ...
    
    _single_ended_io_types = ...
    _differential_io_types = ...
    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:
        ...
    
    def get_diff_tristate(self, pin, port, attrs, invert): # -> Module:
        ...
    
    def get_diff_input_output(self, pin, port, attrs, invert): # -> Module:
        ...
    


