Skip to content

Eriemon/verilog-generator

readable-verilog-generator

Verified

Use when creating, writing, reviewing, annotating, repairing, refactoring, or validating readable Verilog RTL, including synthesizable Verilog-2001 .v files, existing-RTL analysis, semantic comment annotation, testbench scaffold planning, ASIC-quality review, local or remote Vivado/xsim validation, evidence-backed repair, and workflow trace diagnosis.

FileKindSize
SKILL.mdskill md21.3 KB
agents/openai.yamlconfig363 B
assets/examples/existing_rtl/fsm_without_default.vother761 B
assets/examples/existing_rtl/fsm_without_default_spec.mdmarkdown311 B
assets/examples/existing_rtl/leaf_counter.vother314 B
assets/examples/existing_rtl/missing_output_register.vother423 B
assets/examples/existing_rtl/missing_output_register_spec.mdmarkdown331 B
assets/examples/existing_rtl/ready_valid_slice.vother967 B
assets/examples/existing_rtl/ready_valid_slice_spec.mdmarkdown420 B
assets/examples/existing_rtl/reset_gap_counter.vother319 B
assets/examples/existing_rtl/reset_gap_counter_spec.mdmarkdown212 B
assets/examples/existing_rtl/tb_ready_valid_slice.vother846 B
assets/examples/existing_rtl/top_counter.vother271 B
assets/examples/existing_rtl/traffic_light.vother2.5 KB
assets/examples/existing_rtl/traffic_light_spec.mdmarkdown585 B
assets/examples/readme/axis_packet_meter.vother10.2 KB
assets/examples/remote_fixtures/comb_hierarchy_budget/generated/rtl/comb_hierarchy_budget.vother1.9 KB
assets/examples/remote_fixtures/comb_hierarchy_budget/generated/tb/tb_comb_hierarchy_budget.vother2.5 KB
assets/examples/remote_fixtures/comb_hierarchy_budget/hierarchy_child_loop.vother447 B
assets/examples/remote_fixtures/comb_hierarchy_budget/hierarchy_over_budget.vother527 B
assets/examples/remote_fixtures/comb_hierarchy_budget/hierarchy_q_cut.vother467 B
assets/examples/remote_fixtures/comb_hierarchy_budget/hierarchy_within_budget.vother450 B
assets/examples/remote_fixtures/comb_hierarchy_budget/spec.jsonconfig1.7 KB
assets/examples/remote_fixtures/comb_operation_budget/comb_operation_budget_bad.vother187 B
assets/examples/remote_fixtures/comb_operation_budget/generated/rtl/comb_operation_budget.vother6.1 KB
assets/examples/remote_fixtures/comb_operation_budget/generated/tb/tb_comb_operation_budget.vother5.7 KB
assets/examples/remote_fixtures/comb_operation_budget/spec.jsonconfig2.9 KB
assets/examples/remote_fixtures/comb_parity_mux/generated/rtl/comb_parity_mux.vother2.1 KB
assets/examples/remote_fixtures/comb_parity_mux/generated/tb/tb_comb_parity_mux.vother2.8 KB
assets/examples/remote_fixtures/comb_parity_mux/spec.jsonconfig1.9 KB
assets/examples/remote_fixtures/pipeline_delay/generated/rtl/pipeline_delay.vother4.5 KB
assets/examples/remote_fixtures/pipeline_delay/generated/tb/tb_pipeline_delay.vother2.6 KB
assets/examples/remote_fixtures/pipeline_delay/spec.jsonconfig2.2 KB
assets/examples/remote_fixtures/ready_valid_slice/generated/rtl/ready_valid_slice.vother5.2 KB
assets/examples/remote_fixtures/ready_valid_slice/generated/tb/tb_ready_valid_slice.vother2.9 KB
assets/examples/remote_fixtures/ready_valid_slice/spec.jsonconfig2.6 KB
assets/examples/rtl_erie_verilog_spec.jsonconfig2.1 KB
assets/examples/use_case_templates/jesd_adc.jsonconfig2.4 KB
assets/examples/use_case_templates/jesd_dac.jsonconfig2.5 KB
assets/examples/use_case_templates/mxfe_mixed.jsonconfig2.7 KB
assets/examples/use_case_templates/spi_adc.jsonconfig2.8 KB
assets/examples/use_case_templates/spi_dac.jsonconfig2.7 KB
assets/examples/verilog_pattern_templates/axi4_lite_csr.jsonconfig2.1 KB
assets/examples/verilog_pattern_templates/axi_interconnect_dma.jsonconfig2.3 KB
assets/examples/verilog_pattern_templates/axis_ready_valid.jsonconfig2.3 KB
assets/examples/verilog_pattern_templates/conv_load_store.jsonconfig1.8 KB
assets/external_interface_catalog.jsonconfig2.9 KB
assets/ideal_bad_style_metrics.jsonconfig17.5 KB
assets/installer/manifest.projection.jsonconfig2.8 KB
assets/installer/platforms.jsonconfig1.3 KB
assets/interface_templates/ahb_lite_config.vincother2.3 KB
assets/interface_templates/apb_config.vincother861 B
assets/interface_templates/axi4_full_master.vincother1.8 KB
assets/interface_templates/axi4_full_slave.vincother1.8 KB
assets/interface_templates/axi4_lite_config.vincother1.6 KB
assets/interface_templates/axi_stream_duplex.vincother1.1 KB
assets/interface_templates/catalog.jsonconfig2.6 KB
assets/project_ip_interface_manifest.template.jsonconfig9.4 KB
assets/readme-workflow.pngbinary1.4 MB
assets/readme/design-profile-cn.pngbinary1.4 MB
assets/readme/design-profile.pngbinary1.4 MB
assets/readme/evidence-guard-cn.pngbinary1.4 MB
assets/readme/evidence-guard.pngbinary1.4 MB
assets/readme/hero-overview-cn.pngbinary1.5 MB
assets/readme/hero-overview.pngbinary1.5 MB
assets/readme/project-facts-cn.pngbinary1.2 MB
assets/readme/project-facts.pngbinary1.3 MB
assets/readme/rule-rendering-cn.pngbinary1.4 MB
assets/readme/rule-rendering.pngbinary1.2 MB
assets/style_templates/header_prompt_none_mode.txtmarkdown2.1 KB
assets/style_templates/header_prompt_table_mode.txtmarkdown2.5 KB
assets/style_templates/rtl_bus_grouping.tplother1.0 KB
assets/style_templates/rtl_fsm.tplother832 B
assets/style_templates/rtl_header_bilingual.tplother1.6 KB
assets/style_templates/rtl_instantiation.tplother496 B
assets/style_templates/rtl_region_order.tplother987 B
assets/use_case_templates/catalog.jsonconfig2.8 KB
assets/use_case_templates/jesd_adc/README.mdmarkdown699 B
assets/use_case_templates/jesd_adc/constraints/system_constr.xdcother454 B
assets/use_case_templates/jesd_adc/manifest.jsonconfig1.7 KB
assets/use_case_templates/jesd_adc/tcl/common_bd.tclother4.0 KB
assets/use_case_templates/jesd_adc/tcl/system_bd.tclother920 B
assets/use_case_templates/jesd_adc/tcl/system_project.tclother1.0 KB
assets/use_case_templates/jesd_adc/verilog/system_top.vother2.9 KB
assets/use_case_templates/jesd_dac/README.mdmarkdown745 B
assets/use_case_templates/jesd_dac/constraints/system_constr.xdcother299 B
assets/use_case_templates/jesd_dac/manifest.jsonconfig1.7 KB
assets/use_case_templates/jesd_dac/tcl/common_bd.tclother4.8 KB
assets/use_case_templates/jesd_dac/tcl/system_bd.tclother923 B
assets/use_case_templates/jesd_dac/tcl/system_project.tclother1.1 KB
assets/use_case_templates/jesd_dac/verilog/system_top.vother2.9 KB
assets/use_case_templates/mxfe_mixed/README.mdmarkdown739 B
assets/use_case_templates/mxfe_mixed/constraints/system_constr.xdcother380 B
assets/use_case_templates/mxfe_mixed/manifest.jsonconfig1.8 KB
assets/use_case_templates/mxfe_mixed/tcl/common_bd.tclother5.4 KB
assets/use_case_templates/mxfe_mixed/tcl/system_bd.tclother1.2 KB
assets/use_case_templates/mxfe_mixed/tcl/system_project.tclother1.2 KB
assets/use_case_templates/mxfe_mixed/verilog/system_top.vother3.4 KB
assets/use_case_templates/spi_adc/README.mdmarkdown925 B
assets/use_case_templates/spi_adc/constraints/system_constr.xdcother635 B
assets/use_case_templates/spi_adc/manifest.jsonconfig1.7 KB
assets/use_case_templates/spi_adc/tcl/common_bd.tclother6.3 KB
assets/use_case_templates/spi_adc/tcl/system_bd.tclother1.6 KB
assets/use_case_templates/spi_adc/tcl/system_project.tclother982 B
assets/use_case_templates/spi_adc/verilog/system_top.vother4.2 KB
assets/use_case_templates/spi_dac/README.mdmarkdown757 B
assets/use_case_templates/spi_dac/constraints/system_constr.xdcother546 B
assets/use_case_templates/spi_dac/manifest.jsonconfig1.6 KB
assets/use_case_templates/spi_dac/tcl/common_bd.tclother5.7 KB
assets/use_case_templates/spi_dac/tcl/system_bd.tclother1.0 KB
assets/use_case_templates/spi_dac/tcl/system_project.tclother981 B
assets/use_case_templates/spi_dac/verilog/system_top.vother3.5 KB
assets/verilog_formatter_config/defaults.jsonconfig6.2 KB
assets/verilog_formatter_config/profiles/conservative.jsonconfig283 B
assets/verilog_formatter_config/profiles/example_compat.jsonconfig484 B
assets/verilog_formatter_config/profiles/formatter-lint.jsonconfig121 B
assets/verilog_formatter_config/profiles/formatter-normalize.jsonconfig182 B
assets/verilog_formatter_config/profiles/formatter-preserve.jsonconfig385 B
assets/verilog_formatter_config/profiles/formatting.jsonconfig270 B
assets/verilog_formatter_config/profiles/lint.jsonconfig269 B
assets/verilog_formatter_config/profiles/migration.jsonconfig239 B
assets/verilog_formatter_config/profiles/stress_cases_compat.jsonconfig484 B
assets/verilog_formatter_config/profiles/vitis-wrapper.jsonconfig486 B
assets/verilog_formatter_config/schema.jsonconfig13.7 KB
assets/verilog_formatter_config/templates/task-batch.jsonconfig212 B
assets/verilog_formatter_config/templates/task-inplace.jsonconfig221 B
assets/verilog_formatter_config/templates/task-single-file.jsonconfig220 B
assets/verilog_pattern_templates/axi4_lite_csr_shell.vincother562 B
assets/verilog_pattern_templates/axi_interconnect_port_groups.vincother592 B
assets/verilog_pattern_templates/axis_ready_valid_slice.vincother494 B
assets/verilog_pattern_templates/catalog.jsonconfig2.2 KB
assets/verilog_pattern_templates/conv_load_store_pipeline.vincother457 B
assets/verilog_pattern_templates/counter_state_bridge.vincother443 B
assets/verilog_pattern_templates/equivalence_wrapper_probe.vincother306 B
assets/verilog_pattern_templates/fsm_state_transition.vincother1.0 KB
assets/verilog_pattern_templates/phase_output_registering.vincother404 B
assets/verilog_pattern_templates/wrapper_top_stitching.vincother608 B
assets/verilog_quality_gates.jsonconfig38.2 KB
assets/verilog_style_rules.jsonconfig11.8 KB
assets/xilinx_primitive_semantics.jsonconfig21.4 KB
references/checklists/capability-distillation-checklist.mdmarkdown3.0 KB
references/checklists/lint-checklist.mdmarkdown3.6 KB
references/checklists/verilog-readability-gate.mdmarkdown3.5 KB
references/corpus/verilog-style-observations.mdmarkdown4.6 KB
references/integration/configuration.mdmarkdown19.9 KB
references/integration/host-integration.mdmarkdown10.6 KB
references/rules/asic-verilog-quality.mdmarkdown3.9 KB
references/rules/erie-style.mdmarkdown6.3 KB
references/rules/testbench-patterns.mdmarkdown3.2 KB
references/rules/verilog-code-comment-naming-standard.mdmarkdown55.6 KB
references/rules/verilog-comment-placement.mdmarkdown8.4 KB
references/rules/verilog-pattern-templates.mdmarkdown1.1 KB
references/rules/verilog-quality-gates.mdmarkdown21.4 KB
references/rules/xilinx-primitive-exemptions.mdmarkdown10.6 KB
references/skill/installation.mdmarkdown6.1 KB
references/skill/script-guide.mdmarkdown7.5 KB
references/skill/skill-standards.mdmarkdown2.1 KB
references/workflows/verilog_dispatcher.mdmarkdown6.4 KB
references/workflows/workflow-contracts.mdmarkdown15.1 KB
scripts/__init__.pyscript53 B
scripts/python/__init__.pyscript55 B
scripts/python/corpus/analyze_verilog_style_corpus.pyscript25.3 KB
scripts/python/existing_rtl/existing_rtl.pyscript81.1 KB
scripts/python/existing_rtl/existing_rtl_improvement.pyscript109.9 KB
scripts/python/existing_rtl/intervention.pyscript8.3 KB
scripts/python/existing_rtl/optimizer.pyscript25.8 KB
scripts/python/existing_rtl/reflection.pyscript86.7 KB
scripts/python/existing_rtl/semantic_contract.pyscript45.6 KB
scripts/python/existing_rtl/verifier.pyscript15.3 KB
scripts/python/existing_rtl/verify_repair.pyscript4.6 KB
scripts/python/existing_rtl/verify_repair_core.pyscript45.7 KB
scripts/python/existing_rtl/verify_repair_patch_apply.pyscript23.5 KB
scripts/python/existing_rtl/verify_repair_patch_categories.pyscript35.5 KB
scripts/python/existing_rtl/verify_repair_patch_plan.pyscript25.1 KB
scripts/python/existing_rtl/verify_repair_patching.pyscript2.4 KB
scripts/python/existing_rtl/verify_repair_support.pyscript25.6 KB
scripts/python/existing_rtl/verify_repair_testbench.pyscript45.9 KB
scripts/python/existing_rtl/verify_reporting.pyscript16.1 KB
scripts/python/facade/__init__.pyscript45 B
scripts/python/facade/existing_rtl_api.pyscript14.0 KB
scripts/python/facade/quality_api.pyscript19.9 KB
scripts/python/facade/representative_cases.pyscript38.3 KB
scripts/python/facade/verilog_api.pyscript6.5 KB
scripts/python/facade/workflow_api.pyscript63.2 KB
scripts/python/generation/tb_generator.pyscript54.9 KB
scripts/python/header_contract.pyscript21.1 KB
scripts/python/installation/__init__.pyscript52 B
scripts/python/installation/bundle.pyscript16.3 KB
scripts/python/installation/catalog.pyscript16.6 KB
scripts/python/installation/cli.pyscript26.4 KB
scripts/python/installation/projection.pyscript14.2 KB
scripts/python/installation/receipt.pyscript13.4 KB
scripts/python/installation/transaction.pyscript29.0 KB
scripts/python/quality/clock_name_roles.pyscript1.0 KB
scripts/python/quality/comment_placement.pyscript49.5 KB
scripts/python/quality/declaration_region_policy.pyscript8.0 KB
scripts/python/quality/deliverable_gate.pyscript51.9 KB
scripts/python/quality/external_interface_stubs.pyscript41.5 KB
scripts/python/quality/formatter_ast.pyscript85.0 KB
scripts/python/quality/formatter_ast_instances.pyscript5.4 KB

