← スキル一覧に戻る

writing-module
by pbozeman
⭐ 0🍴 0📅 2026年1月19日
SKILL.md
name: writing-module description: Provides module template with include guard, port ordering, and checklist. Triggers when creating a new svc_ module from scratch.
Writing a New Module
Module Template
`ifndef SVC_MODULE_NAME_SV
`define SVC_MODULE_NAME_SV
`include "svc.sv"
module svc_module_name #(
parameter WIDTH = 32
) (
input logic clk,
input logic rst_n,
input logic in_valid,
input logic [WIDTH-1:0] in_data,
output logic in_ready,
output logic out_valid,
output logic [WIDTH-1:0] out_data,
input logic out_ready
);
//
// Localparams
//
//
// Internal signals
//
logic [WIDTH-1:0] data_next;
//
// Child module instantiations
//
//
// Combinational logic
//
always_comb begin
data_next = in_data;
end
//
// Sequential logic
//
always_ff @(posedge clk) begin
if (!rst_n) begin
out_valid <= 1'b0;
out_data <= '0;
end else begin
// Logic here
end
end
endmodule
`endif
Checklist
- Include guard with
_SVsuffix (uppercase module name) -
include "svc.sv"after guard - Module name has
svc_prefix - Ports:
clk,rst_nfirst - Parameters before ports
- Group related ports with blank lines
- Align port declarations
- Comments above code, never at end of line
- Use blank comment blocks for section separators
- Run
make formatwhen done - Run
make lintbefore committing
File Location
Place in appropriate rtl/ subdirectory:
rtl/axi/- AXI/AXI-Litertl/cdc/- Clock domain crossingrtl/common/- Fundamental building blocksrtl/fifo/- FIFOsrtl/gfx/- Graphics/VGArtl/ice40/- iCE40 FPGA-specificrtl/rv/- RISC-V processorrtl/stats/- Statistics collectionrtl/uart/- Serial communication
Reference Implementation
See rtl/common/svc_arbiter.sv for a well-structured example.
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です