The netlists arrays representing the circuit are shown in Table 3.10. This table also includes a column showing the points associated with each of the netlists. Notice, however, that these points are not stored in any array by the implementation. Instead, as described earlier, all the elements comprising a netlist (wire segments and wire points) are each tagged with a unique tag name as they are created and manipulated.
Netlist Tag Name | Points in Netlist | net_ports | net_name |
netlist_0 | A D | {input D} | - |
netlist_1 | B E | {input E} | - |
netlist_2 | C J | - | In3 |
netlist_3 | F G H I L | {output F} {input I} | Out1 |
netlist_4 | K M | - | - |
The net_ports array, which maintains a list of port/point pairs for each netlist entry, is used primarily to determine the netlist type. Using the netlist type, the GUI can prevent the user from making mistakes during the design of the circuit. For example, netlist types are used to prevent the user from soldering two output netlists together and from directly modifying the signal values of an output netlist on the signal display. The type of a netlist is determined by the following rules:
In order to implement the above rules, the net_ports array maps a given netlist tag name to a list of port/point pairs which represent the port types to which the netlist is connected and their corresponding point identifiers. Whenever this list is modified in any way, it is re-sorted so that an output pair, if one exists in the list, is always placed at the beginning. This way, the type of the netlist is always kept at the front of the list and can therefore be extracted in constant time. If the netlist has no corresponding net_ports array element, then the type will be unknown.
The net_name array, which contains the textual name of the netlist as seen by the user, serves as a liaison between the circuit editor and the signal display window. This name serves as a key which is used to identify signals waveforms in the signal display window. Like the net_ports array, the net_name array is also used to prevent the user from making mistakes during circuit layout. For instance, this array is consulted in order to prevent the user from trying to give a single netlist two names and from soldering together two netlists which have both been previously labelled. The net_name array is also used to prohibit the user from giving two separate netlists the same name.
Note that it is acceptable for a netlist to have no corresponding entry in either the net_ports or the net_name array. In this case, the netlist is simply an isolated netlist which has not been labelled by the user.