UltarEdit 支持Verilog的语法高亮和自动缩进

  这些天一直苦于没有一个很好的verilog 编辑工具,最近才看到UltraEdit添加一些文件可以做到,所以就搜了网上一些文章,搞定了。

  其实很简单,安装好UltraEdit后去官网上下载一个文件就ok了,链接如下:http://www.ultraedit.com/files/wf/verilog2001.uew(后来在我的使用过程中发现官网上的这个文件可能用问题,后来在网上搜了一个比较好一点的,贴在下面(见附),里面的设置很全面)我用的是verilog2001,官网上还有一个verilog.uew,不过不知道他们有什么区别。将网页内容全选,拷贝到一个文件里,后缀名改为.uew(如verilog2001.uew)。让后放到C:\Documents and Settings\SUN\Application Data\IDMComp\UltraEdit\wordfiles(注意:这里不是放到ue的安装文件夹中,你可以把C:\Documents and Settings\SUN\Application Data\IDMComp\UltraEdit\wordfiles 这个拷贝到你的地址栏中打开,记得给一下用户名,将SUN改为你自己电脑的用户名),然后就可以了。

  补充:

  在.uew 文件中有一个行显示/L20,这是由于ue默认支持20种语法,这个20可以改,只要你保证他是你目前C:\Documents and Settings\SUN\Application Data\IDMComp\UltraEdit\wordfiles 这个文件夹里面所有的文件的/L*中最大的一个数字即可(我的是/14,因为我其他所有的文件最大的是/13)。

1:加入折叠功能

  由于Verilog HDL的块一般是以begin和end作为开始和结束的标记,其作用相当于C语言的大括号。在wordfile.txt的对应语言中添加进如下代码即可:

  /Open Fold Strings = "begin""case"

  /Close Fold Strings = "end""endcase"

  这里除了begin和end可以进行折叠外,另外一对case和endcase同样可以完成折叠,同样的方法可以添加你需要的折叠标志。

2:加入自动缩进功能

  同样在wordfile.txt中,有控制自动缩进的语法。所谓自动缩进就是指,输入begin回车,下一行自动加一个tab;输入end,下一行自动退回一个tab。用户可以自己添加不同的缩进词实现自动缩进。如:

  /Indent Strings = "begin""case""fork" "if" "else"

  /Unindent Strings = "end""endcase""join" "else"

3: 还可以加入其它一些自定义功能,如函数调用功能,大家可以自己摸索。

