diff --git a/src/include/ngspice/mifcmdat.h b/src/include/ngspice/mifcmdat.h index 22e1e7bce..77427af83 100644 --- a/src/include/ngspice/mifcmdat.h +++ b/src/include/ngspice/mifcmdat.h @@ -407,7 +407,7 @@ struct Mif_Private { int num_inst_var; /* Number of instance variables */ Mif_Inst_Var_Data_t **inst_var; /* Information about each inst variable */ Mif_Callback_t *callback; /* Callback function */ - + MIFinstance *instance; /* Information about the instance */ }; diff --git a/src/xspice/cmpp/mod_lex.l b/src/xspice/cmpp/mod_lex.l index cfa9f5953..a8b7c7341 100644 --- a/src/xspice/cmpp/mod_lex.l +++ b/src/xspice/cmpp/mod_lex.l @@ -126,6 +126,8 @@ OUTPUT_STATE {return TOK_OUTPUT_STATE;} OUTPUT_STRENGTH {return TOK_OUTPUT_STRENGTH;} OUTPUT_TYPE {return TOK_OUTPUT_TYPE;} OUTPUT_CHANGED {return TOK_OUTPUT_CHANGED;} +INSTNAME {return TOK_INSTNAME;} +INSTMODNAME {return TOK_INSTMODNAME;} "(" {return TOK_LPAREN;} ")" {return TOK_RPAREN;} diff --git a/src/xspice/cmpp/mod_yacc.y b/src/xspice/cmpp/mod_yacc.y index 2ebaa0e22..32a0b80b7 100644 --- a/src/xspice/cmpp/mod_yacc.y +++ b/src/xspice/cmpp/mod_yacc.y @@ -371,6 +371,8 @@ static void append (char *str) %token TOK_TOTAL_LOAD %token TOK_MESSAGE %token TOK_CALL_TYPE +%token TOK_INSTNAME +%token TOK_INSTMODNAME %start mod_file @@ -445,6 +447,10 @@ macro : TOK_INIT {fprintf (mod_yyout, "mif_private->circuit.frequency");} | TOK_TEMPERATURE {fprintf (mod_yyout, "mif_private->circuit.temperature");} + | TOK_INSTNAME + {fprintf (mod_yyout, "mif_private->instance->MIFname");} + | TOK_INSTMODNAME + {fprintf (mod_yyout, "mif_private->instance->gen.GENmodPtr->GENmodName");} | TOK_T TOK_LPAREN buffered_c_code TOK_RPAREN {fprintf (mod_yyout, "mif_private->circuit.t[%s]", $3);} | TOK_PARAM TOK_LPAREN subscriptable_id TOK_RPAREN diff --git a/src/xspice/icm/xtradev/degmonitor/cfunc.mod b/src/xspice/icm/xtradev/degmonitor/cfunc.mod index dc2dba7f3..c9aa896fa 100644 --- a/src/xspice/icm/xtradev/degmonitor/cfunc.mod +++ b/src/xspice/icm/xtradev/degmonitor/cfunc.mod @@ -43,7 +43,7 @@ NON-STANDARD FEATURES /*=== INCLUDE FILES ====================*/ - +#include "ngspice/mifdefs.h" /*=== CONSTANTS ========================*/ @@ -185,6 +185,8 @@ void cm_degmon(ARGS) /* structure holding parms, STATIC_VAR(prevtime) = (double *) malloc(sizeof(double)); prevtime = (double *) STATIC_VAR(prevtime); *prevtime = 0.; + cm_message_send(INSTNAME); + cm_message_send(INSTMODNAME); } else { diff --git a/src/xspice/mif/mifload.c b/src/xspice/mif/mifload.c index b0fcdeeff..1f1c579aa 100644 --- a/src/xspice/mif/mifload.c +++ b/src/xspice/mif/mifload.c @@ -241,6 +241,7 @@ MIFload( /* ***************************************************************** */ g_mif_info.instance = here; g_mif_info.errmsg = ""; + cm_data.instance = here; if(here->initialized) { cm_data.circuit.init = MIF_FALSE;