scripts/python/facade/existing_rtl_api.py

View on GitHub
"""Verilog facade 的 existing-RTL 分析、精修与 verify-repair 入口。"""

# future annotations 避免注解在导入期求值。
from __future__ import annotations

# Path 负责把调用方输入统一转成路径对象。
from pathlib import Path

# Any 用于兼容旧 facade 的自由配置字典。
from typing import Any

# existing RTL runtime 提供分析与规范文本加载能力。
from scripts.python.existing_rtl.existing_rtl import analyze_existing_rtl, load_spec_text

# improvement runtime 负责已有 RTL 精修和语义比较。
from scripts.python.existing_rtl.existing_rtl_improvement import (
    ImproveExistingRtlOptions,
    compare_semantics,
    improve_existing_rtl as improve_existing_rtl_runtime,
)

# verify-repair runtime 负责已有 RTL 的验证修复流程。
from scripts.python.existing_rtl.verify_repair import verify_existing as verify_existing_runtime

# workspace 上下文确保运行期相对路径落在指定 run_dir。
from scripts.python.workflow.workspace import use_workspace_root

# workflow facade 私有辅助函数负责兼容参数归一化。
from .workflow_api import _merged_option_dict, _optional_path, _resolve_external_run

# _resolve_sources 把单文件或多文件 RTL 输入收敛为统一列表。
def _resolve_sources(source: str | Path | list[str | Path]) -> list[Path]:
    """把单路径或多路径 RTL 输入统一收敛成路径列表。

    参数:
        source: 单个 RTL 路径,或由多个 RTL 路径组成的列表。

    返回:
        返回按 Path 归一化后的 RTL 源文件路径列表。
    """

    # 多文件输入直接逐项转成 Path,保留原有顺序。
    if isinstance(source, list):

        # 返回多文件 RTL 的 Path 列表。
        return [Path(item) for item in source]

    # 单文件输入也包装成列表,统一下游接口形状。
    return [Path(source)]

