support / src_en /api.get_ports.txt
gofeco's picture
Upload 100 files
fe683c0 verified
raw
history blame
No virus
1.11 kB
<h3 id='___get_ports'>get_ports</h3>
<pre>Get all ports in the current top level module (LLM: ports)
<b>Usage:</b> @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
<b>Examples:</b>
@ports = get_ports("-input", "dsp2mc_*"); # Get input ports with "dsp2mc_" as prefix
@ports = get_ports; # Get all ports
</pre>