Modified the UGetCursor() routine to return a valid response if the
[xcircuit.git] / spiceparser / netlist_template.c
blob7fdfc3f276aa3b11b5ddfb48a0529e9ee647a145
1 /********************
2 This file is part of the software library CADLIB written by Conrad Ziesler
3 Copyright 2003, Conrad Ziesler, all rights reserved.
5 *************************
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 ******************/
21 /* netlist_template.c, code for building graph matching templates.
22 Conrad Ziesler
25 /* primary goal:
27 We want to build a data structure which represents all library graphs merged into one,
28 in such a way that each merge keeps a list of library cells that were merged at that point.
29 With such a sturcture, we should be able to decompose a complex netlist into its component pieces.
33 Ref1-> cell (nfet_sd) (lib 1,2) -g>
34 -sd>
36 -> cell (pfet_g) (lib 3,5) -sd>
37 -sd>
40 netlist nodes are common and simple
41 netlist devices are complex, shared/merged keeping a list of the library cell associations.
45 to decompose a big netlist,
46 1. initialize bitmap of library cell numbers
47 2. start traversing depth first from some reference.
48 2.1. keep track of traversal in template, eliminating at each step cells in the bitmap.
49 2.2. keep track of devices and nodes traversed and matched with template in gate internal list.
50 2.3. stop traversing at template boundaries.
51 3. examine bitmap. if any remain, we have successful match.