From 8347e596677306aa7440921923effbac7a72fc96 Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Tue, 12 Sep 2023 16:22:43 +0100 Subject: [PATCH] Make the 'Null_Allowed' option for XSPICE code model parameters behave as reasonably expected and as described in the manual. Previously a missing (null) value was always accepted if the ifsspec.ifs file contained a default value, and several of the the included code models worked that way. Where there was a useful default, "no" has channged to "yes". Some models with a look-up table defined by two parameters had such defaults that did nothing useful. Thay have been given useful vector defaults. These changes should not affect previously-working netlists. --- src/xspice/cmpp/writ_ifs.c | 12 ++- .../icm/analog/multi_input_pwl/ifspec.ifs | 4 +- src/xspice/icm/analog/oneshot/ifspec.ifs | 94 +++++++++---------- src/xspice/icm/analog/sine/ifspec.ifs | 17 ++-- src/xspice/icm/analog/square/ifspec.ifs | 24 ++--- src/xspice/icm/analog/triangle/ifspec.ifs | 24 ++--- src/xspice/icm/digital/d_genlut/ifspec.ifs | 2 +- src/xspice/icm/digital/d_lut/ifspec.ifs | 10 +- src/xspice/icm/digital/d_osc/ifspec.ifs | 12 +-- src/xspice/icm/digital/d_pwm/ifspec.ifs | 26 ++--- src/xspice/icm/digital/d_source/ifspec.ifs | 34 +++---- src/xspice/icm/digital/d_state/ifspec.ifs | 90 +++++++++--------- src/xspice/icm/xtradev/capacitor/ifspec.ifs | 13 +-- src/xspice/icm/xtradev/inductor/ifspec.ifs | 10 +- src/xspice/icm/xtradev/memristor/ifspec.ifs | 18 ++-- src/xspice/icm/xtradev/sidiode/ifspec.ifs | 24 ++--- src/xspice/mif/mif_inp2.c | 29 +++--- 17 files changed, 228 insertions(+), 215 deletions(-) diff --git a/src/xspice/cmpp/writ_ifs.c b/src/xspice/cmpp/writ_ifs.c index 5b3b90f8a..907451b48 100644 --- a/src/xspice/cmpp/writ_ifs.c +++ b/src/xspice/cmpp/writ_ifs.c @@ -719,7 +719,17 @@ static int write_param_info( p_param_cur->default_value_cnt = 0; continue; } - rc |= fprintf(fp, "static union Mif_Parse_Value %s_default[] = {\n", + + if (!p_param_cur->null_allowed) { + fprintf(stderr, + "Default value given for parameter %s but " + "the user must set instance value (Null_Allowed: no).", + p_param_cur->name); + return 1; + } + + rc |= fprintf(fp, + "static union Mif_Parse_Value %s_default[] = {\n", p_param_cur->name); do { // Write the default values for this parameter. diff --git a/src/xspice/icm/analog/multi_input_pwl/ifspec.ifs b/src/xspice/icm/analog/multi_input_pwl/ifspec.ifs index 852c2bda9..0da489a85 100644 --- a/src/xspice/icm/analog/multi_input_pwl/ifspec.ifs +++ b/src/xspice/icm/analog/multi_input_pwl/ifspec.ifs @@ -15,7 +15,7 @@ AUTHORS SUMMARY - This file contains the interface specification file for the + This file contains the interface specification file for the analog multi-input gate pwl code model. ===============================================================================*/ @@ -44,7 +44,7 @@ PARAMETER_TABLE: Parameter_Name: x y model Description: "x array" "y array" "model type" Data_Type: real real string -Default_Value: 0.0 0.0 "and" +Default_Value: - - "and" Limits: - - - Vector: yes yes no Vector_Bounds: [2 -] [2 -] - diff --git a/src/xspice/icm/analog/oneshot/ifspec.ifs b/src/xspice/icm/analog/oneshot/ifspec.ifs index b56ac2aa4..e14464ab3 100644 --- a/src/xspice/icm/analog/oneshot/ifspec.ifs +++ b/src/xspice/icm/analog/oneshot/ifspec.ifs @@ -6,14 +6,14 @@ Georgia Tech Research Corporation Atlanta, Georgia 30332 -AUTHORS +AUTHORS 20 Mar 1991 Harry Li SUMMARY - This file contains the interface specification file for the + This file contains the interface specification file for the analog oneshot code model. ===============================================================================*/ @@ -28,92 +28,92 @@ Description: "one-shot" PORT_TABLE: -Port_Name: clk cntl_in -Description: "clock input" "input" -Direction: in in +Port_Name: clk cntl_in +Description: "clock input" "input" +Direction: in in Default_Type: v v -Allowed_Types: [v,vd,vnam,i,id] [v,vnam,vd,i,id] -Vector: no no -Vector_Bounds: - - -Null_Allowed: no yes +Allowed_Types: [v,vd,vnam,i,id] [v,vnam,vd,i,id] +Vector: no no +Vector_Bounds: - - +Null_Allowed: no yes PORT_TABLE: Port_Name: clear out Description: "clear signal" "output" -Direction: in out +Direction: in out Default_Type: v v -Allowed_Types: [v,vd,vnam,i,id] [v,vd,i,id] -Vector: no no -Vector_Bounds: - - +Allowed_Types: [v,vd,vnam,i,id] [v,vd,i,id] +Vector: no no +Vector_Bounds: - - Null_Allowed: yes no PARAMETER_TABLE: -Parameter_Name: cntl_array pw_array +Parameter_Name: cntl_array pw_array Description: "control in array" "pulse width array" -Data_Type: real real -Default_Value: 0.0 1.0e-6 -Limits: - [0 -] -Vector: yes yes -Vector_Bounds: [2 -] [2 -] -Null_Allowed: no no +Data_Type: real real +Default_Value: [0.0 1.0] [1.0e-6 0.9999999] +Limits: - [0 -] +Vector: yes yes +Vector_Bounds: [2 -] [2 -] +Null_Allowed: yes yes PARAMETER_TABLE: Parameter_Name: clk_trig pos_edge_trig Description: "clock trigger value" "pos/neg edge trigger switch" -Data_Type: real boolean -Default_Value: 0.5 TRUE -Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: no no +Data_Type: real boolean +Default_Value: 0.5 TRUE +Limits: - - +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes PARAMETER_TABLE: Parameter_Name: out_low out_high Description: "output low value" "output high value" -Data_Type: real real -Default_Value: 0.0 1.0 -Limits: - - -Vector: no no -Vector_Bounds: - - +Data_Type: real real +Default_Value: 0.0 1.0 +Limits: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes PARAMETER_TABLE: Parameter_Name: rise_time -Description: "output rise time" -Data_Type: real -Default_Value: 1.0e-9 -Limits: - -Vector: no -Vector_Bounds: - +Description: "output rise time" +Data_Type: real +Default_Value: 1.0e-9 +Limits: - +Vector: no +Vector_Bounds: - Null_Allowed: yes PARAMETER_TABLE: -Parameter_Name: rise_delay fall_delay -Description: "output delay from trigger" "output delay from pw" -Data_Type: real real -Default_Value: 1.0e-9 1.0e-9 +Parameter_Name: rise_delay fall_delay +Description: "output delay from trigger" "output delay from pw" +Data_Type: real real +Default_Value: 1.0e-9 1.0e-9 Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: yes yes +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes PARAMETER_TABLE: Parameter_Name: fall_time retrig -Description: "output rise time" "retrigger switch" +Description: "output rise time" "retrigger switch" Data_Type: real boolean Default_Value: 1.0e-9 FALSE Limits: - - -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes diff --git a/src/xspice/icm/analog/sine/ifspec.ifs b/src/xspice/icm/analog/sine/ifspec.ifs index 96895294b..747b193a9 100644 --- a/src/xspice/icm/analog/sine/ifspec.ifs +++ b/src/xspice/icm/analog/sine/ifspec.ifs @@ -33,8 +33,8 @@ Description: "input" "output" Direction: in out Default_Type: v v Allowed_Types: [v,vd,i,id,vnam] [v,vd,i,id] -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: no no PARAMETER_TABLE: @@ -42,11 +42,11 @@ PARAMETER_TABLE: Parameter_Name: cntl_array freq_array Description: "control in array" "frequency array" Data_Type: real real -Default_Value: 0.0 1.0e3 +Default_Value: [0.0 1.0] [1.0e3 2.0e3] Limits: - [0 -] -Vector: yes yes -Vector_Bounds: [2 -] [2 -] -Null_Allowed: no no +Vector: yes yes +Vector_Bounds: [2 -] [2 -] +Null_Allowed: yes yes PARAMETER_TABLE: @@ -56,7 +56,6 @@ Description: "output low value" "output high value" Data_Type: real real Default_Value: -1.0 1.0 Limits: - - -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes - diff --git a/src/xspice/icm/analog/square/ifspec.ifs b/src/xspice/icm/analog/square/ifspec.ifs index 9a350445e..9f4fc7aca 100644 --- a/src/xspice/icm/analog/square/ifspec.ifs +++ b/src/xspice/icm/analog/square/ifspec.ifs @@ -33,8 +33,8 @@ Description: "input" "output" Direction: in out Default_Type: v v Allowed_Types: [v,vd,i,id,vnam] [v,vd,i,id] -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: no no PARAMETER_TABLE: @@ -42,11 +42,11 @@ PARAMETER_TABLE: Parameter_Name: cntl_array freq_array Description: "control in array" "frequency array" Data_Type: real real -Default_Value: 0.0 1.0e3 +Default_Value: [0.0 1.0] [1.0e3 2.0e3] Limits: - [0 -] -Vector: yes yes -Vector_Bounds: [2 -] [2 -] -Null_Allowed: no no +Vector: yes yes +Vector_Bounds: [2 -] [2 -] +Null_Allowed: yes yes PARAMETER_TABLE: @@ -56,8 +56,8 @@ Description: "output low value" "output high value" Data_Type: real real Default_Value: -1.0 1.0 Limits: - - -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes PARAMETER_TABLE: @@ -67,8 +67,8 @@ Description: "duty cycle" "rise time" Data_Type: real real Default_Value: 0.5 1.0e-9 Limits: [1e-6 .999999] - -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes PARAMETER_TABLE: @@ -78,8 +78,8 @@ Description: "fall time" Data_Type: real Default_Value: 1.0e-9 Limits: - -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: yes diff --git a/src/xspice/icm/analog/triangle/ifspec.ifs b/src/xspice/icm/analog/triangle/ifspec.ifs index ad870f93a..075d8b3e8 100644 --- a/src/xspice/icm/analog/triangle/ifspec.ifs +++ b/src/xspice/icm/analog/triangle/ifspec.ifs @@ -28,25 +28,25 @@ Description: "controlled triangle wave oscillator" PORT_TABLE: -Port_Name: cntl_in out -Description: "input" "output" -Direction: in out -Default_Type: v v -Allowed_Types: [v,vd,i,id,vnam] [v,vd,i,id] -Vector: no no -Vector_Bounds: - - -Null_Allowed: no no +Port_Name: cntl_in out +Description: "input" "output" +Direction: in out +Default_Type: v v +Allowed_Types: [v,vd,i,id,vnam] [v,vd,i,id] +Vector: no no +Vector_Bounds: - - +Null_Allowed: no no PARAMETER_TABLE: Parameter_Name: cntl_array freq_array Description: "control in array" "frequency array" Data_Type: real real -Default_Value: 0.0 1.0e3 +Default_Value: [0.0 1.0] [1.0e3 2.0e3] Limits: - [0 -] -Vector: yes yes -Vector_Bounds: [2 -] [2 -] -Null_Allowed: no no +Vector: yes yes +Vector_Bounds: [2 -] [2 -] +Null_Allowed: yes yes PARAMETER_TABLE: diff --git a/src/xspice/icm/digital/d_genlut/ifspec.ifs b/src/xspice/icm/digital/d_genlut/ifspec.ifs index c29c537be..831cdc038 100644 --- a/src/xspice/icm/digital/d_genlut/ifspec.ifs +++ b/src/xspice/icm/digital/d_genlut/ifspec.ifs @@ -64,7 +64,7 @@ PARAMETER_TABLE: Parameter_Name: table_values Description: "lookup table values" Data_Type: string -Default_Value: "0" +Default_Value: - Limits: - Vector: no Vector_Bounds: - diff --git a/src/xspice/icm/digital/d_lut/ifspec.ifs b/src/xspice/icm/digital/d_lut/ifspec.ifs index 05f6ca6e0..7e3fb1f2e 100644 --- a/src/xspice/icm/digital/d_lut/ifspec.ifs +++ b/src/xspice/icm/digital/d_lut/ifspec.ifs @@ -55,8 +55,8 @@ Description: "input load value (F)" Data_Type: real Default_Value: 1.0e-12 Limits: - -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: yes PARAMETER_TABLE: @@ -64,10 +64,10 @@ PARAMETER_TABLE: Parameter_Name: table_values Description: "lookup table values" Data_Type: string -Default_Value: "0" +Default_Value: - Limits: - -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: no STATIC_VAR_TABLE: diff --git a/src/xspice/icm/digital/d_osc/ifspec.ifs b/src/xspice/icm/digital/d_osc/ifspec.ifs index b70c86058..5bc4e70ec 100644 --- a/src/xspice/icm/digital/d_osc/ifspec.ifs +++ b/src/xspice/icm/digital/d_osc/ifspec.ifs @@ -32,8 +32,8 @@ Description: "control input" "output" Direction: in out Default_Type: v d Allowed_Types: [v,vd,i,id] [d] -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: no no @@ -43,11 +43,11 @@ PARAMETER_TABLE: Parameter_Name: cntl_array freq_array Description: "control array" "frequency array" Data_Type: real real -Default_Value: 0.0 1.0e6 +Default_Value: [0.0 1.0] [1.0e6 2.0e6] Limits: - [0 -] -Vector: yes yes -Vector_Bounds: [2 -] [2 -] -Null_Allowed: no no +Vector: yes yes +Vector_Bounds: [2 -] [2 -] +Null_Allowed: yes yes PARAMETER_TABLE: diff --git a/src/xspice/icm/digital/d_pwm/ifspec.ifs b/src/xspice/icm/digital/d_pwm/ifspec.ifs index cde238f16..31dfb02e0 100644 --- a/src/xspice/icm/digital/d_pwm/ifspec.ifs +++ b/src/xspice/icm/digital/d_pwm/ifspec.ifs @@ -34,8 +34,8 @@ Description: "control input" "output" Direction: in out Default_Type: v d Allowed_Types: [v,vd,i,id] [d] -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: no no @@ -45,11 +45,11 @@ PARAMETER_TABLE: Parameter_Name: cntl_array dc_array Description: "control array" "duty cycle array" Data_Type: real real -Default_Value: 0.0 0.5 -Limits: - [0 1] -Vector: yes yes -Vector_Bounds: [2 -] [2 -] -Null_Allowed: no no +Default_Value: [-1 1] [0 1] +Limits: - [0 1] +Vector: yes yes +Vector_Bounds: [2 -] [2 -] +Null_Allowed: yes yes PARAMETER_TABLE: @@ -59,9 +59,9 @@ Description: "oscillator frequency" "initial phase of output" Data_Type: real real Default_Value: 1e6 0 Limits: [1e-6 -] [-180.0 +360.0] -Vector: no no -Vector_Bounds: - - -Null_Allowed: yes yes +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes PARAMETER_TABLE: @@ -71,9 +71,9 @@ Description: "rise delay" "fall delay" Data_Type: real real Default_Value: 1e-9 1e-9 Limits: [0 -] [0 -] -Vector: no no -Vector_Bounds: - - -Null_Allowed: yes yes +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes STATIC_VAR_TABLE: diff --git a/src/xspice/icm/digital/d_source/ifspec.ifs b/src/xspice/icm/digital/d_source/ifspec.ifs index d8cc2778b..0739838de 100644 --- a/src/xspice/icm/digital/d_source/ifspec.ifs +++ b/src/xspice/icm/digital/d_source/ifspec.ifs @@ -14,7 +14,7 @@ AUTHORS SUMMARY - This file contains the interface specification file for the + This file contains the interface specification file for the digital d_source code model. ===============================================================================*/ @@ -33,8 +33,8 @@ Description: "output" Direction: out Default_Type: d Allowed_Types: [d] -Vector: yes -Vector_Bounds: - +Vector: yes +Vector_Bounds: - Null_Allowed: no @@ -42,25 +42,25 @@ Null_Allowed: no PARAMETER_TABLE: Parameter_Name: input_file -Description: "digital input vector filename" -Data_Type: string -Default_Value: "source.txt" -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "digital input vector filename" +Data_Type: string +Default_Value: "source.txt" +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes PARAMETER_TABLE: Parameter_Name: input_load -Description: "input loading capacitance (F)" -Data_Type: real -Default_Value: 1.0e-12 -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "input loading capacitance (F)" +Data_Type: real +Default_Value: 1.0e-12 +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes STATIC_VAR_TABLE: diff --git a/src/xspice/icm/digital/d_state/ifspec.ifs b/src/xspice/icm/digital/d_state/ifspec.ifs index dcb8efa0c..3f1197ff0 100644 --- a/src/xspice/icm/digital/d_state/ifspec.ifs +++ b/src/xspice/icm/digital/d_state/ifspec.ifs @@ -13,7 +13,7 @@ AUTHORS SUMMARY - This file contains the interface specification file for the + This file contains the interface specification file for the digital d_state (state machine) code model. ===============================================================================*/ @@ -35,8 +35,8 @@ Description: "input" "clock" Direction: in in Default_Type: d d Allowed_Types: [d] [d] -Vector: yes no -Vector_Bounds: - - +Vector: yes no +Vector_Bounds: - - Null_Allowed: yes no @@ -48,8 +48,8 @@ Description: "reset" "output" Direction: in out Default_Type: d d Allowed_Types: [d] [d] -Vector: no yes -Vector_Bounds: - [1 -] +Vector: no yes +Vector_Bounds: - [1 -] Null_Allowed: yes no @@ -61,73 +61,75 @@ Parameter_Name: clk_delay reset_delay Description: "delay from CLK" "delay from reset" Data_Type: real real Default_Value: 1.0e-9 1.0e-9 -Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: yes yes +Limits: - - +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes PARAMETER_TABLE: Parameter_Name: state_file -Description: "state transition specification file name" -Data_Type: string -Default_Value: "state.txt" -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "state transition specification file name" +Data_Type: string +Default_Value: "state.txt" +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes PARAMETER_TABLE: Parameter_Name: reset_state -Description: "default state on RESET & at DC" -Data_Type: int -Default_Value: 0 -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "default state on RESET & at DC" +Data_Type: int +Default_Value: 0 +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes PARAMETER_TABLE: Parameter_Name: input_load -Description: "input loading capacitance (F)" -Data_Type: real -Default_Value: 1.0e-12 -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "input loading capacitance (F)" +Data_Type: real +Default_Value: 1.0e-12 +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes PARAMETER_TABLE: Parameter_Name: clk_load -Description: "clock loading capacitance (F)" -Data_Type: real -Default_Value: 1.0e-12 -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "clock loading capacitance (F)" +Data_Type: real +Default_Value: 1.0e-12 +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes + + PARAMETER_TABLE: Parameter_Name: reset_load -Description: "reset loading capacitance (F)" -Data_Type: real -Default_Value: 1.0e-12 -Limits: - -Vector: no -Vector_Bounds: - -Null_Allowed: no +Description: "reset loading capacitance (F)" +Data_Type: real +Default_Value: 1.0e-12 +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes STATIC_VAR_TABLE: diff --git a/src/xspice/icm/xtradev/capacitor/ifspec.ifs b/src/xspice/icm/xtradev/capacitor/ifspec.ifs index 453296848..7e41bb5ad 100644 --- a/src/xspice/icm/xtradev/capacitor/ifspec.ifs +++ b/src/xspice/icm/xtradev/capacitor/ifspec.ifs @@ -51,8 +51,8 @@ Description: "capacitor terminals" Direction: inout Default_Type: hd Allowed_Types: [hd] -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: no @@ -63,9 +63,6 @@ Description: "capacitance" "voltage initial condition" Data_Type: real real Default_Value: - 0.0 Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: no no - - - +Vector: no no +Vector_Bounds: - - +Null_Allowed: no yes \ No newline at end of file diff --git a/src/xspice/icm/xtradev/inductor/ifspec.ifs b/src/xspice/icm/xtradev/inductor/ifspec.ifs index 05ea7cf91..aedf800ed 100644 --- a/src/xspice/icm/xtradev/inductor/ifspec.ifs +++ b/src/xspice/icm/xtradev/inductor/ifspec.ifs @@ -51,8 +51,8 @@ Description: "inductor terminals" Direction: inout Default_Type: gd Allowed_Types: [gd] -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: no @@ -63,8 +63,8 @@ Description: "inductance" "current initial condition" Data_Type: real real Default_Value: - 0.0 Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: no no +Vector: no no +Vector_Bounds: - - +Null_Allowed: no yes diff --git a/src/xspice/icm/xtradev/memristor/ifspec.ifs b/src/xspice/icm/xtradev/memristor/ifspec.ifs index 7080d7e87..1002b2a7d 100644 --- a/src/xspice/icm/xtradev/memristor/ifspec.ifs +++ b/src/xspice/icm/xtradev/memristor/ifspec.ifs @@ -25,10 +25,10 @@ SUMMARY This file contains the definition of a memristor code model with threshold according to - Y. V. Pershin, M. Di Ventra: "SPICE model of memristive devices with threshold", - arXiv:1204.2600v1 [physics.comp-ph] 12 Apr 2012, + Y. V. Pershin, M. Di Ventra: "SPICE model of memristive devices with threshold", + arXiv:1204.2600v1 [physics.comp-ph] 12 Apr 2012, http://arxiv.org/pdf/1204.2600.pdf. - + ** Experimental, still to be tested in circuits !! ** INTERFACES @@ -59,8 +59,8 @@ Description: "memristor terminals" Direction: inout Default_Type: gd Allowed_Types: [gd] -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: no @@ -71,9 +71,9 @@ Description: "minimum resistance" "maximum resistance" "initial Data_Type: real real real Default_Value: 10.0 10000.0 7000.0 Limits: - - - -Vector: no no no -Vector_Bounds: - - - -Null_Allowed: no no no +Vector: no no no +Vector_Bounds: - - - +Null_Allowed: yes yes yes PARAMETER_TABLE: @@ -84,6 +84,6 @@ Default_Value: 0.0 1.0 0.0 Limits: - - - Vector: no no no Vector_Bounds: - - - -Null_Allowed: no no no +Null_Allowed: yes yes yes diff --git a/src/xspice/icm/xtradev/sidiode/ifspec.ifs b/src/xspice/icm/xtradev/sidiode/ifspec.ifs index 33614c7f7..ba0754e93 100644 --- a/src/xspice/icm/xtradev/sidiode/ifspec.ifs +++ b/src/xspice/icm/xtradev/sidiode/ifspec.ifs @@ -36,8 +36,8 @@ Description: "diode port" Direction: inout Default_Type: gd Allowed_Types: [gd] -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: no @@ -49,9 +49,9 @@ Description: "resistance on-state" "resistance off-state" Data_Type: real real Default_Value: 1 1 Limits: [1e-6 - ] [1e-12 -] -Vector: no no -Vector_Bounds: - - -Null_Allowed: no no +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes PARAMETER_TABLE: @@ -61,7 +61,7 @@ Description: "forward voltage" "reverse breakdown voltage" Data_Type: real real Default_Value: 0. 1e30 Limits: [0. -] [0. -] -Vector: no no +Vector: no no Vector_Bounds: - - Null_Allowed: yes yes @@ -74,8 +74,8 @@ Description: "limit of on-current" "limit of breakdown current" Data_Type: real real Default_Value: 1e30 1e30 Limits: [1e-15 -] [1e-15 -] -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes @@ -86,8 +86,8 @@ Description: "width quadrat. r 1" "width quadratic region 2" Data_Type: real real Default_Value: 0. 0. Limits: [0. -] [0. -] -Vector: no no -Vector_Bounds: - - +Vector: no no +Vector_Bounds: - - Null_Allowed: yes yes @@ -99,8 +99,8 @@ Description: "resistance in breakdown" Data_Type: real Default_Value: 0. Limits: - -Vector: no -Vector_Bounds: - +Vector: no +Vector_Bounds: - Null_Allowed: yes diff --git a/src/xspice/mif/mif_inp2.c b/src/xspice/mif/mif_inp2.c index 13304cc80..1368b9ba2 100644 --- a/src/xspice/mif/mif_inp2.c +++ b/src/xspice/mif/mif_inp2.c @@ -567,28 +567,33 @@ MIF_INP2A ( param_info = &(DEVices[type]->DEVpublic.param[i]); - if(mdfast->param[i]->is_null) { - char* emessage; + if (mdfast->param[i]->is_null) { + char* emessage = NULL; - if(param_info->default_value_siz == 0) { + if (!param_info->null_allowed) { + emessage = tprintf("Null not allowed for parameter %s " + "on model %s.", + param_info->name, mdfast->gen.GENmodName); + } else if (param_info->default_value_siz == 0) { if (param_info->type == MIF_STRING) continue; // Allow NULL emessage = tprintf("Parameter %s on model %s has no default", param_info->name, mdfast->gen.GENmodName); + } + + if (emessage) { LITERR(emessage); tfree(emessage); gc_end(); return; } - } - if((! mdfast->param[i]->is_null) && (param_info->is_array)) { - if(param_info->has_conn_ref) { - if(fast[0]->conn[param_info->conn_ref]->size != fast[0]->param[i]->size) { - LITERR("Array parameter size on model does not match connection size"); - gc_end(); - return; - } - } + } else if (param_info->is_array && param_info->has_conn_ref && + fast[0]->conn[param_info->conn_ref]->size != + fast[0]->param[i]->size) { + LITERR("Array parameter size on model does not match " + "connection size"); + gc_end(); + return; } } gc_end();