1 /*$Id: mode.h,v 1.3 2010-09-07 07:46:24 felix Exp $ -*- C++ -*-
3 * Copyright (C) 2001 Albert Davis
4 * Author: Albert Davis <aldavis@gnu.org>
6 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 *------------------------------------------------------------------
23 * several enumerated types to identify various modes
25 //testing=script,complete 2006.07.14
29 /*--------------------------------------------------------------------------*/
30 enum smode_t
{moUNKNOWN
=0, moANALOG
=1, moDIGITAL
, moMIXED
};
31 const std::string smode_t_names
[] = {"unknown", "analog", "digital", "mixed"};
32 inline OMSTREAM
& operator<<(OMSTREAM
& o
, smode_t t
) {
33 assert(t
>= int(moUNKNOWN
));
34 assert(t
<= int(moMIXED
));
35 return (o
<< smode_t_names
[t
]);
38 enum SIM_MODE
{ // simulation types
39 s_NONE
= 0, /* not doing anything, reset by cmd interpreter */
40 s_AC
, /* AC analysis */
41 s_OP
, /* op command */
42 s_DC
, /* dc sweep command */
43 s_TRAN
, /* transient command */
44 s_TTT
, /* two time transient command */
45 s_FOURIER
, /* fourier command */
46 s_SENS
, /* sensitivity */
47 s_DDC
, /* dynamic dc command */
48 s_SOCK
/* socket remote control */
50 const int sSTART
= s_NONE
;
51 const unsigned sCOUNT
= s_SOCK
+ 1;
52 const std::string SIM_MODE_label
[] = {"ALL", "AC", "OP", "DC", "TRAN", "TTT",
53 "FOURIER", "NOISE", "DDC", "SOCK"};
56 inline T
& operator<<(T
& o
, SIM_MODE t
) {
57 assert(t
>= int(s_NONE
));
58 assert(t
<= int(s_SOCK
));
59 return (o
<< SIM_MODE_label
[t
]);
62 enum SIM_PHASE
{ // which of the many steps...
63 p_NONE
, /* not doing anything, reset by cmd interpreter */
64 p_INIT_DC
, /* initial DC analysis */
65 p_DC_SWEEP
, /* DC analysis sweep, in progress */
66 p_TRAN
, /* transient, in progress */
67 p_AC
, /* plain AC analysis */
68 p_RESTORE
, /* transient restore after stop */
71 const std::string SIM_PHASE_label
[] = {"NONE", "INIT_DC", "DC_SWEEP", "TRAN",
72 "AC", "RESTORE", "POWERDOWN"};
75 inline T
& operator<<(T
& o
, SIM_PHASE t
) {
76 assert(t
>= int(p_NONE
));
77 assert(t
<= int(p_RESTORE
));
78 return (o
<< SIM_PHASE_label
[t
]);
82 enum PROBE_INDEX
{ // iter probes (continue after SIM_MODE)
83 iPRINTSTEP
= sCOUNT
, /* iterations for this printed step */
84 iSTEP
, /* iterations this internal step */
85 iTOTAL
/* total iterations since startup */
87 const int iCOUNT
= iTOTAL
+ 1; /* number of iteration counters */
90 #define cSTEPCAUSE (0) /* what caused this time step */
91 #define cSTEPS (1) /* count of hidden steps (+ this unhidden) */
92 #define cCOUNT (2) /* number of control probes */
93 /*--------------------------------------------------------------------------*/
94 /*--------------------------------------------------------------------------*/
96 // vim:ts=8:sw=2:noet: