sublime text verilog-automatic插件使用方法

    技术2026-03-31  13

    写在前面

    本文是sublime text verilog-automatic插件使用方法,作为本人使用查阅,附赠链接以及插件的github地址,经过不断试错和尝试,结合github上的说明,已经成功试错。后面会更新别的好用的高效开发插件教程。 大佬原文链接 sublime text verilog-automatic插件安装方法自行搜索帖子查看

    Verilog-automatic

    这个插件可以自动将端口添加到当前的编辑文件中,生成模块实例(需要ctags),添加实例连接,添加Verilog代码的文件头。支持verilog-1995和verilog-2001样式。

    Features

    AutoPort AutoInst AutoDef AddFileHeader(这个功能其实自己可根据选择使用,毕竟自己可以做自己喜欢的模板)

    autoport:(shift + f6)

    在 /*autoport*/标记之后,将端口自动添加到当前编辑文件中。

    同一文件中有多个模块时,请勿使用此功能。

    注意:不支持的样式:但是这里的不支持格式貌似已经被插件制作team,修复了

    input clk,output single_out, //multiple input/output/inout keywords in the same line input clk,rst, chip_en; //multiple signals separated by comma written in different lines

    example01(作者给出demo)

    定义前

    (verilog-1995 style): module test(/*autoport*/); input [1:0]a; input b; output [2:0]c,d; inout e; (verilog-2001 style): module test(/*autoport*/); input wire[1:0]a; input wire b; output reg [2:0]c,d; inout wire e;

    定义后:

    module test(/*autoport*/ //inout e, //output c, d, //input a, b);

    example02(自己尝试)

    before:

    module test(/*autoport*/); input [1:0]a,g, f,g; input b; output [2:0]c, d,sdaf; inout e;

    after:

    module test(/*autoport*/ //inout e, //output c, d, sdaf, //input a, g, f, g, b); input [1:0]a,g, f,g; input b; output [2:0]c, d,sdaf; inout e;

    从尝试中我们可以看出来,作者之前的版本应该是经过更新了,他现在应该是不能支持input clk,output single_out, //multiple input/output/inout keywords in the same line这个模式,不过这样写的人应该也很少吧。

    这样编写的话,他只会人第一个看到的关键词,信号错误声明端口。

    module test(/*autoport*/ //inout e, //output c, d, sdaf, //input a, g, f, g, clk, output single_out, b, clk, rst, chip_en); input [1:0]a,g, f,g; input clk,output single_out; input b; output [2:0]c, d,sdaf; inout e; input clk,rst, chip_en; //multiple signals separated by comma written in different lines

    AutoInst:(Shift + F7)

    在/*autoinst*/标记之后自动生成模块实例(需要ctags)。 这里的ctags需要再Shift + ctrl + P,进行package install 然后安装完成ctags后,我们需要找到ctags58.zip,这个我在网上找到了免费资源 免费ctags链接

    打开菜单 在Preferences菜单中打开Package settings->ctags->settings-user和settings-default

    把default中的配置全部复制到user中,然后改一下command配置项,为ctags的可执行文件路径 如图

    路径根据自己解压的路径设置。 修改之前为"command": “”,修改以后为"command": “自己设置的路径下找到exe的路径/ctags58/ctags.exe”。 重启编辑器。

    ***注意:需要将光标放在模块名称上,支持多光标以生成多个实例。***

    example01

    之前:

    test06 test_instance(/*autoinst*/);

    后: 在查找中进行tag重定义,将光标放在模块名称“ test06”上,Shift + F7。

    实例化效果还行,不过就是不能分辨输入和输出端口,应该是把输出放在前面,输入放在了后面。 注意:同个文件夹下面的.v文件如果有中文注释则不能通过这样实例化的方法实例化

    module test06 ( input clk, // Clock input en1, // Clock Enable input rst_n, // Asynchronous reset active low output reg dout ); test06 test_instance(/*autoinst*/ .dout(dout), .clk(clk), .en1(en1), .rst_n(rst_n));

    AutoDef:(Shift + F8)

    在/*autodef*/标记之后自动添加实例连接。这个主要对output 和inout端口进行自动连接。

    例:

    之前:

    /*autodef*/ test test_instance(/*autoinst*/ .e(e), .c(c), .d(d[2:0]), .a(a[1:0]), .b(b));

    后:

    /*autodef*/ wire e; wire [2:0]d; wire c; wire b; wire [1:0]a; //assign e= //assign d= //assign c= //assign b= //assign a= test test_instance(/*autoinst*/ .e(e), .c(c), .d(d[2:0]), .a(a[1:0]), .b(b));

    AddFileHeader:(Shift + F9)

    将您的个人信息添加到设置文件中(以用户的设置文件为佳),如下所示,或将其中任何一个留为空白:

    { "Author":"AAA", "Company":"AAA", "Email":"ABC.com" }

    因此生成如下文件头:

    //================================================================================================== // Filename : test.v // Created On : 2013-04-01 21:37:31 // Last Modified : // Revision : // Author : AAA // Company : AAA // Email : ABC.com // // Description : // // //==================================================================================================

    reference

    插件链接说明免费ctags链接
    Processed: 0.011, SQL: 9