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/quality/declaration_region_policy.py

View on GitHub
"""统一 formatter 与区域门禁使用的声明归属优先级。"""

# future annotations 延迟解析区域策略的容器类型。
from __future__ import annotations

# re 仅在结构引用尚未丰富时确认简单 actual 标识符,Mapping 接收异构事实。
import re
from typing import Any, Mapping

# 声明同时命中多个类别时按此顺序选择唯一归属。
DECLARATION_REGION_PRIORITY = (  # 冻结声明区域冲突消解顺序
    "output_internal",  # 输出代理信号优先于其他语义前缀
    "counter_signal",  # 计数用途优先于普通寄存器类别
    "state_signal",  # 状态信号保持独立区域
    "flag_signal",  # 控制标志优先于底层声明类型
    "encoder_signal",  # 编码中间量进入编码区域
    "decoder_signal",  # 译码中间量进入译码区域
    "register_signal",  # 普通寄存器在实例连接之前判定
    "instance_signal",  # 实例 actual 引用归入连接信号区域
    "other_signal",  # 未命中专用语义时使用兜底区域
)

# 内部区域键与 formatter 中文横幅共享同一标题表。
DECLARATION_REGION_TITLES = {  # 区域规则报告使用的稳定标题映射
    "output_internal": "输出信号",  # 输出代理信号横幅标题
    "counter_signal": "计数信号",  # 计数变量横幅标题
    "state_signal": "状态机信号",  # 状态寄存器横幅标题
    "flag_signal": "标志信号",  # 控制标志横幅标题
    "encoder_signal": "编码信号",  # 编码路径横幅标题
    "decoder_signal": "译码信号",  # 译码路径横幅标题
    "register_signal": "寄存器信号",  # 普通寄存器横幅标题
    "instance_signal": "模块实例化信号",  # 子模块连接横幅标题
    "other_signal": "其他信号",  # 其余内部信号横幅标题
}

# resolve_declaration_region 按配置和结构事实返回单一声明区域。
def resolve_declaration_region(
    str_name: str,
    str_kind: str,
    set_output_signal_names: set[str],
    set_instance_signal_names: set[str],
    dict_naming: Mapping[str, Any],
) -> str:
    """按固定冲突优先级返回声明的唯一内部区域键。

    参数:
        str_name: formatter 已解析的变量声明名称。
        str_kind: 声明类型,如 reg、wire 或 integer。
        set_output_signal_names: 由模块输出端口映射得到的内部信号集合。
        set_instance_signal_names: 由实例 actual 引用得到的连接信号集合。
        dict_naming: 风格资产中的命名前缀与输出后缀配置。
    返回:
        `DECLARATION_REGION_PRIORITY` 中的一个区域键。
    数组形状、数据类型与单位:
        shape=不适用,dtype=str,unit=无;集合成员均为字符串标识符。
    """

    # 小写副本只用于不区分大小写的语义前缀比较。
    str_lowered_name = str_name.lower()  # 当前声明名称的小写匹配文本

    # 输出后缀缺失时保持 formatter 的既有 `_o` 合同。
    str_output_suffix = str(dict_naming.get("internal_output_suffix") or "_o")  # 内部输出识别后缀

    # 输出端口映射或 `_o` 后缀具有最高归属优先级。
    if str_name in set_output_signal_names or str_name.endswith(str_output_suffix):

        # 返回输出代理区域,禁止后续前缀覆盖该结论。
        return "output_internal"

    # 专用语义前缀按批准顺序绑定到各自区域。
    tuple_prefix_regions = (  # 配置键、兼容默认值和目标区域的有序映射
        ("counter_prefix", "cnt_", "counter_signal"),  # 计数器前缀归属
        ("state_signal_prefix", "state_", "state_signal"),  # 状态信号前缀归属
        ("flag_prefix", "flag_", "flag_signal"),  # 控制标志前缀归属
        ("encoder_prefix", "enc_", "encoder_signal"),  # 编码变量前缀归属
        ("decoder_prefix", "dec_", "decoder_signal"),  # 译码变量前缀归属
        ("register_prefix", "reg_", "register_signal"),  # 普通寄存器前缀归属
    )

    # 顺序扫描确保同一名称只采用最高优先级的专用前缀。
    for str_config_key, str_fallback, str_region in tuple_prefix_regions:

        # 每个前缀都允许规则资产覆盖,同时保留安装兼容默认值。
        str_prefix = str(dict_naming.get(str_config_key) or str_fallback).lower()  # 当前类别匹配前缀

        # 完整前缀命中即可确定专用区域。
        if str_lowered_name.startswith(str_prefix):

            # 返回当前最高优先级命中的区域键。
            return str_region

    # 没有专用前缀的 reg 仍属于普通寄存器区域。
    if str_kind.lower() == "reg":

        # 声明类型证据优先于实例连接用途。
        return "register_signal"

    # 非 reg 信号只有真实出现在实例 actual 中才属于连接区域。
    if str_name in set_instance_signal_names:

        # 返回模块实例化信号区域。
        return "instance_signal"

    # 未命中任何专用证据时使用唯一兜底区域。
    return "other_signal"

