一个支持Verilog的Vim插件——AutoArg

本文介绍了如何在gVim环境中使用Verilog插件实现代码自动生成与管理,包括模块定义、端口自动识别与添加、端口列表的增删操作等关键步骤,为Verilog开发者提供了高效编程的实用技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

gvim中verilog 插件的使用方法:

例如:

module example(/ *autoarg* /);

// comment
input in_0;//comment
input [PAR0-1:0] in_bus0; //comment
input [3:0] in_bus1; //comment
input in_1;//comment
input [PAR1-1:0] in_bus2; //comment
input in_0_n;//comment
input in_1_p;//comment

input example_clk;// clock
input example_rst_n;// reset
// comment
output [PAR0-1:0] out_bus0;
output [PAR1-1:0] out_bus1;
output out_0;
output out_1;
output out_0_n;
output out_0_p;
output [31:0] out_bus2;
output [15:0] out_bus3;
output [7:0] out_bus4;

点击Verilog->AutoArgument之后,原代码变为:

module example(/ * autoarg * /
//Inputs
in_0, in_bus0, in_bus1, in_1, in_bus2, in_0_n, in_1_p, example_clk, example_rst_n,
//Outputs
out_bus0, out_bus1, out_0, out_1, out_0_n, out_0_p, out_bus2, out_bus3, out_bus4);

// comment
input in_0;//comment
input [PAR0-1:0] in_bus0; //comment
input [3:0] in_bus1; //comment
input in_1;//comment
input [PAR1-1:0] in_bus2; //comment
input in_0_n;//comment
input in_1_p;//comment

input example_clk;// clock
input example_rst_n;// reset
// comment
output [PAR0-1:0] out_bus0;
output [PAR1-1:0] out_bus1;
output out_0;
output out_1;
output out_0_n;
output out_0_p;
output [31:0] out_bus2;
output [15:0] out_bus3;
output [7:0] out_bus4;

可以用Verilog->KillAutoArg来清除所添加的端口列表。如果端口有改动,只需要再次调用AutoArgument即可,而不需要事先清除。

小提示:不要试图修改Vim自动添加的注释,Kill操作可能需要这些注释来完成操作!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值