附:(原文地址:http://hi.baidu.com/rabbitfff/blog/item/d78e0fad1601f1004a36d617.html

/L14"Verilog 1364-2001" Line Comment = // Block Comment On = /* Block Comment Off = */ Block Comment On Alt = (* Block Comment Off Alt = *) String Chars = " File Extensions = V VL VMD
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"<> ,    
/Function String = "%[ ^t]++^(config[ ^t^p]+[a-zA-Z0-9_]+^)"
/Function String 1 = "%[ ^t]++^(module[ ^t^p]+[a-zA-Z0-9_]+^)[ ^t^p]++[(;#]"
/Function String 2 = "%[ ^t]++^(task[ ^t^p]+[~(;]+^)[ ^t^p]++[(;#]"
/Function String 3 = "%[ ^t]++^(function[ ^t^p]+[~(;]+^)[ ^t^p]++[(;#]"
/Function String 4 = "%[ ^t]++^(primitive[ ^t^p]+[~(;]+^)[ ^t^p]++[(;#]"
/Function String 5 = "begin[ ^t^p]++^(:[ ^t^p]++[a-zA-Z0-9_]+^)"
/Indent Strings = "begin" "case" "fork" "specify" "table" "config"
/Unindent Strings = "end" "endcase" "join" "endspecify" "endtable" "endconfig"
/Open Fold Strings = "module" "task" "function" "generate" "primitive" "begin" "case" "fork" "specify" "table" "config" "`ifdef"
/Close Fold Strings = "endmodule" "endtask" "endfunction" "endgenerate" "endprimitive" "end" "endcase" "join" "endspecify" "endtable" "endconfig" "`endif"

/C1"Keywords"
always and assign automatic
begin buf bufif0 bufif1
case casex casez cell cmos config
deassign default defparam design disable
edge else end endcase endconfig endmodule endfunction endgenerate endprimitive endspecify endtable endtask event
for force forever fork function
generate genvar
highz0 highz1
if ifnone initial inout input instance integer
join
large liblist library localparam
macromodule medium module
nand negedge nmos none nor noshowcancelled not notif0 notif1
or output
parameter pulsestyle_onevent pulsestyle_ondetect pmos posedge primitive pull0 pull1 pullup pulldown
real realtime reg release repeat rcmos rnmos rpmos rtran rtranif0 rtanif1
scalared showcancelled signed small specify specparam strength strong0 strong1 supply0 supply1
table task time tran tranif0 tranif1 tri tri1 tri0 triand trior trireg
use
vectored
wait wand weak0 weak1 while wire wor
xnor xor

/C2"System"
** .
** 'b 'B 'o 'O 'd 'D 'h 'H 'sb 'sB 'so 'sO 'sd 'sD 'sh 'sH 'Sb 'SB 'So 'SO 'Sd 'SD 'Sh 'SH
** $
$async$and$array $async$and$plane $async$nand$array $async$nand$plane $async$nor$array $async$nor$plane $async$or$array $async$or$plane
$bitstoreal
$countdrivers
$display $displayb $displayh $displayo
$dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform
$dumpall $dumpfile $dumpflush $dumplimit $dumpoff $dumpon $dumpportsall $dumpportsflush $dumpportslimit $dumpportsoff $dumpportson $dumpvars
$fclose $fdisplayh $fdisplay $fdisplayf $fdisplayb $ferror $fflush $fgetc $fgets $finish $fmonitorb $fmonitor $fmonitorf $fmonitorh $fopen $fread $fscanf $fseek $fsscanf $fstrobe $fstrobebb $fstrobef $fstrobeh $ftel $fullskew $fwriteb $fwritef $fwriteh $fwrite
$getpattern
$history $hold
$incsave $input $itor
$key
$list $log
$monitorb $monitorh $monitoroff $monitoron $monitor $monitoro
$nochange $nokey $nolog
$period $printtimescale
$q_add $q_exam $q_full $q_initialize $q_remove
$random $readmemb $readmemh $realtime $realtobits $recovery $recrem $removal $reset_count $reset $reset_value $restart $rewind $rtoi
$save $scale $scope $sdf_annotate $setup $setuphold $sformat $showscopes $showvariables $showvars $signed $skew $sreadmemb $sreadmemh $stime $stop $strobeb $strobe $strobeh $strobeo $swriteb $swriteh $swriteo $swrite $sync$and$array $sync$and$plane $sync$nand$array $sync$nand$plane $sync$nor$array $sync$nor$plane $sync$or$array $sync$or$plane
$test$plusargs $time $timeformat $timeskew
$ungetc $unsigned
$value$plusargs
$width $writeb $writeh $write $writeo

/C3"Operators"
!
%
&
*
+
,
-
// /
:
;
<
=
>
?
@
^
{
|
}
~

/C4"Directives"
** `
`accelerate `autoexepand_vectornets
`celldefine
`default_nettype `define `default_decay_time `default_trireg_strength `delay_mode_distributed `delay_mode_path `delay_mode_unit `delay_mode_zero
`else `elsif `endcelldefine `endif `endprotect `endprotected `expand_vectornets
`file
`ifdef `ifndef `include
`line
`noaccelerate `noexpand_vectornets `noremove_gatenames `noremove_netnames `nounconnected_drive
`protect `protected
`remove_gatenames `remove_netnames `resetall
`timescale
`unconnected_drive `undef `uselib

/C5"DelaysParametersEscaped"
#
** \

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
vim是一款强大的文本编辑器,支持丰富的语法高亮功能。在使用vim编辑器进行Verilog代码编写时,可以通过一些设置实现Verilog语法高亮显示。 首先,确保在vim中已经安装了verilog插件。可以通过vim插件管理器(如Vundle或者Pathogen)进行安装,或者手动将相关插件文件放置在vim的插件目录中。 安装完verilog插件后,需要设置vim的配置文件以启用语法高亮功能。找到并打开vim配置文件(通常是~/.vimrc),添加如下内容: ```vim syntax enable " 启用语法高亮 filetype plugin indent on " 启用自动识别文件类型和缩进功能 ``` 保存并退出配置文件。 之后,在vim中打开一个Verilog文件,就可以看到代码根据语法高亮显示了。不同的代码元素,如关键字、变量、数字、注释等,会以不同的颜色突出显示,以帮助编程者更容易地阅读和调整代码。 此外,还可以根据个人的喜好和需求,自定义vim的Verilog语法高亮的颜色。在vim配置文件中,找到或添加如下内容: ```vim highlight VerilogKeyword ctermfg=green " 定义关键字颜色为绿色 highlight VerilogIdentifier ctermfg=blue " 定义变量标识符颜色为蓝色 ``` 以上是一个简单的设置示例,可以根据自己的需求进行进一步的颜色定义和个性化设置。 通过以上步骤,就可以在vim中实现Verilog语法高亮显示,提高代码编写的效率和准确性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值