# $Header: README,v 1.7 99/06/24 15:40:30 space Exp $

Demonstration of the switchbox example from the Space Tutorial.

STEPS
=====

1.  Make project, use scmos_n technology and lambda = 1 (micron)
    % mkpr -p scmos_n -l 1 projectname

Rest assumes that you and your files are in the project directory.

2.  Use cgi to put switchbox layout into the database.
    % cgi switchbox4.gds

3.  List contents of project.
    % dblist
    or
    % dblist -h

4.  Watch the layout using the layout editor/viewer dali.
    % dali
    Use the command "read_cell" in the menu "DB_menu" to read
    the different cells.

5.  Perform a hierarchical extraction of cell switchbox4.
    % space -v switchbox4

6.  List contents of project and inspect circuit.
    % dblist -h
    % xspice -ah switchbox4
    Note that hierarchical extraction works fine here because
    the terminals are rectangles that abut.  When the terminals
    are just points (e.g. when they originate from gds text 
    structures and not from gds boundary elements with a property),
    they must have an overlap at a higher cell level in order to 
    connect them to other parts of the circuit.

7.  Perform a flat extraction of cell switchbox4.
    % space -vF switchbox4

8.  List contents of project and inspect circuit.
    % dblist -h
    % xspice -ah switchbox4

9.  Try out the options -c, -C, -r and -z for capacitance and 
    resistance extraction.
    % space -vFc switchbox4
    % xspice -ah switchbox4
    ...

10. Note that network dec1of4 contains a label test:
    % space -v dec1of4
    % xspice -a dec1of4

11. When performing a flat extraction for switchbox4, the label 
    test may be inherited from each sub-cell dec1of4 when setting 
    the parameter hier_labels.   Note that the inherited label 
    names use the sub-cell name, the original label name and the 
    coordinates of the labels.
    % space -vF -Shier_labels switchbox4
    % xspice -a switchbox4
    
The following demonstrates the use of the circuit comparison program
match.

12. Add a reference circuit description for the switchbox circuit 
    to the database using the program cspice.
    % cspice swbox_ref.spc

13. Use cgi to put a flat version of the switchbox layout into the 
    database and extract the circuit.
    % cgi switchbox4_f.gds
    % space switchbox4_f

14. Use the program match to compare the extracted circuit against the
    reference circuit.
    % match swbox_ref switchbox4_f
    The result shows that the circuits are identical.

15. Make an error in the layout of switchbox4_f using dali (e.g. remove 
    some metal) and run the programs space and match again.
    % dali switchbox4_f
    % space switchbox4_f
    % match swbox_ref switchbox4_f
    The result shows that the circuits are not identical.

16. Use the option -fullbindings to see which network parts are matched.
    % match -fullbindings swbox_ref switchbox4_f

The following demonstrates the use of the back-annotation program
highlay in combination with the circuit comparison program match.
Assume that the reference circuit swbox_ref has been added to the 
database and assume that that an error is present in the layout of 
switchbox4_f (see the steps above).

17. Run the program space with the option -x and run the program match 
    with the options -edif and -fullbindings.  The last two options 
    cause match to write a binding table into the database that can be 
    used as input for highlay.
    % space -x switchbox4_f
    % match -edif -fullbindings swbox_ref switchbox4_f

18. The nets that have not been matched (the deficient nets) are selected 
    for high-lighting by running the program highlay as follows:
    % highlay -d -n -v switchbox4_f

19. Next, use a layout editor to read in the cell HIGH_OUT that has been 
    generated by highlay and inspect the unmatched conductors.
    % dali HIGH_OUT
    In the 'settings' menu, set 'hash mode' to 'hashed', and expand
    the subcells.