# analyze_existing_verilog 提供已有 RTL 分析的稳定 facade 入口。
def analyze_existing_verilog(
    source: str | Path | list[str | Path],
    *,
    out_dir: str | Path,
    spec_source: str | Path | dict[str, Any] | None = None,
    module_name: str | None = None,
) -> dict[str, Any]:
    """分析已有 Verilog RTL,并把 runtime 结果裁剪成稳定字段。

    参数:
        source: 单个或多个待分析 RTL 源文件路径。
        out_dir: 运行目录,用于承载分析产物。
        spec_source: 可选规范来源,传给 runtime 用于补充分析上下文。
        module_name: 可选顶层模块名;缺省时由 runtime 自行推断。

    返回:
        返回仅包含稳定字段的 existing-RTL 分析结果字典。
    """

    # run_dir 作为分析产物根目录,并驱动 workspace 上下文切换。
    path_run_dir = Path(out_dir)  # existing-RTL 分析运行目录

    # 先确保分析产物目录存在,避免 runtime 因目录缺失失败。
    path_run_dir.mkdir(parents=True, exist_ok=True)

    # 把调用方输入统一转成 runtime 需要的 Path 列表。
    list_sources = _resolve_sources(source)  # 归一化后的 RTL 源列表

    # 在 run_dir 作为工作根目录的上下文中执行 runtime 分析。
    with use_workspace_root(path_run_dir):

        # 规范文本在进入 runtime 前完成加载,保持旧入口合同。
        str_spec_text = load_spec_text(spec_source)  # 归一化后的规范文本

        # runtime 分析结果仍保留完整字段,供 facade 做稳定裁剪。
        dict_analysis_result = analyze_existing_rtl(  # runtime 返回的完整分析结果字典
            list_sources,  # 待分析 RTL 源列表
            spec_text=str_spec_text,  # 从 spec_source 载入的分析上下文文本
            module_name=module_name,  # 可选顶层模块名
            out_dir=path_run_dir,  # 分析产物输出目录
        )

    # facade 只返回上层已经依赖的稳定字段集合。
    return {
        "status": "analyzed",
        "run_dir": str(path_run_dir),
        "analysis_path": str(dict_analysis_result["analysis_path"]),
        "project_analysis_path": str(dict_analysis_result["project_analysis_path"]),
        "design_explanation_path": str(dict_analysis_result["design_explanation_path"]),
        "analysis": dict_analysis_result["analysis"],
        "project_analysis": dict_analysis_result["project_analysis"],
    }

