In order to internally represent the netlists and their corresponding component connectivity, the Tcl/Tk script employs several global associative arrays. The array names, their indices and their contents are shown in Table 3.6. Notice that all associative arrays which are indexed by point identifiers are prefixed with pnt, whereas associative arrays indexed by netlist tag names are prefixed with net.
Array Name | Array Index | Array Contents |
pnt_coord | point identifier | (x,y) coordinates of the point. |
pnt_wires | point identifier | List of wire identifiers adjacent to the point. |
pnt_port | point identifier | Canvas identifier of the port connected to the point (if applicable). |
pnt_label | point identifier | Canvas identifier of the textual label for the point (if applicable). |
net_ports | netlist tag name | List of ports connected to a netlist. Each element of the list is a pair consisting of a port type and the point identifier connected to the port. |
net_name | netlist tag name | The textual name of the netlist as assigned by the user via the Netlist Label dialog box. |
As an example of how netlists are represented internally, consider the incomplete circuit displayed in Figure 3.9. Remember that all newly created canvas items are assigned unique numeric identifiers so that they may be referenced later on. However, for clarity, capital letters will be used to represent point identifiers, integers will represent the identifiers of wire segments and lowercase letters will represent port identifiers (that is, the identifiers of port rectangles). A shaded port indicates that the port has been connected to the overlapping point. The sans serif font represents netlist labels placed on the workarea by the user via the Netlist Label dialog box; the numeric identifier assigned to this text label by Tk will be represented by the notation id(label).
Figure 3.9: Example of a Circuit Layout
The tags for each of the points and wires for this circuit are shown in Tables 3.7 and 3.8 respectively. Note that all points have been given the point tag and all wires have been given the wire tag. Also note that in addition to the netlist tag, all wires and points have been given a special netlist identifier tag name which serves to indicate to which netlist the wire or point belongs.
Point Identifier | List of Tags |
A | { point netlist netlist_0 } |
B | { point netlist netlist_1 } |
C | { point netlist netlist_2 } |
D | { point netlist netlist_0 } |
E | { point netlist netlist_1 } |
F | { point netlist netlist_3 } |
G | { point netlist netlist_3 } |
H | { point netlist netlist_3 } |
I | { point netlist netlist_3 } |
J | { point netlist netlist_2 } |
K | { point netlist netlist_4 } |
L | { point netlist netlist_3 } |
M | { point netlist netlist_4 } |
Wire Identifier | List of Tags |
1 | { wire netlist netlist_0 } |
2 | { wire netlist netlist_1 } |
3 | { wire netlist netlist_2 } |
4 | { wire netlist netlist_3 } |
5 | { wire netlist netlist_3 } |
6 | { wire netlist netlist_3 } |
7 | { wire netlist netlist_3 } |
8 | { wire netlist netlist_4 } |