Nets

Want to know all of the nets in your board? Nets can be looked up in two ways:

by name

by netcode – a unique integer identifier for your net.

If you run this code:

# returns a dictionary netcode:netinfo_item
netcodes = board.GetNetsByNetcode()
# list off all of the nets in the board.
for netcode, net in netcodes.items():
print("netcode {}, name {}".format(netcode, net.GetNetname()))
# here's another way of doing the same thing.
print("here's the other way to do it")
nets = board.GetNetsByName()
for netname, net in nets.items():
print("method2 netcode {}, name{}".format(net.GetNet(), netname))
# maybe you just want a single net
# the find method returns an iterator to all matching nets.
# the value of an iterator is a tuple: name, netinfo
clknet = nets.find("/clk").value()[1]
clkclass = clknet.GetNetClass()
print("net {} is on netclass {}".format(clknet.GetNetname(),
clkclass))