# parseverilog (SystemVerilog)

> IEEE LRM-compliant SystemVerilog parser with Java, Python, Tcl APIs

- Catalog id: `ParseverilogSystemverilog`; bundle: `parseverilog`; latest version 20261018
- Documentation page: https://edautils.com/VlogRTLParser.html
- Keywords: SystemVerilog parser, Verilog parser, IEEE 1800, Java API, Python API, Tcl API, RTL parser
- Terms: as stated on edautils.com, EDAUtils tools are free for commercial and academic use, with no license server. The bundle's own metadata says: "Free to evaluate with the bundled licence; commercial licences from help@edautils.com". Licence prerequisites per tool are under "How an agent runs it".
- This file: https://edautils.com/capabilities/parseverilog.md

## Downloads

- EDAUtils download site: https://edautils.ai/download/ParseverilogSystemverilog (latest file `parseverilog-20261018.tar.gz`)
- SourceForge: https://sourceforge.net/projects/system-verilog-parser/files/parseverilog/
- GitHub Releases: https://github.com/edautils/releases/releases/download/RELEASE_20261018/parseverilog-20261018.tar.gz (release `RELEASE_20261018`; all releases: https://github.com/edautils/releases/releases)

## How an agent runs it

The following is the AGENTS.md shipped at the root of the bundle.

The Verilog/SystemVerilog parser bundle. Its main job is to be a Java API (javadoc in `doc/html`), and it
also ships four command-line launchers. `parseverilog` reads RTL, elaborates it and writes it back
as one equivalent Verilog file (default `parseverilog.out.v`). `preprocessverilog` expands
directives (and pragma-protect envelopes). `anvl` analyses into a disk work library; its partner
`elabvl` (elaborate, optionally with a UPF bound onto the result) is documented here but ships only in
the designplayer-shell, baya-shell and ipxact-shell bundles (main class
`com.eu.miscedautils.shell.elabvl`, in `lib/designplayer.jar`/`lib/baya.jar`), because binding UPF
needs the UPF backbone those bundles carry. `genemptymoduleandcsv` writes an empty (port-only) module and a
port/parameter CSV for one module. The bundle ships only `lib/verilogparser.jar`, and every main
class listed below is inside it.

| Launcher | Main class (Unix launcher, last `MAIN=`) | Launcher CLASSPATH | Tool prefix / log |
|---|---|---|---|
| `parseverilog` | `com.eu.miscedautils.verilogparser.TraverseRTLAndPrintBack` | `lib/verilogparser.jar` | `ParseVerilog` / `ParseVerilog.log` |
| `preprocessverilog` | `com.eu.miscedautils.verilogparser.PreProcessVerilog` | `lib/verilogparser.jar` | `PreProcessVerilog` / `PreProcessVerilog.log` |
| `anvl` | `com.eu.miscedautils.verilogparser.anvl` | `lib/designplayer.jar` (not shipped, see below) | `anvl` / `anvl.log` |
| `genemptymoduleandcsv` | `com.eu.miscedautils.verilogparser.GenEmptyModuleAndIntegrationCSV` | `lib/designplayer.jar` (not shipped) | `genemptymoduleandcsv` / `genemptymoduleandcsv.log` |

**Known launcher defect:** `bin/anvl` and `bin/genemptymoduleandcsv` set
`CLASSPATH=$EDAUTILS_ROOT/lib/designplayer.jar`, but this bundle only ships `verilogparser.jar`
(`bundle_jar_files.csh`: `parseverilog` -> `verilogparser.jar`). Unless that is fixed, these launchers
fail to find their main class. The classes are in `verilogparser.jar`, so they can be run with
`java -cp $EDAUTILS_ROOT/lib/verilogparser.jar <main class> ...`. The `.bat` launchers set no
CLASSPATH and rely on `setup_env.bat`, which sets `CLASSPATH=%EDAUTILS_ROOT%\lib\verilogparser.jar`.

### Where it ships

Its own bundle, `parseverilog.tar.gz` (flow `parseverilog`; release tree
`release_scripts/parseverilog/1.0`), and as a point tool in the **ipxact-shell**, **baya-shell**
and **designplayer-shell** bundles (`bin/anvl`, `bin/genemptymoduleandcsv`, `bin/parseverilog`,
`bin/preprocessverilog` running the shell's jar; this guide as `tools/parseverilog/AGENTS.md`,
examples under `tools/parseverilog/examples/`).

### Prerequisites

- Java on `PATH` (the launcher runs plain `java`). Use Java 11 or newer (Java 21 recommended: the
  release is built and regression-tested with OpenJDK 21); the bundled JAXB and Eclipse libraries
  are class-file version 55, so a Java 8 runtime fails with `UnsupportedClassVersionError`. The
  shipped API example also needs `javac` (a JDK).
- `EDAUTILS_ROOT` = the unpacked bundle directory (must contain `bin/` and `lib/`). The
  launcher exits 1 with "Environment variable EDAUTILS_ROOT is not set" otherwise.
  `source setup_env.sh` (or `setup_env.csh`) from the bundle root sets `EDAUTILS_ROOT`,
  `EDAUTILS_LICENSE_FILE=$EDAUTILS_ROOT/edautils.lic`, prepends `bin/` to `PATH` and sets
  `CLASSPATH=$EDAUTILS_ROOT/lib/verilogparser.jar`.
- Licence: `parseverilog`, `anvl`, `elabvl`, `genemptymoduleandcsv` need feature `VERILOG_PARSER`.
  `preprocessverilog` checks only for a valid licence file and has no feature check. The licence file is searched in this order:
  `$EDAUTILS_LICENSE_FILE`, `./edautils.lic` (run directory), `$HOME/edautils.lic`,
  `$EDAUTILS_ROOT/edautils.lic`. No valid licence or feature: exit status 10.
- Optional environment: `JAVA_FLAGS` (passed to the JVM, e.g. `-Xmx8g`; with no heap option in it the launcher adds `-Xmx` sized to the machine (`bin/eu_heap.sh`: the largest of 64/32/16/12/8/4 GB within 3/4 of physical or cgroup memory, else 2 GB; `EDAUTILS_MAX_HEAP_GB` caps it)),
  `EDAUTILS_LOG_FILE` / `EDAUTILS_APPEND_LOG_FILE` (log file name; the second appends),
  `EDAUTILS_DISABLE_USAGE_TRACKING=true`, `EDAUTILS_PRINT_STACK_TRACE` (stack traces on
  internal exceptions), `EDAUTILS_ENABLE_DEBUG_ENVIRONMENT=1` (debug messages),
  `EDAUTILS_LIBRARY_MAP_FILE` (library map file used when `-mapfile` is not given; default `libmap.ini`).
  Environment variables inside `+incdir+` paths are expanded, and `$EDAUTILS_ROOT` is substituted in map-file paths.
- No external tools needed.

### Invocation

Common Verilog-reader options (shared parser, `FVPProcessCmdLineArgs`; used by `parseverilog`,
`anvl`, `elabvl`, `genemptymoduleandcsv`): `-in <file>`, `-f <filelist>` (may also hold `+incdir+`,
`+define+`, and per-file `-v95`/`-sv` lines), `-excludefilelist <file>`, `+incdir+<p1>+<p2>`,
`+define+A+B=1`, `-v95`, `-nowildcard`, `-ignore_metacomment <vendor|*> <directive|*>`, `-mark_metacomment <vendor|*> <directive|*>`, `-print_metacomment` (see Vendor meta comments), `-nokeywords a:b`, `-blackbox`,
`-declare_wires_for_undefined_obects`, `-dump`, `-restore <u1:u2>`, `-work <lib>` (default `work`),
`-mapfile <ini>` (`logical=physical` lines), `-inxml <file>`, `-inxmlmodule <file>`, `-out <file>`,
`-top <module>`, `-l <log>` / `-la <log>` (log file / append), `-quiet`, `-nobanner`, `-dbg`,
`-suppress <id1:id2>`, `-user <email>`, `-encryption_key`, `-encryption_algorithm`,
`-private_key_file`, `-public_key_file`. `-help`/`-h` print usage. Every run of these four
creates the work-library directory `myEdaUtilsWork/` (or the path mapped for `-work`) in the
current directory. An unrecognised option is an error (message "Unrecognized option"), followed by the usage.

#### parseverilog

```
parseverilog -in <file.v> | -f <filelist> | -inxml <file> | -inxmlmodule <file> | -restore <unit>
             [-out <file>] [options]
```

| Option | Meaning |
|---|---|
| `-out <file>` | Output Verilog (default `parseverilog.out.v`) |
| `-noelab` | Do not elaborate before printing |
| `-norangeeval` | Do not evaluate ranges |
| `-no_braced_expr` | Drop redundant `()` around binary expressions when printing; the ones operator precedence needs are kept (`(a + 1) * 16`) |
| `-elab_only_inst_intf` | Elaborate only instance interfaces |
| `-replace_xz_with_zero` | Treat `x`/`z` as 0 while evaluating |
| `-save_description` | Keep comments while parsing |
| `-printtopmodules` | List the possible top modules after the run |
| `-outxml <file>` | Also save the design database as XML |
| `-outxmlmodule <module>` | Also save that module as `<module>.xml` |
| `-toolprefix <name>` | Message prefix (log file stays `ParseVerilog.log`, it is set earlier) |

With `-dump`, the parsed units are saved into the work library. With `-restore <unit>` (and no `-in`/`-f`), that unit is
reloaded from the work library, elaborated and written to `-out`.

#### Vendor meta comments (translate_off / synthesis_off)

`// synopsys translate_off` ... `// synopsys translate_on` (also `/* */`, and `--` in VHDL) fence code that a
synthesis tool skips. Recognised, case-insensitive: vendor `synopsys synthesis pragma cadence ambit xilinx altera
intel mentor exemplar rtl_synthesis` (or any vendor named in `-mark_metacomment` / `-ignore_metacomment`), then `translate_off|on` or
`synthesis_off|on` (spaced `translate off` too; `rtl_synthesis off|on` and `synthesis off|on` imply the synthesis pair).
Nested, unbalanced and unterminated fences are warnings (20010-20013); an open region ends at the end of the file.

- Default (populate): the code is parsed and kept in the datamodel and each object knows its fences. Print-back is
  unchanged unless `-print_metacomment` is given, which re-emits the fences around the module-level declarations and
  statements they enclosed (API: `getMetaComments().setPrintFences(true)`).
- Two explicit modes, both repeatable, `*` wildcards, any vendor string (no prior `addVendor`), directive
  `translate_off|translate_on|translate|synthesis_off|synthesis_on|synthesis`:
  - Mark, `-mark_metacomment <vendor|*> <directive|*>` / `registerMarkedRegion(vendor, directive)`: the code inside a
    matching fence is parsed and every datamodel object in it carries the region (`isInMetaCommentRegion(...)`,
    `getMetaCommentRegions()`). The built-in vendors are marked with nothing registered; this extends recognition to
    user vendors (`-mark_metacomment myco translate_off`).
  - Ignore, `-ignore_metacomment <vendor|*> <directive|*>` / `registerIgnoredRegion(vendor, directive)`: the lexer
    swallows the text between the fences (a lexer mode, the way a false `` `ifdef`` branch is skipped), so nothing in
    it is parsed, nothing reaches the datamodel, print-back omits it, and no directive inside it (`` `define``,
    `` `include``, `` `ifdef``, `` `endif``) is acted on. Fences that match no ignore rule stay in mark mode.
  - Precedence: when a mark rule and an ignore rule both match, **ignore wins**.
  - Undo: `unregisterMarkedRegion`, `unregisterIgnoredRegion`, `clearMarkedRegions`, `clearIgnoredRegions` (a user
    vendor is forgotten when no rule names it any more). `addIgnoreMetaComment` is a deprecated alias of
    `registerIgnoredRegion`.
- Java API (`FVPBase`/`FVhPBase`): `isInMetaCommentRegion()`, `isInMetaCommentRegion(vendor, directive)`,
  `getMetaCommentRegions()` (outermost first; each `MetaCommentRegion` has `getVendor()`, `getDirective()`,
  `getFile()`, `getStartLine()`, `getEndLine()`, `isIgnored()`). `FVPDescription.instance()` /
  `FVhPDescription.instance()`: `registerMarkedRegion(String vendor, String directive)`,
  `registerIgnoredRegion(String vendor, String directive)`, the unregister/clear methods above,
  `getMetaCommentRegions(file)` lists a file's regions, `getMetaComments()` returns the `MetaCommentRegistry`.
  `FVPModule.getAllMetaCommentRegions()` lists a module's. `anvl` takes the same options as `parseverilog`.
- Limits: an ignored region is entered from a comment in the lexer's default mode (a fence inside a `` `define`` body or a
  false `` `ifdef`` branch is not seen); print-back places fences around module-level declarations and statements (Verilog) and
  architecture declarations and statements (VHDL), not inside a port list or a nested block.

#### preprocessverilog (own parser, not `FVPProcessCmdLineArgs`)

```
preprocessverilog -in <file.v> | -f <filelist>  [-out <file>]  [+incdir+..] [+define+A+B=1]
                  [-nowildcard] [-nobanner] [-dbg] [-toolprefix <name>] [-user <email>]
                  [-encryption_key <16 chars>] [-encryption_algorithm <alg>] [-keyowner <v>] [-keyname <k>]
                  [-private_key_file <f>] [-public_key_file <f>]
preprocessverilog -generate_keys          # writes key.pvt.dat and key.pub.dat (RSA, 1024)
```

Without `-out`, each input is written to `VlogPP/<input basename>`. With `-out`, every input is
written to that one path, so with several inputs the last one wins. Given a key, `` `pragma protect`` envelopes
are encrypted/decrypted (regression cases `preprocessverilog/encrypt_data`, `decrypt_data`).
`-help` prints usage. Unlike the other launchers, `-h` is rejected here as an unrecognised option.

#### anvl / elabvl

```
anvl   -in <file.v> | -f <filelist> [-work <lib>] [-mapfile <ini>] [common options]
elabvl -top <module> [-work <lib>] [-mapfile <ini>] [-out <file>] [-out_v2005 <file>
       [-blackbox_module <module>]...] [intent options] [common options]   (shell bundles only)
```

`anvl` parses with `-dump` forced on, so the units are saved into the work library. `elabvl` restores
`-top` from the work library, elaborates it and writes `-out` (default `parseverilog.out.v`). Both
also accept `-toolprefix <name>`. The `elabvl` usage lists `-work` as mandatory, but the code defaults it to `work`.
**Without any intent option `elabvl` elaborates and decompiles exactly as it always has.**

#### elabvl -out_v2005: Verilog-2005 for Yosys read_verilog (fallback SystemVerilog frontend)

`elabvl -top <top> -out_v2005 <file>` writes the elaborated design as Verilog-2005 that Yosys'
plain `read_verilog` (no `-sv`) accepts, for when `read_slang` is unavailable or fails. `-out` is
then written only when given. The primary path for SystemVerilog stays the yosys-slang plugin.

```
anvl -f rtl.f +define+EDAUTILS_SYNTH -dump
elabvl -top soc_top -out_v2005 soc_top_v2005.v -blackbox_module boot_rom -blackbox_module ddr_ctrl
yosys -p "read_verilog soc_top_v2005.v; synth -top soc_top"
```

- Every module is written once per distinct set of resolved parameter values. A module reached with
  one set keeps its name; one reached with several becomes `<module>__<8 hex>` (SHA-1 of the set),
  and its instances name that variant with no `#(...)`. Parameters stay parameters, with resolved
  constant values (assignment-pattern and wide values included).
- Lowered: packed multi-dimensional ports/nets/variables/parameters to flat `[W-1:0]` vectors with
  every select rewritten to an indexed part-select (`x[i][j]` -> `x[i*S + j]`, `x[i]` -> `x[i*S +: S]`);
  `parameter int`/`logic [..][..]`/`bit` to `integer`/`[W-1:0]` parameters; `'0 '1 'x 'z` to sized
  replications; `logic`/`bit` to `wire`, or `reg` when assigned procedurally; `always_ff`/`always_comb`/
  `always_latch` to `always` (`@(*)` for the latter two); `int`/`byte`/`shortint`/`longint` to `integer`/
  signed regs; `for (int i ...)` and block-local (`automatic`) variables declared once at the top of their
  process and set first (no inferred latches); `unique`/`priority` dropped; `++ -- += -= ...` expanded;
  `inside` to a comparison chain; `$clog2`/`$bits` of constants folded; generate `if`/`case` resolved,
  generate `for` written as a Verilog-2005 loop.
- `-blackbox_module <module>` (repeatable) writes that module as a `(* blackbox *)` module with its
  ports and resolved parameters only.
- Not lowered, each reported as error 61501 naming file:line (the file is still written, exit 1):
  struct/union/enum/typedef'd types and their members, interfaces/modports, package references and
  imports, casts other than `signed'`/`unsigned'`, `break`/`continue`/`return`, `foreach`, `do while`,
  fork/join, `case ... inside`/`matches`, wildcard equality `==?`, assignment patterns outside parameter
  values, a generate loop whose iterations instantiate different parameter sets. Immediate assertions are dropped with
  warning 61502. Nothing else is dropped.
- Exit: 0 written; 1 a construct could not be lowered (61501/61507) or the top is missing; options
  without a value: 61503; `-blackbox_module` without `-out_v2005`: 61504.
- `edautilscommandline/helpers/elab_to_v2005_for_yosys.sh` runs anvl + elabvl + a yosys smoke in one go.

#### Intent options: -upf, -sdc, annotation, flattened intent, lint (elabvl, elabvh, elabmixed)

The three elaborators share these options (source `com.eu.miscedautils.elab.ElabIntent`); `elabvh`
documents them by reference to this section.

| option | effect |
|---|---|
| `-upf <file>` | load the UPF onto the elaborated design and bind it (below) |
| `-upf_report <file>` | with `-upf`: binding report (default `<tool>.upf.rpt`) |
| `-sdc <file>` | evaluate the SDC on the elaborated design and bind every object query (below) |
| `-sdc_report <file>` | with `-sdc`: binding report (default `<tool>.sdc.rpt`) |
| `-annotate_upf` | with `-upf`: power intent as comments in the decompiled HDL |
| `-annotate_sdc` | with `-sdc`: the constraints on each object as comments in the decompiled HDL |
| `-upf_flatout <file>` | with `-upf`: the UPF flattened and elaborated onto the design |
| `-sdc_flatout <file>` | with `-sdc`: the SDC as evaluated, every query replaced by the objects it matched |
| `-lint_upf` | with `-upf`: Level 1 (the `upflint` rules, UPF alone) + Level 2 (UPF against the design) |
| `-lint_sdc` | with `-sdc`: Level 1 (the `sdclint` rules, SDC alone) + Level 2 (SDC against the design) |
| `-lint_report <file>` | with `-lint_*`: one report for both (default `<tool>.lint.rpt`) |

An option that needs `-upf`/`-sdc` given without it: error 61041, exit 1. A file option without a
value: 61040 (`-upf`: 61000, `-sdc`: 61020); `-upf`/`-sdc` file unreadable: 61001/61021. All of
these stop the run before anything is elaborated.

**`-upf <file>`** binds the UPF to the elaborated design before it is decompiled:

- Every UPF instance (domain `-elements`/`-exclude_elements`, `load_upf -scope`, `set_scope`,
  strategy `-elements`, `connect_supply_net -elements` ...) must be an instance of the elaborated
  design, and every hierarchical pin (`u1/VDD` in `connect_supply_net -ports`) a port or net of
  that instance; each one that is not is an error, 61010 (instance) or 61011 (pin). Binding goes
  on after an error, so one run reports them all. A non-hierarchical supply/logic port or net the
  design lacks is no error: UPF creates it. Names inside power models are not checked.
- Bound UPF objects carry their HDL object in `actualObject` (`FVPModuleInstance`, `FVPPort`,
  `FVPNet`; VHDL `FVhPInstantiation`, `FVhPPort`, `FVhPSignal`); the Java API
  `com.eu.miscedautils.upfparser.UPFDesignBinding` answers, for any hierarchical path,
  `getPowerDomain`, `getPrimarySupply`, `getHdlObject`, `getUpfObject` and `getSupplyNets`. Paths
  are relative to the top, `/`-separated, the top itself `/`.
- `-upf_report` lists `instance <path> domain <pd> primary <ss>` for every instance, then
  `port|net <path> domain <pd> [supply_net <n>]... [driver_supply <ss>] [receiver_supply <ss>]` for
  every design port/net the UPF names. `-` = none; `PD.primary` = a primary handle with no supply
  set associated.
- A domain's extent: an instance belongs to the domain naming its deepest ancestor-or-self as an
  element and not excluding it; else the default domain (no elements) of the nearest scope.
- UPF not loadable: 61003; report not writable: 61014.

**`-sdc <file>`** evaluates the deck with sdclint's evaluator (plain Tcl works: `set`, `foreach`,
`proc`, `source`; `exec`/file writes are not executed) and resolves every `get_ports`, `get_pins`,
`get_cells`, `get_nets` pattern, and every bare name written where an object is expected, against
the elaborated hierarchy (Verilog and VHDL at any depth):