# improve_existing_verilog 提供已有 RTL 受控精修的稳定 facade 入口。
def improve_existing_verilog(
    source: str | Path,
    *,
    config: dict[str, Any] | None = None,
    **legacy_options: Any,
) -> dict[str, Any]:
    """执行已有 RTL 受控精修流程。

    参数:
        source: 待精修 RTL 文件路径。
        config: 新式 facade 配置字典;缺省时只使用 legacy_options。
        legacy_options: 旧调用方传入的兼容关键字参数。

    返回:
        返回 runtime 精修流程输出的结构化结果字典。
    """

    # 精修白名单文本先单独命名,避免集合定义行过长。
    str_allowed_keys_text = (
        "out_dir improve_goal analysis_source spec_source "
        "candidate_artifacts_dir baseline_artifacts_dir readiness tb_language"
    )  # 精修入口允许的兼容键文本

    # 再把白名单文本切分成 set,供兼容配置合并使用。
    set_allowed_keys = set(str_allowed_keys_text.split())  # 精修入口允许的兼容配置键集合

    # facade 操作名需要单独传入合并器,便于错误信息定位调用入口。
    str_operation_name = "improve_existing_verilog"  # 当前 facade 配置合并的入口名称

    # 合并 config 与 legacy_options,得到精修入口的统一配置视图。
    dict_options = _merged_option_dict(str_operation_name, config, legacy_options, allowed_keys=set_allowed_keys)  # 归一化后的精修配置字典

    # run_dir 作为精修产物根目录,并驱动 workspace 上下文切换。
    path_run_dir = Path(dict_options["out_dir"])  # 精修流程运行目录

    # 先确保精修产物目录存在,避免 runtime 因目录缺失失败。
    path_run_dir.mkdir(parents=True, exist_ok=True)

    # analysis_source 表示这次精修要复用的旧分析结论文件。
    path_analysis_source = _optional_path(dict_options.get("analysis_source"))  # 精修流程回看既有分析的输入文件

    # candidate_artifacts_dir 表示这次精修待比较的新候选工件目录。
    path_candidate_artifacts_dir = _optional_path(dict_options.get("candidate_artifacts_dir"))  # 精修流程比较候选结果的工件目录

    # baseline_artifacts_dir 表示回归比对依赖的基线工件集合目录。
    path_baseline_artifacts_dir = _optional_path(dict_options.get("baseline_artifacts_dir"))  # 精修流程比对基线结果的目录

    # 在 run_dir 作为工作根目录的上下文中执行 runtime 精修。
    with use_workspace_root(path_run_dir):

        # 直接返回 runtime 精修结果,保持上层依赖字段稳定。
        return improve_existing_rtl_runtime(
            Path(source),
            out_dir=path_run_dir,
            improve_goal=str(dict_options.get("improve_goal", "tb_scaffold")),
            options=ImproveExistingRtlOptions(
                analysis_source=path_analysis_source,
                spec_source=dict_options.get("spec_source"),
                candidate_artifacts_dir=path_candidate_artifacts_dir,
                baseline_artifacts_dir=path_baseline_artifacts_dir,
                readiness=str(dict_options.get("readiness", "static")),
                tb_language=str(dict_options.get("tb_language", "verilog")),
            ),
        )

