File size: 1,093 Bytes
b8d41f7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<h3 id='___get_ports'>get_ports</h3> <pre>Get all ports in the current top level module <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> |