2011-08-09 20:42:42 +02:00
|
|
|
/**********
|
|
|
|
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
|
|
|
|
Author: 2010 Paolo Nenzi
|
|
|
|
|
**********/
|
|
|
|
|
|
|
|
|
|
|
2011-12-11 19:05:00 +01:00
|
|
|
#include "ngspice/ngspice.h"
|
|
|
|
|
#include "ngspice/const.h"
|
|
|
|
|
#include "ngspice/ftedefs.h"
|
|
|
|
|
#include "ngspice/wordlist.h"
|
2011-08-09 20:42:42 +02:00
|
|
|
#include "variable.h"
|
2011-12-11 19:05:00 +01:00
|
|
|
#include "ngspice/sperror.h"
|
2011-08-09 20:42:42 +02:00
|
|
|
|
|
|
|
|
|
2011-10-31 11:53:51 +01:00
|
|
|
struct FTEparm {
|
2011-08-09 20:42:42 +02:00
|
|
|
char *keyword;
|
|
|
|
|
int id;
|
|
|
|
|
char *description;
|
2011-10-31 11:53:51 +01:00
|
|
|
};
|
2011-08-09 20:42:42 +02:00
|
|
|
|
|
|
|
|
|
2011-10-31 11:53:51 +01:00
|
|
|
static struct FTEparm FTEOPTtbl[] = {
|
2016-03-25 15:21:12 +01:00
|
|
|
{ "decklineno", FTEOPT_NLDECK, "Number of lines in the deck" },
|
|
|
|
|
{ "netloadtime", FTEOPT_NLT, "Netlist loading time" },
|
|
|
|
|
{ "netparsetime", FTEOPT_NPT, "Netlist parsing time" }
|
2011-08-09 20:42:42 +02:00
|
|
|
};
|
|
|
|
|
|
2011-10-31 11:53:51 +01:00
|
|
|
static const int FTEOPTcount = sizeof(FTEOPTtbl)/sizeof(*FTEOPTtbl);
|
2011-08-09 20:42:42 +02:00
|
|
|
|
2016-03-25 12:50:01 +01:00
|
|
|
static struct variable *getFTEstat(struct FTEparm *, FTESTATistics *, struct variable *);
|
2011-08-09 20:42:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
struct variable *
|
2015-12-13 12:50:14 +01:00
|
|
|
ft_getstat(struct circ *ci, char *name)
|
2011-08-09 20:42:42 +02:00
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (name) {
|
|
|
|
|
for (i = 0; i < FTEOPTcount; i++)
|
2016-03-25 12:54:26 +01:00
|
|
|
if (eq(name, FTEOPTtbl[i].keyword))
|
|
|
|
|
return getFTEstat(FTEOPTtbl + i, ci->FTEstats, NULL);
|
2011-08-09 20:42:42 +02:00
|
|
|
return (NULL);
|
|
|
|
|
} else {
|
2016-03-25 12:45:47 +01:00
|
|
|
struct variable *vars = NULL;
|
2016-03-25 12:54:26 +01:00
|
|
|
for (i = FTEOPTcount; --i >= 0;)
|
|
|
|
|
vars = getFTEstat(FTEOPTtbl + i, ci->FTEstats, vars);
|
2011-08-09 20:42:42 +02:00
|
|
|
return vars;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static struct variable *
|
2016-03-25 12:50:01 +01:00
|
|
|
getFTEstat(struct FTEparm *p, FTESTATistics *stat, struct variable *next)
|
2011-08-09 20:42:42 +02:00
|
|
|
{
|
2016-03-25 12:32:19 +01:00
|
|
|
switch (p->id) {
|
2011-08-09 20:42:42 +02:00
|
|
|
case FTEOPT_NLDECK:
|
2016-03-25 15:41:12 +01:00
|
|
|
return var_alloc_num(copy(p->description), stat->FTESTATdeckNumLines, next);
|
2011-08-09 20:42:42 +02:00
|
|
|
case FTEOPT_NLT:
|
2016-03-25 15:41:12 +01:00
|
|
|
return var_alloc_real(copy(p->description), stat->FTESTATnetLoadTime, next);
|
2011-08-09 20:42:42 +02:00
|
|
|
case FTEOPT_NPT:
|
2016-03-25 15:41:12 +01:00
|
|
|
return var_alloc_real(copy(p->description), stat->FTESTATnetParseTime, next);
|
2011-08-09 20:42:42 +02:00
|
|
|
default:
|
2016-03-25 15:21:12 +01:00
|
|
|
return NULL;
|
2011-08-09 20:42:42 +02:00
|
|
|
}
|
|
|
|
|
}
|