- `get_ports` names top-level ports; `get_cells`/`get_nets`/`get_pins` patterns are relative to
  `current_instance`, `*`/`?` never cross a hierarchy level, `-hierarchical` matches leaf names at
  every level below it (`cell/pin` for pins), `-regexp`/`-nocase` apply, `set_hierarchy_separator`
  and `-hsc` are honoured. A bus bit `d[3]` (or `d[*]`) matches the port/net `d`. A net pattern also
  matches ports (a port is a net inside its module). A black box's pins are unknown, not absent, so a
  pin pattern on one is accepted as written. `-of_objects` queries and `-filter` are not resolved.
- A pattern that matches nothing is an error, 61030, with the deck's file:line; a `current_instance`
  that is not an instance is 61030 too. All are reported in one run; exit 1.
- `-sdc_report` lists every query with what it matched (`<file:line> <query> -> <n> : <paths>`), then
  `object <path> <command> (<file:line>)` for every constrained design object.

**`-annotate_upf` / `-annotate_sdc`** put the bound intent into the decompiled HDL as comments
(`//` Verilog, `--` VHDL), just before the object they describe: on each instance its domain and
primary supply (`UPF instance u_cpu: domain PD_CPU primary SS_CPU`), the isolation/level-shifter/
retention/repeater strategies naming it (a strategy without `-elements` annotates the root
instances of its domain), and the SDC constraints on it (`SDC <flattened command> (file:line)`); a
pin's notes go on its instance; top ports, nets and the top itself go on the top module/entity;
inner nets on the module/entity that declares them. Verilog elaboration is not uniquified, so one
instance statement carries the notes of every path through it, each tagged with its path. With an
annotate option `elabvh` and `elabmixed` decompile every unit of the hierarchy (entity and
architecture), not just the top entity.