# compare_verilog_semantics 提供参考 RTL 与候选 RTL 的语义对比入口。
def compare_verilog_semantics(
    reference: str | Path,
    candidate: str | Path,
    *,
    out_dir: str | Path,
    run_external: bool = True,
    readiness: str = "static",
    external_target: str = "remote",
) -> dict[str, Any]:
    """比较参考 RTL 与候选 RTL 的语义漂移。

    参数:
        reference: 参考 RTL 文件路径。
        candidate: 候选 RTL 文件路径。
        out_dir: 运行目录,用于承载语义比较产物。
        run_external: 是否允许触发外部验证链。
        readiness: 当前验证准备度等级。
        external_target: 外部验证目标环境标识。

    返回:
        返回 runtime 语义比较流程输出的结构化结果字典。
    """

    # run_dir 作为语义比较产物根目录,并驱动 workspace 上下文切换。
    path_run_dir = Path(out_dir)  # 语义比较运行目录

    # 先确保语义比较产物目录存在。
    path_run_dir.mkdir(parents=True, exist_ok=True)

    # 语义比较的外部执行开关由 readiness 与目标环境共同裁决。
    bool_run_external = _resolve_external_run(  # 当前语义比较是否执行外部链路
        run_external,  # 调用方请求的外部执行开关
        readiness=readiness,  # 当前语义比较的准备度
        external_target=external_target,  # 语义比较要命中的外部环境
        allow_static_external=True,  # static 准备度下允许远程比较
    )

    # 在 run_dir 作为工作根目录的上下文中执行语义比较。
    with use_workspace_root(path_run_dir):

        # 直接返回 runtime 语义比较结果,保持上层字段合同稳定。
        return compare_semantics(
            Path(reference),
            Path(candidate),
            out_dir=path_run_dir,
            run_external=bool_run_external,
            readiness=readiness,
        )

