Skip to content

Commit

Permalink
new files, should have been in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wrcad committed Jul 20, 2018
1 parent f7e5c85 commit e6a17f3
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
61 changes: 61 additions & 0 deletions wrspice/devlib/ind/indaskm.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

/*========================================================================*
* *
* Distributed by Whiteley Research Inc., Sunnyvale, California, USA *
* http://wrcad.com *
* Copyright (C) 2018 Whiteley Research Inc., all rights reserved. *
* Author: Stephen R. Whiteley, except as indicated. *
* *
* As fully as possible recognizing licensing terms and conditions *
* imposed by earlier work from which this work was derived, if any, *
* this work is released under the Apache License, Version 2.0 (the *
* "License"). You may not use this file except in compliance with *
* the License, and compliance with inherited licenses which are *
* specified in a sub-header below this one if applicable. A copy *
* of the License is provided with this distribution, or you may *
* obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* See the License for the specific language governing permissions *
* and limitations under the License. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- *
* INFRINGEMENT. IN NO EVENT SHALL WHITELEY RESEARCH INCORPORATED *
* OR STEPHEN R. WHITELEY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
*========================================================================*
* XicTools Integrated Circuit Design System *
* *
* WRspice Circuit Simulation and Analysis Tool: Device Library *
* *
*========================================================================*
$Id:$
*========================================================================*/

#include "inddefs.h"


int
INDdev::askModl(const sGENmodel *genmod, int which, IFdata *data)
{
const sINDmodel *model = static_cast<const sINDmodel*>(genmod);
IFvalue *value = &data->v;
// Need to override this for non-real returns.
data->type = IF_REAL;

switch (which) {
case IND_MOD_M:
value->rValue = model->INDm;
break;
default:
return (E_BADPARM);
}
return (OK);
}

62 changes: 62 additions & 0 deletions wrspice/devlib/ind/indsetm.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

/*========================================================================*
* *
* Distributed by Whiteley Research Inc., Sunnyvale, California, USA *
* http://wrcad.com *
* Copyright (C) 2018 Whiteley Research Inc., all rights reserved. *
* Author: Stephen R. Whiteley, except as indicated. *
* *
* As fully as possible recognizing licensing terms and conditions *
* imposed by earlier work from which this work was derived, if any, *
* this work is released under the Apache License, Version 2.0 (the *
* "License"). You may not use this file except in compliance with *
* the License, and compliance with inherited licenses which are *
* specified in a sub-header below this one if applicable. A copy *
* of the License is provided with this distribution, or you may *
* obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* See the License for the specific language governing permissions *
* and limitations under the License. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- *
* INFRINGEMENT. IN NO EVENT SHALL WHITELEY RESEARCH INCORPORATED *
* OR STEPHEN R. WHITELEY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
*========================================================================*
* XicTools Integrated Circuit Design System *
* *
* WRspice Circuit Simulation and Analysis Tool: Device Library *
* *
*========================================================================*
$Id:$
*========================================================================*/

#include "inddefs.h"


int
INDdev::setModl(int param, IFdata *data, sGENmodel *genmod)
{
sINDmodel *model = static_cast<sINDmodel*>(genmod);
IFvalue *value = &data->v;

switch (param) {
case IND_MOD_L:
break;
case IND_MOD_M:
model->INDm = value->rValue;
model->INDmGiven = true;
break;
default:
return (E_BADPARM);
}
return (OK);
}

0 comments on commit e6a17f3

Please sign in to comment.