Jspice3
urc.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "urcdefs.h"
11 #include "uflags.h"
12 
13 
14 static IFparm URCpTable[] = { /* parameters */
15  IOPU("l", URC_LEN, IF_REAL, "Length of transmission line"),
16  IOPU("n", URC_LUMPS, IF_REAL, "Number of lumps"),
17  OPU( "pos_node",URC_POS_NODE, IF_INTEGER, "Positive node of URC"),
18  OPU( "neg_node",URC_NEG_NODE, IF_INTEGER, "Negative node of URC"),
19  OPU( "gnd", URC_GND_NODE, IF_INTEGER, "Ground node of URC")
20 };
21 
22 static IFparm URCmPTable[] = { /* model parameters */
23  IOP( "k", URC_MOD_K, IF_REAL, "Propagation constant"),
24  IOPA("fmax", URC_MOD_FMAX, IF_REAL, "Maximum frequency of interest"),
25  IOP( "rperl", URC_MOD_RPERL, IF_REAL, "Resistance per unit length"),
26  IOPA("cperl", URC_MOD_CPERL, IF_REAL, "Capacitance per unit length"),
27  IOP( "isperl", URC_MOD_ISPERL,IF_REAL, "Saturation current per length"),
28  IOP( "rsperl", URC_MOD_RSPERL,IF_REAL, "Diode resistance per length"),
29  IP( "urc", URC_MOD_URC, IF_FLAG, "Uniform R.C. line model")
30 };
31 
32 static char *URCnames[] = {
33  "P1",
34  "P2",
35  "Ref"
36 };
37 
38 static char *URCmodNames[] = {
39  "urc",
40  NULL
41 };
42 
43 static IFkeys URCkeys[] = {
44  { 'u', NUMELEMS(URCnames), URCnames, 0, 0 },
45 };
46 
47 
48 static int URCkSize = NUMELEMS(URCkeys);
49 static int URCpTSize = NUMELEMS(URCpTable);
50 static int URCmPTSize = NUMELEMS(URCmPTable);
51 static int URCiSize = sizeof(URCinstance);
52 static int URCmSize = sizeof(URCmodel);
53 
54 
56  {
57  "URC", /* MUST precede both resistors and capacitors */
58  "Uniform R.C. line",
59 
60  &URCkSize,
61  URCkeys,
62  1,
64  URCparse,
65 
66  &URCpTSize,
67  URCpTable,
68 
69  &URCmPTSize,
70  URCmPTable,
71  },
72 
73  URCparam,
74  URCmParam,
75  NULL,
76  URCsetup,
77  URCsetup,
78  NULL,
79  NULL,
80  NULL,
81  NULL,
82  NULL,
83  GENdestroy,
84  GENmDelete,
85  GENdelete,
86  NULL,
87  URCask,
88  URCmAsk,
89  NULL,
90  NULL,
91  NULL, /* DISTO */
92  NULL, /* NOISE */
93 
94  &URCiSize,
95  &URCmSize
96 };
static int URCkSize
Definition: urc.c:48
static IFparm URCpTable[]
Definition: urc.c:14
#define URC_MOD_URC
Definition: urcdefs.h:76
static int URCiSize
Definition: urc.c:51
#define IOP(a, b, c, d)
Definition: devdefs.h:120
#define URC_LUMPS
Definition: urcdefs.h:64
static int URCmSize
Definition: urc.c:52
#define OPU(a, b, c, d)
Definition: uflags.h:65
#define NUMELEMS(ARRAY)
Definition: spice.h:157
struct sURCmodel URCmodel
SPICEdev URCinfo
Definition: urc.c:55
void GENdestroy()
#define URC_MOD_CPERL
Definition: urcdefs.h:73
#define URC_MOD_FMAX
Definition: urcdefs.h:71
static char * URCnames[]
Definition: urc.c:32
int URCparam()
void URCparse()
int URCsetup()
#define NULL
Definition: spdefs.h:121
static int URCmPTSize
Definition: urc.c:50
#define IF_INTEGER
Definition: ifsim.h:107
int URCmAsk()
#define IOPA(a, b, c, d)
Definition: uflags.h:50
int URCmParam()
#define URC_GND_NODE
Definition: urcdefs.h:67
Definition: ifsim.h:54
Definition: ifsim.h:267
struct sURCinstance URCinstance
#define URC_NEG_NODE
Definition: urcdefs.h:66
#define IF_REAL
Definition: ifsim.h:108
#define IP(a, b, c, d)
Definition: devdefs.h:118
#define IF_FLAG
Definition: ifsim.h:106
int GENmDelete()
static IFparm URCmPTable[]
Definition: urc.c:22
int GENdelete()
static IFkeys URCkeys[]
Definition: urc.c:43
int URCask()
#define URC_MOD_RPERL
Definition: urcdefs.h:72
#define URC_MOD_RSPERL
Definition: urcdefs.h:75
#define URC_POS_NODE
Definition: urcdefs.h:65
#define URC_LEN
Definition: urcdefs.h:63
#define URC_MOD_ISPERL
Definition: urcdefs.h:74
static char * URCmodNames[]
Definition: urc.c:38
#define IOPU(a, b, c, d)
Definition: uflags.h:48
static int URCpTSize
Definition: urc.c:49
#define URC_MOD_K
Definition: urcdefs.h:70