get_ports
Get all ports in the current top level module (LLM: ports)
Usage: @matching_ports = get_ports($pattern, @options);
$pattern: Match pattern, can have wildcard "*". If it is empty, it is treated as "*"
@options:
-input: Get input ports only
-output: Get output ports only
-inout: Get inout ports only
-bus: Get ports in bus format instead of bit blast.
The API returns an array point if this option present
The item in the array has format of [port, IsBus, MaxIndex, MinIndex]
if IsBus == 1, MaxIndex is the Max Index of the bus, E.G, 7 if the bus is port_a[7:0]
if ISBus==0, MaxIndex and MinIndex are not defined
If no option is present, get all ports
@matching_ports: Return ports matching the pattern and the option specified in
the current top level module
Examples:
@ports = get_ports("-input", "dsp2mc_*"); # Get input ports with "dsp2mc_" as prefix
@ports = get_ports; # Get all ports