-
Notifications
You must be signed in to change notification settings - Fork 7
/
N_CIR_XyceCInterface.h
100 lines (78 loc) · 4.47 KB
/
N_CIR_XyceCInterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//-------------------------------------------------------------------------
// Copyright 2002-2022 National Technology & Engineering Solutions of
// Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
// This file is part of the Xyce(TM) Parallel Electrical Simulator.
//
// Xyce(TM) is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Xyce(TM) is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Xyce(TM).
// If not, see <http://www.gnu.org/licenses/>.
//-------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
// Purpose : C callable functions to link to Xyce's C++ interface
//
// Special Notes : These functions expose Xyce's C++ interface to
// other programs (i.e. Python) that can dynamically
// link to a C library (via ctypes in Python)
//
//
//-----------------------------------------------------------------------------
/*
simple class file for Xyce interface
*/
#ifdef __cplusplus
extern "C" {
#endif
void xyce_open( void** ptr );
void xyce_close( void** ptr);
int xyce_initialize_early( void** ptr, int narg, char ** argv);
int xyce_initialize( void** ptr, int narg, char ** argv);
int xyce_initialize_late( void** ptr );
int xyce_runSimulation(void ** ptr);
int xyce_simulateUntil( void ** ptr, double requestedUntilTime, double* completedUntilTime );
int xyce_getNumDevices(void **ptr, char * modelGroupName, int* numDevNames, int* maxDevNameLength);
int xyce_getDeviceNames(void ** ptr, char * modelGroupName, int* numDevNames, char ** deviceNames);
int xyce_getTotalNumDevices(void **ptr, int* numDevNames, int* maxDevNameLength);
int xyce_getAllDeviceNames(void ** ptr, int* numDevNames, char ** deviceNames);
int xyce_getDACDeviceNames(void ** ptr, int* numDevNames, char ** deviceNames);
int xyce_checkDeviceParamName(void **ptr, char* full_param_name);
int xyce_getDeviceParamVal(void **ptr, char* full_param_name, double* value);
int xyce_getNumAdjNodesForDevice(void **ptr, char* deviceName, int* numAdjNodes);
int xyce_getAdjGIDsForDevice(void **ptr, char* deviceName, int* numAdjNodes, int* adjGIDs);
int xyce_updateTimeVoltagePairs(void ** ptr, char * DACname, int numPoints, double * timeArray, double * voltageArray);
int xyce_getTimeVoltagePairsADC( void** ptr, int * numADCnames, char ** ADCnames, int * numPoints, double ** timeArray, double ** voltageArray );
int xyce_getTimeVoltagePairsADCsz( void** ptr, int * maxPoints );
int xyce_getTimeVoltagePairsADCLimitData( void** ptr, const int maxNumADCnames, const int maxNameLength, const int maxNumPoints,
int * numADCnames, char ** ADCnamesArray, int * numPointsArray, double ** timeArray, double ** voltageArray );
int xyce_getTimeStatePairsADCLimitData( void** ptr, const int maxNumADCnames, const int maxNameLength, const int maxNumPoints,
int * numADCnames, char ** ADCnames, int * numPointsArray, double ** timeArray, int ** stateArray );
/*
Note: ADCnames, numPoints, timeArray and voltageArray must be preallocated! this function cannot
allocate that storage or the ctypes layer breaks
*/
int xyce_getTimeStatePairsADC( void** ptr, int * numADCnames, char ** ADCnames, int * numPoints, double ** timeArray, int ** stateArray );
/*
Note: ADCnames, numPoints, timeArray and stateArray must be preallocated! this function cannot
allocate that storage or the ctypes layer breaks
*/
int xyce_getADCMap(void ** ptr, int *numADCnames, char ** ADCnames, int * widths, double * resistances,
double * upperVLimits, double * lowerVLimits, double * settlingTimes);
int xyce_setADCWidths(void ** ptr, int numADCnames, char ** ADCnames, int * widths);
int xyce_getADCWidths(void ** ptr, int numADCnames, char ** ADCnames, int * widths);
int xyce_checkResponseVar(void ** ptr, char * variable_name);
int xyce_obtainResponse(void ** ptr, char * variable_name, double *value);
#ifdef __cplusplus
}
#endif