readable-verilog-fsm

readable-verilog-fsm is a skill for Claude Code, Codex from Eriemon/verilog-generator. It costs 35 tokens per session (1,047 once invoked), scanned A, original, Apache-2.0.

A guide for designing and reviewing finite-state machines in Verilog. A finite-state machine is logic that moves between named states according to inputs, such as idle, running, and complete.

In plain words
What is it for?
Use it to write transition tables, generate or edit FSM RTL, review reset behavior, define illegal-state recovery, and check cycle-visible outputs such as start and done signals.
Why use it?
It makes state transitions, output timing, priority rules, and recovery from invalid state codes explicit. This helps prevent unintended loops, missed events, and outputs appearing on the wrong clock cycle.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write transition tables, generate or edit FSM RTL, review reset behavior, define illegal-state recovery, and check cycle-visible outputs such as start and done signals.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eriemon/verilog-generator/readable-verilog-fsm
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Eriemon/verilog-generator --skill readable-verilog-fsm
Clone the repo
git clone --depth 1 https://github.com/Eriemon/verilog-generator

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for readable-verilog-fsm

README.md
[![agentmods](https://agentmods.dev/badge/skills/eriemon/verilog-generator/readable-verilog-fsm/github.svg)](https://agentmods.dev/skills/eriemon/verilog-generator/readable-verilog-fsm)
Your own site
<a href="https://agentmods.dev/skills/eriemon/verilog-generator/readable-verilog-fsm"><img src="https://agentmods.dev/badge/skills/eriemon/verilog-generator/readable-verilog-fsm/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for readable-verilog-fsm

Your own site · 80×15
<a href="https://agentmods.dev/skills/eriemon/verilog-generator/readable-verilog-fsm"><img src="https://agentmods.dev/badge/skills/eriemon/verilog-generator/readable-verilog-fsm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.01047
Opus 5.5 $0.00014 $0.00419
Sonnet 5.5 $0.00007 $0.00209
Haiku 4.5 $0.00003 $0.00105

Measured yesterday against content hash 6ce4483e284c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

readable-verilog-fsm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/readable-verilog-fsm/SKILL.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

状态机

规格与模型。 从复位状态开始列转移表。每行写明当前状态、按优先级排列的条件、次态、输出动作和观察拍。分别写出等待、自环、竞争条件及非法编码的恢复目标。区分进入某状态的边沿和该状态首次被时序输出采样的边沿。

生成与编辑。 使用同宽的 state_current、state_next 和显式定宽的 localparam ST_*。按 v2.0.0 的三段式规则分工。

职责 实现
次态判定 独立 always @(*) 先写 state_next = state_current;,再用 case (state_current) 译码。只用阻塞赋值写次态。每个状态及 default 上方写一行说明,每条转移优先链用最终 else 写清保持或去向。default 恢复到规格指定的已声明合法状态。
状态寄存 时序块只写 state_current。按约定的复位方式用 <= 载入初态,在更新沿用 state_current <= state_next;。
状态动作与输出 独立实现输出译码或时序动作。每个时序块按always 块确定写入目标。按转移表区分当前状态、输入事件和已登记的输出,保持接口延迟。

标准示例:启动与完成

空闲时采样 i_start 启动事务,运行时采样 i_finish 完成事务。完成沿同时回到空闲并置位 o_done,下一上升沿清零。两个输入同时为高时,由沿前状态决定执行哪个动作。同步高有效复位优先。

module transaction_fsm (
	input  wire i_clk,
	input  wire i_rst,
	input  wire i_start,
	input  wire i_finish,
	output reg  o_done
);
	localparam [1:0] ST_IDLE = 2'b01;
	localparam [1:0] ST_RUN  = 2'b10;
	reg [1:0] state_current;
	reg [1:0] state_next;

	// 次态判定:每个状态只处理本阶段允许的事件。
	always@(*)begin
		state_next = state_current;
		case(state_current)
			// 空闲时等待启动。
			ST_IDLE:begin
				if(i_start)state_next = ST_RUN;
				else state_next = ST_IDLE;
			end
			// 运行时等待完成。
			ST_RUN:begin
				if(i_finish)state_next = ST_IDLE;
				else state_next = ST_RUN;
			end
			// 非法编码在下一上升沿回到空闲。
			default:state_next = ST_IDLE;
		endcase
	end

	// 状态寄存:同步复位优先于正常转移。
	always@(posedge i_clk)begin
		if(i_rst)state_current <= ST_IDLE;
		else state_current <= state_next;
	end

	// 完成脉冲由沿前的运行状态和完成输入共同决定。
	always@(posedge i_clk)begin
		if(i_rst)o_done <= 1'b0;
		else o_done <= (state_current == ST_RUN) && i_finish;
	end
endmodule

审查与验收。 从复位入口遍历转移表,逐项核对可达性、退出条件及有意保持的终态。沿实际转移边核对编码翻转。v2.0.0 的检查口径为单个 FSM 最多 40 个状态,one-hot 每条边至多翻转两位,其他编码以一位为目标;与既定编码冲突时记录具体边和原因。已有 RTL 保留外部依赖的名称、编码和时序,重构前记录对拍基线。

运行 python -m verilog_generator review <RTL文件> 获取可定位的候选。脚本核对可识别的过程分工、次态赋值及默认恢复;可达性、优先级和输出拍序仍按表核对。将复位、各转移、同时满足两个条件及非法恢复的预期拍交给验证。未覆盖的状态或边在交付时列出。

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 71 lines · 35 tokens per session scan A 6ce4483e284c

Subscribe to this mod's changes

readable-verilog-fsm is a skill published in the GitHub repository Eriemon/verilog-generator (350 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 1,047 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-03.

Related

readable-verilog-fsm compared with skills from other repositories

readable-verilog-fsm next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
readable-verilog-fsmEriemon/verilog-generatorSkill350todayApache-2.0A35Claude Code, Codex
readable-hls-generatorEriemon/hls-generatorSkill353mo agononeA40Codex
vivado-cdc-auditmapleleavessssssss-wq/vivado-mcpSkill1811mo agoApache-2.0A58Claude Code, Codex
vivado-timing-closuremapleleavessssssss-wq/vivado-mcpSkill1811mo agoApache-2.0A56Claude Code, Codex
vivado-waveform-debugmapleleavessssssss-wq/vivado-mcpSkill1811mo agoApache-2.0A62Claude Code, Codex
fpga-hardware-design-and-review-guidecobbpeng/fpga-hardware-design-and-review-guideSkill2110mo agoMITA99Claude Code
vdebugphamcuong21478/rtl-skillsSkill285mo agoApache-2.0C27Claude Code