Punch new ports through a Verilog hierarchy: add a port on a sub-module and route it up to the top or across to another instance, with optional feed-through, editing the RTL in place.
Surgically edits Verilog/SystemVerilog, VHDL and mixed Verilog/VHDL source to punch new ports through the hierarchy, either pulling sub-module ports up to the top module (-submodule) or routing a pin from one instance to another, optionally through intermediate instances (feedthrough sets). The design is parsed once; the change is planned as an ECO JSON description (eco.json) and then applied as token edits on the original text, so comments, macros and formatting outside the edits are kept. Only the files that change are written, into an output directory (default output_dir/).
Usage
punchports -in <file.v> | -f <filelist> -top <module>
( -submodule <mod>/<port>[,<port>...] ...
| -route from=<src> to=<dst>[,<dst>...] [via=<inst>,...] [name=<base>] [width=<msb>:<lsb>] ...
| -route_file <file>
| +feedthrough -from <hier pin> -to <hier inst> [-through <inst>,<inst>] -feedthrough ...
| -json_in <eco.json> )
[-outdir <dir>] [-json_out <file>] [-json_only] [-all_instances] [options]
Every option is listed by punchports -help, and the complete reference is in the capability file that ships with the tool's AGENTS.md.
Exit status
- 0: the edit was planned and written with no error.
- 1: any error -- option errors, top module not found (55902), an instance path segment not found (146001), a port already connected (146002/146015), unpacked or parameter-dependent width (146003/146004), a uniquify that needs an instance split out of a multi-instance statement (146014), parse errors in the input (146021, nothing is edited), or an internal exception. Nothing is written then (146018 "No RTL written").
- 10 = no valid license file.
Requirements
Java 11 or newer on PATH (Java 21 recommended), Linux or Windows. Unpack the bundle, run source setup_env.sh and call punchports. Install in one command with curl -fsSL https://edautils.com/install.sh | sh -s -- punchports.