Skip to content
Back to skills

Readable Verilog Format

ASecurity

Use when previewing a formatting diff or applying the project's deterministic layout to a Verilog file, including post-generation and post-edit formatting.

  • 346 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsshell

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add Eriemon/verilog-generator --skill readable-verilog-format --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Readable Verilog Format?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Readable Verilog Format
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/eriemon-readable-verilog-format/badge)](https://www.skillsdirectory.com/skills/eriemon-readable-verilog-format)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: readable-verilog-format
description: Use when previewing a formatting diff or applying the project's deterministic layout to a Verilog file, including post-generation and post-edit formatting.
---

# 脚本排版

## 预览与写回

1. 确认源码编码。工具读取 UTF-8(可带 BOM);GBK/GB18030 先在临时 UTF-8 副本预览,避免损失字符。
2. 使用工程规格时传 `--spec`,让区域标题遵从 `comment_language`。先看 diff,确认候选保持作者结构后再写回。

```powershell
& $py -m verilog_generator format $rtl --spec $spec
& $py -m verilog_generator format $rtl --spec $spec --write
& $py -m verilog_generator format $rtl --spec $spec --check-regions
```

3. `--check-regions` 返回原件行号与规则。`--regions-only` 只预览区域注释,配 `--write` 可写回。`region.owner` 或 `region.order` 有疑义时,将原行号和 diff 交[审查](../readable-verilog-review/SKILL.md)核对实体与依赖,再决定改标题还是调整位置。[版式与功能分区](../readable-verilog-generate/references/interface-standard.md)

## 核对候选

- **版式**:检查 Tab 缩进、空格、空行、括号、`begin/end`、`always@(…)begin`、`end else begin`、case 和 packed range。普通表达式约 100 列在支持的运算符处折行;长标识符可超宽。清行尾空白,保留末尾换行。
- **模块与接口**:逐模块英中头紧贴对应声明上方,保留版权、依赖、修订和原 timescale;新文件用已确认的时间单位。缺头只生成字段骨架,功能、译文和历史由作者补实。按接口/通道分组,具名参数与端口映射逐行可读。`begin:gen_*` 标签、作用域、属性、公开端口/参数、位置绑定和求值顺序保持原义。
- **区域与注释**:非空区域标题以 46 个显示列居中,两端至少两根横线,奇数左多一根;长标题保留全文。首组说明紧接标题并贴近首个实体,后续组间空一行。前导注释与过程、case item 或实例同缩进,尾注释组内对齐,长句可右移。
- **语义边界**:可将 `reg [7:0] a, b;` 分为两个同宽声明,保留驱动过程和声明初值。保全工具指令、include、块注释、宏续行和层次名;宏说明放在定义上方,无法独立解析的条件段可保留原样。纯排版保持名称。

预览退出 0 也可能有 diff。写回前重新解析候选并检查二次排版稳定性。写回后再预览核对剩余差异;完整设计将最终源清单交[审查](../readable-verilog-review/SKILL.md),单次排版交付 diff 即可。出现标题叠加、短头被覆盖、映射被压缩或块标签被拆开时保留原版;解析、等价性、稳定性或并发写入检查失败时报告原因。

Files in this skill

  • SKILL.md2.7 KB
  • scripts/formatting/regions.py11.5 KB
  • scripts/formatting/render.py14 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.