con un clic
tb-creator
创建 SystemVerilog 测试平台文件。触发词包括:创建TB、写testbench、新建测试平台、生成TB、写TB、创建仿真测试文件
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
创建 SystemVerilog 测试平台文件。触发词包括:创建TB、写testbench、新建测试平台、生成TB、写TB、创建仿真测试文件
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
新建 Verilog 仿真项目,搭建环境。触发词包括:新建项目、建立Verilog环境、初始化工程、搭建仿真环境、新建Verilog工程
编写和审查可综合的 Verilog RTL 代码。当用户要求编写、设计、实现、修复或审查任何 Verilog/RTL 模块、 硬件模块或数字逻辑时自动触发。触发词包括:写Verilog、写RTL、实现模块、设计电路、review代码、 审查Verilog、FSM、状态机、FIFO、pipeline、流水线、arbiter、仲裁器、counter、计数器、 shift register、移位寄存器、handshake、握手协议、AXI、APB、SPI、I2C、UART、 clock divider、分频器、debounce、去抖、edge detector、边沿检测、synchronizer、同步器、 dual-port RAM、双端口RAM。即使用户只说"写一个模块"或"实现这个功能"而没有显式提到"Verilog", 也应使用此 skill。涵盖新代码生成和已有 Verilog 代码的 review/debug。
Basado en la clasificación ocupacional SOC
| name | tb-creator |
| description | 创建 SystemVerilog 测试平台文件。触发词包括:创建TB、写testbench、新建测试平台、生成TB、写TB、创建仿真测试文件 |
在 TB/ 目录下创建 TB/tb_top.sv,直接使用模板,不询问任何参数。
// DUMP_ARRAY macro: per-element dumpvars for unpacked arrays
// gen_dumpvars.py --patch will auto-generate calls and insert them into the dump initial block below
`define DUMP_ARRAY(path, size) \
begin \
for (int _di = 0; _di < size; _di++) \
$dumpvars(0, path[_di]); \
end
`timescale 1ns/1ps
module tb_top;
// ── Parameters ────────────────────────────────────────────────────────
localparam CLK_PERIOD = 10; // clock period (ns), 100 MHz
localparam SIM_TIMEOUT = 10000; // simulation timeout (ns)
localparam RST_CYCLES = 4; // reset duration in cycles
// ── Clock & reset ─────────────────────────────────────────────────────
reg clk = 0;
reg rst_n;
always #(CLK_PERIOD/2) clk = ~clk;
initial begin
rst_n = 0;
repeat(RST_CYCLES) @(posedge clk);
rst_n = 1;
end
// ── DUT instantiation (replace <dut_module> and port connections) ─────
// <dut_module> u_dut (
// .clk (clk ),
// .rst_n (rst_n)
// );
// ── Waveform dump (gen_dumpvars.py --patch will update this block) ────
initial begin
$dumpfile("wave.fst");
$dumpvars(0, tb_top);
end
// ── Simulation timeout ────────────────────────────────────────────────
initial begin
#SIM_TIMEOUT;
$display("[TIMEOUT] simulation exceeded %0d ns", SIM_TIMEOUT);
$finish;
end
endmodule
TB/tb_top.svTB/tb_top.sv,提示下一步填写 DUT 实例化部分