【问题标题】:Verilog Build System for Sublime Text 3Sublime Text 3 的 Verilog 构建系统
【发布时间】:2016-03-12 21:10:35
【问题描述】:

我正在尝试在 Sublime Text 中为 Verilog 实现一个简单的构建系统,但是在构建时出现以下错误:

[Errno 2] No such file or directory: 'iverilog'
[cmd: ['iverilog', '-o', 'iverilog/compiled', '/Users/ryanbeltran/Documents/Programming/Verilog/testing/test.v']]
[dir: /Users/ryanbeltran/Documents/Programming/Verilog/testing]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

我的构建系统应该使用 Icarus Verilog 编译器,其命令是:

iverilog -o outputfile inputfile.v

当我从 shell 运行该命令时,我没有任何问题,它完全按照我的意图运行。

我的Verilog.sublime-build 构建系统使用以下 JSON:

{
    "cmd": ["iverilog", "-o", "iverilog/compiled", "$file"],
    "selector": "source.v"
} 

如果有人能告诉我我在这里可能做错了什么,我将不胜感激。如果有什么不同,我是在 OS X 上运行,并使用 Sublime Text 3。

【问题讨论】:

    标签: sublimetext3 verilog build-system icarus


    【解决方案1】:

    经过更多的实验,我最终弄清楚了这一点。原来我需要的是

    {
        "shell":true,
    
        "cmd": [ "mkdir -pv $file_path/iverilog_compiled && touch $file_path/iverilog_compiled/$file_base_name && /usr/local/bin/iverilog -o $file_path/iverilog_compiled/$file_base_name $file && /usr/local/bin/vvp $file_path/iverilog_compiled/$file_base_name"],
    
        "selector": "source.v"
    }
    

    好吧,它也运行它,因此更简单的方法可以省略最终的&& /usr/local/bin/vvp $file_path/iverilog_compiled/$file_base_name,但这不是重点。

    这里的要点是,即使 shell 设置为 true,cmd 命令也不会在可以访问用户路径变量的完整 shell 环境中运行,因此很多内置程序,尤其是安装的程序如果没有直接来源,您可以直接从 shell 调用将无法在其中工作。

    如果将来有人在构建时遇到类似错误,我的建议是使用:

    which command_name
    

    找到你的命令所在的位置,然后包含你的整个路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-21
      • 2015-03-01
      • 2013-10-14
      • 2018-04-27
      • 2015-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多