**`-upf_flatout <file>`**: every command of every file the UPF reads, in execution order (as
`parseupf -flatout`), each `create_power_domain` followed by `# extent <pd>: <instances>` -- the
elaborated design instances the domain resolved to -- then the extent of every domain and every
bound port/net as comments. **`-sdc_flatout <file>`**: the deck as evaluated, one command per
constraint (variables, loops, procs and sourced files already expanded), every object query
replaced by the concrete objects it matched as top-relative paths (`current_instance` folded in,
`set_hierarchy_separator` dropped: the output always uses `/`).

**`-lint_upf` / `-lint_sdc`** write one report, one line per finding,
`<severity> <rule> <L1|L2> <file:line> <message>`, then a per-rule summary and totals:

- Level 1 is the standalone linter's catalogue on the intent alone: `sdclint` (SDC-0xx..8xx) and
  `upflint` (UPF-0xx..2xx); see their AGENTS.md.
- Level 2 needs the design. SDC: the sdclint rules marked "needs a netlist" -- SDC-139 clock on an
  output port, SDC-140 clock on a hierarchical pin, SDC-212 IO port without IO delay, SDC-314
  `-from` an output / `-to` an input port, SDC-315 exception through a clock source, SDC-407 drive on
  an output / load on an input, SDC-408 input without a drive model, SDC-504 case analysis on an
  output, SDC-702/703/704 query matching nothing, SDC-806 `current_design` not the top -- plus
  SDC-901 input delay on an output / output delay on an input (error), SDC-903 clock-named input without a clock, SDC-904 `set_disable_timing` on a hierarchical
  instance, SDC-905 constraint on a black-box pin. The port rules (212, 408, 903) run only when the
  deck defines a clock, and skip ports the UPF binds as supply ports. UPF Level 2: see the upflint
  AGENTS.md (UPF-3xx and the design form of its [N] rules).
