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
21 /* netlist_dev.h, definitions for a netlist of circuital devices
24 #ifndef __NETLIST_DEV_H__
25 #define __NETLIST_DEV_H__
30 #define DEVNODE_HEAD 0
31 #define DEVNODE_TAIL 1
54 /* #define DEVT_NODE 0 defined in netlist.h */
64 /* 0 1 2 3 4 5 6 7 8 */
65 #define DEVT_TERMS { 2, 4, 2, 2, 2, 2, 2, 2, 4 }
66 #define DEVT_SYMS { "NODE", "FET", "CAP", "RES", "IND", "DIODE", "VSRC", "ISRC", "BJT" }
67 #define DEVT_VALS { 0, DEVFET_V, DEVCAP_V, DEVRES_V, 0 , 0, 0, 0 , 0 }
68 #define DEVT_OTHERS { 0, sizeof(unsigned), 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0 , 0 }
71 #define DEVP_NODE(nl,t) list_data(&((nl)->e[DEVT_NODE].l),(t).devi)
72 #define DEVP_NODEt(nl,t) ((devnode_t *)DEVP_NODE((nl),(t)))
74 #define DEVP_FET(nl,t) list_data(&((nl)->e[DEVT_FET].l),(t).devi)
75 #define DEVP_FETt(nl,t) ((devfet_t *)DEVP_NODE((nl),(t)))
77 #define DEVP_CAP(nl,t) list_data(&((nl)->e[DEVT_CAP].l),(t).devi)
78 #define DEVP_CAPt(nl,t) ((devcap_t *)DEVP_NODE((nl),(t)))
82 typedef struct devgen_st
85 termptr_t n
[TERMPTR_MAX_TERMI
];
92 typedef struct devfet_st
97 unsigned type
; /* n/p */
101 typedef struct devcap_st
109 typedef struct devres_st
117 typedef struct devind_st
125 typedef struct devvsrc_st
133 typedef struct devisrc_st
141 typedef struct devdiode_st
149 typedef struct devbjt_st
156 typedef struct dev2term_st
163 typedef struct dev4term_st
170 typedef union devall_un
184 #define NETLIST_DEFSIZES \
186 sizeof(devnode_t) , sizeof(devfet_t), sizeof(devcap_t), sizeof(devres_t), \
187 sizeof(devind_t), sizeof(devdiode_t), sizeof(devvsrc_t), \
188 sizeof(devisrc_t) , sizeof(devbjt_t) \
194 netlist_t
*netlist_copyish(netlist_t
*in
, int size
, int sizes
[]);
195 void netlist_o_spice(void *of_fp
, netlist_t
*nl
, int n_start
);
196 netlist_t
*netlist_devnew_inplace(netlist_input_t ni
, int extrasize
, int extrasizes
[DEVT_MAX
]);
197 netlist_t
*netlist_devnew(netlist_input_t ni
);
198 /********* netlist_funcs.c *********/
199 netlistfunc_t
* netlist_devfet_funcs(netlist_t
*nl
, netlistfunc_t
*fp
);