QMSV

The idea of QMSV is to make Intel/Altera FPGA development outside of the Quartus/ModelSim GUIs somewhat easier, hopefully, while making some improvements. It uses Sublime Text 3 with the Sublime System Verilog package to improve the actual HDL writing experience. Quartus is used for all the typical stuff and ModelSim for linting. VUnit is used as a unit testing framework, in this case for ModelSim which runs any tests or simulations.

QMSV contains build systems with syntax highlighting and in-line errors for Quartus, ModelSim, and VUnit. As well as a snippet for a python script that is used for generating and updating Quartus project files, it also creates the basic folder structure, a VUnit python script, a Sublime Text project file, and a .gitignore file. There is an included snippet to create GPL v3 headers in your SystemVerilog or Verilog files. Also included is an extended Monokai color scheme to support additional scopes in the SystemVerilog package.

A Sublime Text package is basically a set of YAML and JSON files that define how to call and process the output of external programs while being able to reference the context of whatever file/project you have open in Sublime Text. Some examples:

ModelsimVlog.sublime-build

{
        "shell_cmd": "%QUARTUS_ROOTDIR%\\modelsim_ase\\win32aloem\\vlog.exe -lint -sv \"$file\"",
        "working_dir": "$folder",
        "file_regex": "^\\*\\* (?:\\w[^\\n]+) ((?:\\w\\:)+?[^\\n]+)\\((\\d+)\\)\\: ()([^\\n]+)$",
        "syntax": "ModelsimVlog.sublime-syntax",
        "file_patterns": ["*.sv", "*.v", "*.verilog", "*.vhd", "*.vhdl"],
        "selector": "source.SystemVerilog",
    }

ModelsimVlog.sublime-syntax

%YAML 1.2
    ---
    name: ModelsimVlog Build Syntax
    file-extensions: 
    
    scope: ModelsimVlog.build
    
    contexts: 
      main:
        - match: '(Error).*'
          scope: message.error
        - match: '(Warning).*'
          scope: keyword

Part of a snippet that creates a python script:

sublime_project_template = (
    "{",
        "\t\"folders\":",
        "\t[",
            "\t\t{",
                "\t\t\t\"path\": \".\"",
            "\t\t}",
        "\t],",
        "",
        "\t\"build_systems\":",
        "\t[",
            "\t\t{",
                "",
            "\t\t}",
        "\t],",
        "\t\"settings\":",
            "\t\t{",
                "",
            "\t\t},",
    "}",
    )

When working on QMSV I spent most of the time dealing with regex’s and escape characters. Having to deal with escape characters and proper usage of quotes and paths for within Sublime Text, when it calls external programs, and when generating python was a bit annoying. The rest of it was just figuring out commands and looking through what the various programs output in terms of files and logs.

Plans

Now that I for the most part use VSCode I need to convert everything to work as a VSCode extension which are typically written in Typescript.

Phabricator

GitHub