- Licence: Level 1 is the standalone linters' catalogue, so `-lint_sdc` needs licence feature
  `SDCLINT` and `-lint_upf` feature `UPFLINT` (each also granted by the matching backbone feature and
  `DESIGNPLAYERBACKBONE`); without it the checkout failure is printed, that lint is skipped and the
  exit status is 10.
- Exit status: licence failure 10; binding/load/usage errors 1; else 2 when the lint reports an
  error; else 0.

#### elabmixed (shell bundles only)

```
elabmixed -top <module|entity> [-work <lib>] [-out <file>] [-out_vl <file>] [-out_vh <file>]
          [-vl <file>...] [-vh <file>...] [<file>...] [+incdir+<dir>] [+define+<m>]
          [-print_mra|-print_all_archs] [intent options] [common options]
```

Mixed Verilog/VHDL designs. The design comes from the work library (analysed beforehand with
`anvl`/`anvh`) or from the command line: `-vl <files>` (Verilog/SystemVerilog) and `-vh <files>`
(VHDL) take every following word up to the next option; a plain file name (or `-in <file>`) is sorted
by extension -- `.v .sv .vh .svh .vg .vo .vlog .verilog .vp .svp` Verilog, `.vhd .vhdl .vho .vhi .vhq`
VHDL; any other extension is error 61066 (name it with `-vl`/`-vh`). VHDL files are analysed first,
in the order given, by the VHDL analyser into the VHDL work library (map `-mapfile` or `qtmap.ini`);
the Verilog files then go to the Verilog analyser as one compilation unit (`+incdir+`/`+define+` pass
through) into `-work`. A missing source file is 61062, `-vl`/`-vh` without a file 61060 (exit 1).

`elabmixed` then elaborates `-top` as a Verilog module if the library has one, else as a VHDL
entity (neither: 61065). The hierarchy crosses languages at any depth: a Verilog instance of a VHDL
entity is followed into the entity's most recent architecture, a VHDL component with no VHDL entity
into the Verilog module of that name. Every unit it reaches is decompiled in its own language: the
top's language into `-out` (default `decompiled.out.v` for a Verilog top, `decompiled.vhd` for a VHDL
top), the other into `-out_vl`/`-out_vh`, by default `-out` with its extension replaced (`elab.v` ->
`elab.vhd`). The Verilog file holds every Verilog module loaded; the VHDL file every VHDL unit reached
(entity, then its architecture), children before parents. A file is written only when its language
occurs. A VHDL top also accepts `-print_mra`/`-print_all_archs` (extra `decompiled.<entity>.<arch>.vhd`
files, as `elabvh`). Intent options as above; report defaults `elabmixed.*.rpt`.

#### genemptymoduleandcsv

```
genemptymoduleandcsv -in <file.v> | -f <filelist>  -top <module>  [-outvlog <file>] [-outcsv <file>]
```

Writes the port/parameter-only module to `-outvlog` (default `<top>.empty.sv`) and the CSV to
`-outcsv` (default `<top>.csv`). Parent directories are created.

### Inputs / Outputs