# verify_existing_verilog 提供已有 RTL 验证修复流程的稳定 facade 入口。
def verify_existing_verilog(
    source: str | Path | list[str | Path],
    *,
    config: dict[str, Any] | None = None,
    **legacy_options: Any,
) -> dict[str, Any]:
    """对已有 RTL 执行验证修复流程。

    参数:
        source: 单个或多个待验证 RTL 源文件路径。
        config: 新式 facade 配置字典;缺省时只使用 legacy_options。
        legacy_options: 旧调用方传入的兼容关键字参数。

    返回:
        返回 runtime verify-repair 流程输出的结构化结果字典。
    异常:
        ValueError: 缺少显式 automation_mode 时抛出,避免已有 RTL 修复边界被默认值放宽。
    """

    # verify-repair 白名单文本先单独命名,避免集合定义行过长。
    str_allowed_keys_text = (
        "out_dir spec_source module_name testbench_source decision_source "
        "tb_mode tb_language automation_mode readiness run_external external_target"
    )  # verify-repair 入口允许的兼容键文本

    # 这里把键文本切成集合,后面只允许这些字段透传到 verify-repair runtime。
    set_allowed_keys = set(str_allowed_keys_text.split())  # verify-repair 入口允许透传给 runtime 的字段集合

    # 合并 config 与 legacy_options,得到 verify-repair 入口的统一配置视图。
    dict_options = _merged_option_dict("verify_existing_verilog", config, legacy_options, allowed_keys=set_allowed_keys)  # 归一化后的 verify-repair 配置字典

    # automation_mode 是已有资产修复边界,必须由调用方显式声明。
    if not dict_options.get("automation_mode"):

        # 不再回退 guided,避免 facade 静默放宽已有 RTL 修复策略。
        raise ValueError("> ERR: [Python] verify_existing_verilog 需要显式 automation_mode")

    # run_dir 作为验证修复产物根目录,并驱动 workspace 上下文切换。
    path_run_dir = Path(dict_options["out_dir"])  # verify-repair 运行目录

    # 先确保验证修复产物目录存在。
    path_run_dir.mkdir(parents=True, exist_ok=True)

    # source 参数可能是单文件也可能是列表,这里先把形状统一下来。
    list_sources = _resolve_sources(source)  # verify-repair 要处理的 RTL 源列表

    # 先把 verify-repair 的外部验证请求归一化成布尔值。
    bool_requested_external = bool(dict_options.get("run_external", True))  # verify-repair 是否收到外部验证请求

    # verify-repair 的外部执行开关由 readiness 与目标环境共同裁决。
    bool_run_external = _resolve_external_run(  # 当前 verify-repair 是否执行外部链路
        bool_requested_external,  # 调用方给出的 verify-repair 外部验证意图
        readiness=str(dict_options.get("readiness", "static")),  # verify-repair 当前准备度
        external_target=str(dict_options.get("external_target", "remote")),  # verify-repair 目标外部环境
        allow_static_external=True,  # static 准备度下允许远程验证
    )

    # testbench_source 表示验证修复流程要复用的激励脚手架来源。
    path_testbench_source = _optional_path(dict_options.get("testbench_source"))  # verify-repair 引用的 testbench 文件路径

    # decision_source 表示验证修复流程要复用的历史决策记录来源。
    path_decision_source = _optional_path(dict_options.get("decision_source"))  # verify-repair 引用的 decision 记录路径

    # 在 run_dir 作为工作根目录的上下文中执行 verify-repair。
    with use_workspace_root(path_run_dir):

        # 直接返回 runtime verify-repair 结果,保持上层字段合同稳定。
        return verify_existing_runtime(
            list_sources,
            out_dir=path_run_dir,
            spec_source=dict_options.get("spec_source"),
            module_name=dict_options.get("module_name"),
            testbench_source=path_testbench_source,
            decision_source=path_decision_source,
            tb_mode=str(dict_options.get("tb_mode", "generate")),
            tb_language=str(dict_options.get("tb_language", "verilog")),
            automation_mode=str(dict_options["automation_mode"]),
            readiness=str(dict_options.get("readiness", "static")),
            run_external=bool_run_external,
        )
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall