Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Project setup

There are several use cases of fromco executable. It can be used either as LSP server or CLI utility for linting, and documentation extraction.

Lsp setup

Create a configuration file .fromco.cfg at project root directory. With such content:

{
    "top_module"     	  : "top",
    "file_list"      	  : "filelist.f",
    "exclude_globs"  	  : ["glob1", "glob2", "..."],
    "waveform_top_prefix" : "tb.i_dut",
    "waveform_top"        : "dut",
    "wcp_port"            : 6138
}

It might be obtained by fromco --lsp-init command.

If you have dependencies e.g. UVM, just create a separate filelist for UVM and add it to root file list.

For example uvm_1_2.f:

+incdir+/path_to_uvm/UVM/1.2/
/path_to_uvm/UVM/1.2/uvm_pkg.sv

If your filelist has dependency from environment variable, you can add it to IDE env variables or you can define it via in .env file. They will be visible only for LSP and substituted into described filelists. So, fromco-lsp is just a simple wrapper:

#!/bin/bash
FROMCO_ROOT="$(pwd)"
if [ -f "$FROMCO_ROOT/.env" ]; then
    export $(grep -v '^#' "$FROMCO_ROOT/.env" | xargs)
fi
exec fromco --lsp

It is also possible to use fromco-lsp without filelist. In that case, preprocessor dependencies will not be resolved across files.

IDE setup

The default distribution contains pre-defined configs for number of a common text editors. Feel free to modify and reuse it.

Visual Studio Code

The default distribution contains an extension for vscode (see fromco*.vsix). It provides key LSP protocol functionality (see LSP features), additional functionality (e.g. goto drivers, preprocessor highlights), and Schematic Viewer.

Extension can be installed via Extensions -> Install from VSIX. It requires a proper path to fromco-lsp executable, which can be provided via vscode settings.

Nvim

It contains a predefined config for lazyVim (see folder fromco.nvim), which allows to use some specific functionality, e.g. waveforms, preprocessor's fadings.

Config file fromco.lua can be installed manually or copied with install.sh. It contains some settings for a fromco.nvim.

There are only required to specify: dir and cmd.

return {
  -- Provide a path to fromco.nvim
  dir = "/path-to/fromco.nvim",
  dependencies = { "neovim/nvim-lspconfig" },
  ft = { "verilog", "systemverilog" },
  opts = {
    -- Provide a path to fromco-lsp if it is not copied to PATH locations
    cmd = { "fromco-lsp" },
    lsp_log_level = "OFF",
    -- Change here for faster feedback
    defer_ms = 200,
  },
}

CLI mode

Every diagnostic provided by language server, might be also emitted by the tool in CLI mode.

To get more info, please use:

$ fromco -h