- Reads: Verilog files from `-in`/`-f` (wildcards resolved unless `-nowildcard`), `` `include``
  files through `+incdir+`, and the library map file if it exists.
- Writes: as listed per launcher above, plus `myEdaUtilsWork/` (work library) for the four
  `FVPProcessCmdLineArgs` tools. `-dump` or `anvl` add saved units there.
- Log: `<prefix>.log` in the current directory (see the table; override with `-l`/`-la` or
  `EDAUTILS_LOG_FILE`). Every console line is also written to the log.

### Exit status and messages

- `parseverilog`, `anvl`, `preprocessverilog`: 0 on a normal finish, **including runs that reported
  errors**, and also after `-help`. Exceptions: 10 = licence failure; `anvl` with neither `-in` nor `-f`
  prints usage and exits 10. `parseverilog -restore`/`-inxml` path exits with the number of write failures (0 or 1).
- `elabvl`: 1 when `-top` is missing or `-out` cannot be written; otherwise 0 (a unit not found in the
  library is an Error with exit 0). With `-upf`/`-sdc`: 1 when the run reported any error (load
  errors, unresolved names, a top unit not found), else 2 when `-lint_*` reported an error, else 0.
- `elabmixed`: as `elabvl`; also 1 for a usage error (unknown option, bad source file).
- `genemptymoduleandcsv`: 0, or 1 when `-top` is not found or on an internal exception/out of memory.
  Missing `-top`/`-in` prints errors and usage, then exits 0.
- 1 = `EDAUTILS_ROOT` missing/invalid (launcher or `Utils.getEdaUtilsRoot`).
- Message format: `<prefix>: <Severity>: <id>: <text>`, severity one of `Error`, `Fatal Error`,
  `Warning`, `Note`. `<id>` is a 5-digit message number. Usage lines have no severity or id.
- The run ends with `<prefix>: Note: <id>: Found N error(s) and M warning(s) ...`. It is **not
  printed with `-nobanner`**, except on the `elabvl` exit-1 paths and the `parseverilog` restore path, which always print it.

### Examples

Shipped: `examples/printinfo/` is an API example, not a launcher run. `runme.csh` compiles
`PrintHierInstanceAndModPorts.java` against `lib/verilogparser.jar` and runs it on `simple_and.v`. It writes
`PrintHierInstanceAndModPorts.log`, and the release self-test greps that log for `Found 0 error(s)`. There are no shipped launcher examples.

From the regression suite (`tests.edautilscommandline/tests/verilogparser/<case>/runme.csh`, most
via `../runme_common.csh`):

```
parseverilog -suppress 130000 -no_braced_expr -nowildcard -in <case>.v -out decompiled.sv
parseverilog -in include_dir.v +incdir+include_dir -out decompiled.sv          # include_dir
parseverilog -f files.txt -dump ; parseverilog -out decompiled.sv -restore i2c_control   # i2c_saverestore
parseverilog -help                                                             # help_message, golden ParseVerilog.log.gld
preprocessverilog -nowildcard -in include_directive.v -out decompiled.v        # preprocessverilog/include_directive
preprocessverilog -help                                                        # preprocessverilog/help_msg
```

Elaborator regression families: `tests/elab` (no intent options, elabmixed sources and outputs),
`tests/elabupf` (`-upf`), `tests/elabsdc` (`-sdc`), `tests/elabintent` (`-upf` and `-sdc` with
annotation and flattened intent), `tests/elablint` (`-lint_upf`/`-lint_sdc`, one case per Level 2
rule). Each case's `cmd` is the exact command line. There are no regression cases for `genemptymoduleandcsv`.

### Integration notes

- Non-interactive; does not read stdin. Run with `</dev/null`.
- Writes the log, `myEdaUtilsWork/`, `VlogPP/` and default outputs into the current directory: give each parallel run its
  own working directory.
- Set `EDAUTILS_DISABLE_USAGE_TRACKING=true` to stop usage registration.
- Success test: exit status 0 **and** the log contains `Found 0 error(s)` (do not use
  `-nobanner` if you rely on that line) **and** the output file exists.

### See also

parsevhdl, preprocessverilog (stand-alone bundle), createhierarchy, flattenverilog, verilog2lib; API docs in `doc/html/index.html`.
