modelsim更改默认编辑器以及恢复默认编辑器

modelsim自带的编辑器不是很友好,但是可以生成testbench模板,而且调试时也能自动跳转到某一行的错误。有时设置外部编辑器后无法恢复自带编辑器,具体解决方案如下:

1、新装modelsim采用内部编辑器

删除注册表项:

Computer\HKEY_CURRENT_USER\Software\Model Technology Incorporated\ModelSim

并新装好modelsim之后,此时.v文件的默认打开方式保持和windows的设置一样,如果windows里你已经设置过.v文件的默认打开方式,此时需要删掉注册表项:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.v,即可恢复默认编辑器。

2、设置外部编辑器

如何设置外部编辑器呢?首先要在modelsim自带的terminal里输入:

proc external_editor {filename linenumber} {
 exec "D:/Program Files/Notepad++.exe" $linenumber $filename &   # edit as required
}

接着输入:

set PrefSource(altEditor) external_editor

这样即完成了配置外部编辑器 并采用外部编辑器打开source文件,此时在1中提到的modelsim的注册表项中也生成了PrefSource项。

3、恢复内置编辑器

terminal中输入unset PrefSource(altEditor)即可恢复windows默认的编辑器。如果此时在modelsim双击v文件仍然采用外部编辑器打开,参考1中删除windows的默认配置即可。

4、总结

个人认为,默认文件最好采用内部编辑器打开方便bug定位和tb生成,可以同时采用外部编辑器打开,这样需要重复点击reload,但是省去了很多事情。部分参考链接:https://electronics.stackexchange.com/questions/17359/how-to-configure-my-favorite-editor-in-modelsim

2019.3.13

你可能感兴趣的:(windows系统)