# instance_signal_names_from_module 收集实例 actual 的结构化引用。
def instance_signal_names_from_module(dict_module: Mapping[str, Any]) -> set[str]:
    """从 formatter 实例关联事实收集模块连接信号名称。

    参数:
        dict_module: 含 `instances.port_associations.actual.references` 的模块事实。
    返回:
        当前模块全部非空实例 actual 引用名称集合。
    """

    # 集合去除同一连接信号在多个端口关联中的重复出现。
    set_names: set[str] = set()  # 当前模块的实例连接信号名称

    # 每个实例都只读取 formatter 已确认的结构化端口关联。
    for dict_instance in dict_module.get("instances", []) or []:

        # 命名门禁只需要端口 actual,不把参数覆盖当作信号声明。
        for dict_association in dict_instance.get("port_associations", []) or []:

            # actual 字典承载表达式解析器提取的引用集合。
            dict_actual = dict_association.get("actual") or {}  # 当前端口连接的 actual 事实

            # 已丰富表达式优先提供完整引用集合。
            list_references = list(dict_actual.get("references", []) or [])  # 当前 actual 的结构化引用

            # AST 初次序列化发生在表达式丰富之前,此时只接受单一标识符 actual。
            if not list_references:

                # text 字段来自实例 association parser,不重新切分任意表达式。
                str_actual_text = str(dict_actual.get("text") or "").strip()  # 当前 actual 原始结构文本

                # 简单标识符可作为唯一引用,复杂表达式继续等待表达式事实丰富。
                if re.fullmatch(r"[A-Za-z_]\w*", str_actual_text):

                    # 单一标识符 actual 的引用集合只有自身。
                    list_references.append(str_actual_text)

            # 一个表达式可以引用多个模块内部信号。
            for str_reference in list_references:

                # 空引用不是可用于区域归属的变量名称。
                if str_reference:

                    # 保存规范字符串,供声明分类器执行精确成员判断。
                    set_names.add(str(str_reference))

    # 返回去重后的实例连接信号集合。
    return set_names

# declaration_region_title 把内部键转换成公开中文标题。
def declaration_region_title(str_region: str) -> str:
    """返回指定声明区域键对应的稳定中文横幅标题。

    参数:
        str_region: `DECLARATION_REGION_TITLES` 中的内部区域键。
    返回:
        区域门禁和 formatter 共同使用的中文标题。
    异常:
        KeyError: 调用方传入未登记区域键时抛出。
    """

    # 精确索引让未知区域键立即失败,禁止静默归入其他信号。
    return DECLARATION_REGION_TITLES[str_region]
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