summaryrefslogtreecommitdiff
diff options
-rw-r--r--Makefile32
-rw-r--r--Makefile.template54
-rw-r--r--NEWS62
-rw-r--r--README16
-rw-r--r--apps/Make.depend1130
-rw-r--r--apps/Make117
-rw-r--r--apps/Make2.Debug98
-rw-r--r--apps/Make2.g++57
-rw-r--r--apps/Make2.mingw3245
-rw-r--r--apps/bm_complex.cc16
-rw-r--r--apps/bm_exp.cc20
-rw-r--r--apps/bm_fit.cc18
-rw-r--r--apps/bm_generator.cc16
-rw-r--r--apps/bm_model.cc20
-rw-r--r--apps/bm_poly.cc20
-rw-r--r--apps/bm_posy.cc18
-rw-r--r--apps/bm_pulse.cc20
-rw-r--r--apps/bm_pwl.cc22
-rw-r--r--apps/bm_sffm.cc20
-rw-r--r--apps/bm_sin.cc20
-rw-r--r--apps/bm_tanh.cc18
-rw-r--r--apps/bmm_semi.cc90
-rw-r--r--apps/bmm_table.cc32
-rw-r--r--apps/c_clear.cc3
-rw-r--r--apps/c_comand.cc10
-rw-r--r--apps/c_delete.cc9
-rw-r--r--apps/c_exp.cc12
-rw-r--r--apps/c_genrat.cc3
-rw-r--r--apps/c_help.cc6
-rw-r--r--apps/c_list.cc20
-rw-r--r--apps/c_measure.cc3
-rw-r--r--apps/c_modify.cc12
-rw-r--r--apps/c_param.cc3
-rw-r--r--apps/c_prbcmd.cc59
-rw-r--r--apps/c_sim.cc6
-rw-r--r--apps/c_status.cc3
-rw-r--r--apps/c_sweep.cc3
-rw-r--r--apps/c_system.cc9
-rwxr-xr-xapps/configure31
-rw-r--r--apps/d_admit.cc106
-rw-r--r--apps/d_cap.cc112
-rw-r--r--apps/d_cccs.cc56
-rw-r--r--apps/d_ccvs.cc36
-rw-r--r--apps/d_coil.cc161
-rw-r--r--apps/d_cs.cc83
-rw-r--r--apps/d_logic.cc (renamed from lib/d_logic.cc)385
-rw-r--r--apps/d_meter.cc34
-rw-r--r--apps/d_mos123.model3
-rw-r--r--apps/d_poly_cap.cc54
-rw-r--r--apps/d_poly_g.cc42
-rw-r--r--apps/d_res.cc144
-rw-r--r--apps/d_switch.cc151
-rw-r--r--apps/d_trln.cc85
-rw-r--r--apps/d_vcg.cc44
-rw-r--r--apps/d_vcr.cc50
-rw-r--r--apps/d_vcvs.cc67
-rw-r--r--apps/d_vs.cc80
-rw-r--r--apps/func_core.cc75
-rw-r--r--apps/lang_spectre.cc48
-rw-r--r--apps/lang_spice.cc144
-rw-r--r--apps/lang_verilog.cc353
-rw-r--r--apps/measure_at.cc3
-rw-r--r--apps/measure_average.cc3
-rw-r--r--apps/measure_cross.cc3
-rw-r--r--apps/measure_eval.cc3
-rw-r--r--apps/measure_integral.cc3
-rw-r--r--apps/measure_max.cc3
-rw-r--r--apps/measure_min.cc3
-rw-r--r--apps/measure_rms.cc3
-rw-r--r--apps/measure_slewrate.cc3
-rw-r--r--apps/s__init.cc8
-rw-r--r--apps/s__solve.cc36
-rw-r--r--apps/s_ac.cc26
-rw-r--r--apps/s_dc.cc192
-rw-r--r--apps/s_fo.cc16
-rw-r--r--apps/s_tr.cc5
-rw-r--r--apps/s_tr_set.cc4
-rw-r--r--apps/s_tr_swp.cc13
-rw-r--r--conf/Make172
-rw-r--r--conf/config.h.in (renamed from main/config.h.in)3
-rwxr-xr-xconf/configure61
-rw-r--r--conf/gnucap-conf.in (renamed from main/gnucap-conf.in)0
-rw-r--r--conf/gnucap.conf.in (renamed from main/gnucap.conf.in)0
-rwxr-xr-xconfigure2
-rw-r--r--include/Make133
-rw-r--r--include/Make2.Debug (renamed from modelgen/Make2.Debug)27
-rw-r--r--include/Make2.g++ (renamed from lib/Make2.g++)21
-rw-r--r--include/Make3 (renamed from Make3)41
-rw-r--r--include/ap.h2
-rw-r--r--include/bm.h43
l---------include/config.h1
-rwxr-xr-xinclude/configure7
-rw-r--r--include/d_coment.h8
-rw-r--r--include/d_dot.h10
-rw-r--r--include/d_logic.h260
-rw-r--r--include/e_base.h11
-rw-r--r--include/e_card.h21
-rw-r--r--include/e_cardlist.h5
-rw-r--r--include/e_ccsrc.h34
-rw-r--r--include/e_compon.h68
-rw-r--r--include/e_elemnt.h56
-rw-r--r--include/e_logicmod.h74
-rw-r--r--include/e_logicnode.h132
-rw-r--r--include/e_logicval.h78
-rw-r--r--include/e_model.h20
-rw-r--r--include/e_node.h143
-rw-r--r--include/e_paramlist.h22
-rw-r--r--include/e_storag.h24
-rw-r--r--include/e_subckt.h42
-rw-r--r--include/io_dir.h80
-rw-r--r--include/io_error.h2
-rw-r--r--include/l_dispatcher.h3
-rw-r--r--include/l_indirect.h73
-rw-r--r--include/l_lib.h2
-rw-r--r--include/m_base.h227
-rw-r--r--include/m_expression.h152
-rw-r--r--include/m_interp.h11
-rw-r--r--include/m_matrix.h30
-rw-r--r--include/md.h2
-rw-r--r--include/patchlev.h2
-rw-r--r--include/s__.h2
-rw-r--r--include/s_tr.h10
-rw-r--r--include/spice-wrapper.cc42
-rw-r--r--include/u_attrib.h150
-rw-r--r--include/u_cardst.h14
-rw-r--r--include/u_parameter.h54
-rw-r--r--include/u_prblst.h6
-rw-r--r--include/u_sim_data.h3
-rw-r--r--lib/Make.depend258
-rw-r--r--lib/Make124
-rw-r--r--lib/Make2.Debug100
-rw-r--r--lib/Make2.mingw3250
-rw-r--r--lib/ap_construct.cc4
-rw-r--r--lib/ap_match.cc6
-rw-r--r--lib/ap_skip.cc8
-rw-r--r--lib/bm_cond.cc26
-rw-r--r--lib/c_attach.cc234
-rw-r--r--lib/c_file.cc24
-rwxr-xr-xlib/configure33
-rw-r--r--lib/d_logicmod.cc6
-rw-r--r--lib/d_subckt.cc133
-rw-r--r--lib/e_base.cc18
-rw-r--r--lib/e_card.cc16
-rw-r--r--lib/e_cardlist.cc28
-rw-r--r--lib/e_compon.cc108
-rw-r--r--lib/e_elemnt.cc136
-rw-r--r--lib/e_logicnode.cc325
-rw-r--r--lib/e_logicval.cc64
-rw-r--r--lib/e_node.cc343
-rw-r--r--lib/e_paramlist.cc4
-rw-r--r--lib/io_error.cc2
-rw-r--r--lib/l_dispatcher.cc29
-rw-r--r--lib/m_base_in.cc45
-rw-r--r--lib/m_base_math.cc2
-rw-r--r--lib/m_expression_dump.cc47
-rw-r--r--lib/m_expression_in.cc92
-rw-r--r--lib/m_expression_reduce.cc240
-rw-r--r--lib/u_lang.cc8
-rw-r--r--lib/u_opt2.cc10
-rw-r--r--lib/u_parameter.cc33
-rw-r--r--lib/u_prblst.cc25
-rw-r--r--lib/u_sim_data.cc20
-rw-r--r--main/Make.depend9
-rw-r--r--main/Make116
-rw-r--r--main/Make2.Debug97
-rw-r--r--main/Make2.g++57
-rw-r--r--main/Make2.mingw3245
-rwxr-xr-xmain/configure62
-rw-r--r--main/main.cc20
-rw-r--r--man/gnucap-modelgen.142
-rw-r--r--man/gnucap.1102
-rw-r--r--modelgen/Make116
-rw-r--r--modelgen/Make2.g++57
-rw-r--r--modelgen/Make2.mingw3246
-rwxr-xr-xmodelgen/configure36
l---------modelgen/gnucap-modelgen1
-rw-r--r--modelgen/mg_.h84
-rw-r--r--modelgen/mg_out_h.cc106
-rw-r--r--tests/==out/bm_fit.0.1.ckt.out5
-rw-r--r--tests/==out/bm_fit.1.1.ckt.out5
-rw-r--r--tests/==out/bm_fit.2.1.ckt.out5
-rw-r--r--tests/==out/bm_fit.2.2.ckt.out5
-rw-r--r--tests/==out/bm_fit.2.3.ckt.out5
-rw-r--r--tests/==out/bm_fit.3.3.ckt.out5
-rw-r--r--tests/==out/bm_table.1.1.ckt.out5
-rw-r--r--tests/==out/bm_table.2.1.ckt.out5
-rw-r--r--tests/==out/bm_table.2.3.ckt.out5
-rw-r--r--tests/==out/bm_table.2.4.ckt.out5
-rw-r--r--tests/==out/bm_table.3.1.ckt.out5
-rw-r--r--tests/==out/bm_table.3.2.ckt.out5
-rw-r--r--tests/==out/bm_table.3.3.ckt.out5
-rw-r--r--tests/==out/bm_tanh.1.ckt.out5
-rw-r--r--tests/==out/bm_tanh.2.ckt.out5
-rw-r--r--tests/==out/bmm_res.4.ckt.out9
-rw-r--r--tests/==out/bmm_res.4p.ckt.out9
-rw-r--r--tests/==out/c_eval.1.ckt.out4
-rw-r--r--tests/==out/c_eval.2.ckt.out12
-rw-r--r--tests/==out/c_eval.3.ckt.out11
-rw-r--r--tests/==out/c_eval.error.0.ckt.out8
-rw-r--r--tests/==out/d_bjt-diffpair-dc.ckt.out5
-rw-r--r--tests/==out/d_ccvs.2.ckt.out5
-rw-r--r--tests/==out/d_diode.1.ckt.out8
-rw-r--r--tests/==out/d_diode.12.ckt.out9
-rw-r--r--tests/==out/d_diode.2.ckt.out5
-rw-r--r--tests/==out/d_diode.3.ckt.out6
-rw-r--r--tests/==out/d_diode.4.ckt.out8
-rw-r--r--tests/==out/d_diode.5.ckt.out8
-rw-r--r--tests/==out/d_diode.6.ckt.out8
-rw-r--r--tests/==out/d_diode.7.ckt.out8
-rw-r--r--tests/==out/d_diode.8.ckt.out8
-rw-r--r--tests/==out/d_diode.9.ckt.out8
-rw-r--r--tests/==out/d_logic.1.ckt.out6
-rw-r--r--tests/==out/d_logic.1.gc.out37
-rw-r--r--tests/==out/d_logic.2.ckt.out6
-rw-r--r--tests/==out/d_logic.2.gc.out60
-rw-r--r--tests/==out/d_logic.3.ckt.out4
-rw-r--r--tests/==out/d_logic.7.ckt.out12
-rw-r--r--tests/==out/d_logic.evt.0.gc.out2
-rw-r--r--tests/==out/d_logic.evt.1.gc.out4
-rw-r--r--tests/==out/d_logic_nand-dc.ckt.out5
-rw-r--r--tests/==out/d_logic_tr_ab1.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_ab2.ckt.out6
-rw-r--r--tests/==out/d_logic_tr_an1.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_an2.ckt.out6
-rw-r--r--tests/==out/d_logic_tr_db1.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_db2.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_dn1.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_dn2.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_mb1a.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_mb1b.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_mb2a.ckt.out6
-rw-r--r--tests/==out/d_logic_tr_mb2b.ckt.out6
-rw-r--r--tests/==out/d_logic_tr_mn1a.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_mn1b.ckt.out4
-rw-r--r--tests/==out/d_logic_tr_mn2a.ckt.out6
-rw-r--r--tests/==out/d_logic_tr_mn2b.ckt.out6
-rw-r--r--tests/==out/d_res.1a.gc.out36
-rw-r--r--tests/==out/d_res.1b.gc.out39
-rw-r--r--tests/==out/d_res.1c.gc.out31
-rw-r--r--tests/==out/d_res.bug.0.gc.out24
-rw-r--r--tests/==out/d_res.bug.2.ckt.out29
-rw-r--r--tests/==out/d_res.bug.2fit.ckt.out28
-rw-r--r--tests/==out/d_res.neg.0.ckt.out25
-rw-r--r--tests/==out/d_res.restore.0.gc.out27
-rw-r--r--tests/==out/d_res.short.0.gc.out78
-rw-r--r--tests/==out/d_res.short.1.gc.out78
-rw-r--r--tests/==out/d_res.short.2.gc.out36
-rw-r--r--tests/==out/d_subckt.delete.0.ckt.out6
-rw-r--r--tests/==out/d_switch.c1.ckt.out4
-rw-r--r--tests/==out/d_switch.c1.inc.ckt.out22
-rw-r--r--tests/==out/d_switch.c1a.ckt.out163
-rw-r--r--tests/==out/d_vcvs.1.ckt.out5
-rw-r--r--tests/==out/d_vcvs.2.ckt.out5
-rw-r--r--tests/==out/dc_temp.gc.out5
-rw-r--r--tests/==out/insensitive.0.gc.out15
-rw-r--r--tests/==out/lang_verilog.1.gc.out6
-rw-r--r--tests/==out/lang_verilog.1a.gc.out6
-rw-r--r--tests/==out/lang_verilog.2.gc.out6
-rw-r--r--tests/==out/lang_verilog.3.gc.out6
-rw-r--r--tests/==out/ll1.ckt.out9
-rw-r--r--tests/==out/m_expr.array.0.gc.out5
-rw-r--r--tests/==out/m_expr.error.0.gc.out5
-rw-r--r--tests/==out/m_expr.error.0a.gc.out22
-rw-r--r--tests/==out/m_expression.0.gc.out52
-rw-r--r--tests/==out/m_expression.1.gc.out49
-rw-r--r--tests/==out/m_expression.2.gc.out18
-rw-r--r--tests/==out/m_expression.3.gc.out25
-rw-r--r--tests/==out/m_expression.4.gc.out12
-rw-r--r--tests/==out/m_expression.7.gc.out19
-rw-r--r--tests/==out/m_expression.error.1.ckt.out3
-rw-r--r--tests/==out/param.8.ckt.out9
-rw-r--r--tests/==out/param.dollar.gc.out2
-rw-r--r--tests/==out/s_dc.admit.gc.out22
-rw-r--r--tests/==out/s_dc.bin1.ckt.out9
-rw-r--r--tests/==out/s_dc.bug0.gc.out14
-rw-r--r--tests/==out/s_dc.cccs0.gc.out4
-rw-r--r--tests/==out/s_dc.res0.gc.out21
-rw-r--r--tests/==out/s_dc.sqrt.0.gc.out11
-rw-r--r--tests/==out/s_dc.sweep.1.gc.out34
-rw-r--r--tests/==out/s_dc.sweep.2.gc.out27
-rw-r--r--tests/==out/s_dc.sweep.3.gc.out7
-rw-r--r--tests/==out/s_dc.vcg0.gc.out4
-rw-r--r--tests/==out/s_dc.vcvs0.gc.out4
-rw-r--r--tests/==out/s_dc.vcvs1.gc.out4
-rw-r--r--tests/==out/s_dc.vs0.gc.out4
-rw-r--r--tests/==out/s_dc.vs1.gc.out4
-rw-r--r--tests/==out/s_dc_noprint.gc.out9
-rw-r--r--tests/==out/temp.1.gc.out6
-rw-r--r--tests/==out/trcurve.ckt.out5
-rw-r--r--tests/==out/trcurve2.ckt.out5
-rw-r--r--tests/==out/trcurves.ckt.out5
-rw-r--r--tests/==out/u_attrib.1.gc.out53
-rw-r--r--tests/==out/u_attrib.2.gc.out47
-rw-r--r--tests/==out/u_attrib.3.gc.out107
-rw-r--r--tests/==out/u_attrib.4.gc.out163
-rw-r--r--tests/bm_fit.0.1.ckt1
-rw-r--r--tests/bm_fit.1.1.ckt1
-rw-r--r--tests/bm_fit.2.1.ckt1
-rw-r--r--tests/bm_fit.2.2.ckt1
-rw-r--r--tests/bm_fit.2.3.ckt1
-rw-r--r--tests/bm_fit.3.3.ckt1
-rw-r--r--tests/bm_table.1.1.ckt1
-rw-r--r--tests/bm_table.2.1.ckt1
-rw-r--r--tests/bm_table.2.3.ckt1
-rw-r--r--tests/bm_table.2.4.ckt1
-rw-r--r--tests/bm_table.3.1.ckt1
-rw-r--r--tests/bm_table.3.2.ckt1
-rw-r--r--tests/bm_table.3.3.ckt1
-rw-r--r--tests/bm_tanh.1.ckt1
-rw-r--r--tests/bm_tanh.2.ckt1
-rw-r--r--tests/bmm_res.4.ckt3
-rw-r--r--tests/bmm_res.4p.ckt3
-rw-r--r--tests/c_eval.2.ckt10
-rw-r--r--tests/c_eval.3.ckt17
-rw-r--r--tests/c_eval.error.0.ckt8
-rw-r--r--tests/d_bjt-diffpair-dc.ckt1
-rw-r--r--tests/d_ccvs.1.ckt1
-rw-r--r--tests/d_ccvs.2.ckt1
-rw-r--r--tests/d_diode.2.ckt1
-rw-r--r--tests/d_logic.01.critclock.gc2
-rw-r--r--tests/d_logic.01.overclock.gc2
-rw-r--r--tests/d_logic.01.underclock.gc2
-rw-r--r--tests/d_logic.02.critclock.gc2
-rw-r--r--tests/d_logic.02.overclock.gc2
-rw-r--r--tests/d_logic.02.underclock.gc2
-rw-r--r--tests/d_logic.1.ckt17
-rw-r--r--tests/d_logic.1.gc60
-rw-r--r--tests/d_logic.2.ckt17
-rw-r--r--tests/d_logic.2.gc42
-rw-r--r--tests/d_logic.3.ckt17
-rw-r--r--tests/d_logic.4.ckt12
-rw-r--r--tests/d_logic.5.ckt12
-rw-r--r--tests/d_logic.6.ckt12
-rw-r--r--tests/d_logic.7.ckt12
-rw-r--r--tests/d_logic.evt.0.gc2
-rw-r--r--tests/d_logic.evt.1.gc4
-rw-r--r--tests/d_logic_nand-dc.ckt5
-rw-r--r--tests/d_logic_tr_ab1.ckt7
-rw-r--r--tests/d_logic_tr_ab2.ckt9
-rw-r--r--tests/d_logic_tr_an1.ckt7
-rw-r--r--tests/d_logic_tr_an2.ckt9
-rw-r--r--tests/d_logic_tr_db1.ckt7
-rw-r--r--tests/d_logic_tr_db2.ckt9
-rw-r--r--tests/d_logic_tr_dn1.ckt7
-rw-r--r--tests/d_logic_tr_dn2.ckt9
-rw-r--r--tests/d_logic_tr_mb1a.ckt7
-rw-r--r--tests/d_logic_tr_mb1b.ckt7
-rw-r--r--tests/d_logic_tr_mb2a.ckt9
-rw-r--r--tests/d_logic_tr_mb2b.ckt9
-rw-r--r--tests/d_logic_tr_mn1a.ckt7
-rw-r--r--tests/d_logic_tr_mn1b.ckt7
-rw-r--r--tests/d_logic_tr_mn2a.ckt9
-rw-r--r--tests/d_logic_tr_mn2b.ckt9
-rw-r--r--tests/d_res.1a.gc18
-rw-r--r--tests/d_res.1b.gc17
-rw-r--r--tests/d_res.1c.gc17
-rw-r--r--tests/d_res.bug.0.gc17
-rw-r--r--tests/d_res.bug.2.ckt11
-rw-r--r--tests/d_res.bug.2fit.ckt12
-rw-r--r--tests/d_res.neg.0.ckt35
-rw-r--r--tests/d_res.restore.0.gc16
-rw-r--r--tests/d_res.short.0.gc16
-rw-r--r--tests/d_res.short.1.gc15
-rw-r--r--tests/d_res.short.2.gc16
-rw-r--r--tests/d_vcvs.1.ckt1
-rw-r--r--tests/d_vcvs.2.ckt1
-rw-r--r--tests/dc_temp.gc1
-rw-r--r--tests/insensitive.0.gc20
-rw-r--r--tests/m_expr.array.0.gc12
-rw-r--r--tests/m_expr.error.0.gc3
-rw-r--r--tests/m_expr.error.0a.gc10
-rw-r--r--tests/m_expression.0.gc33
-rw-r--r--tests/m_expression.1.gc33
-rw-r--r--tests/m_expression.2.gc13
-rw-r--r--tests/m_expression.3.gc15
-rw-r--r--tests/m_expression.4.gc9
-rw-r--r--tests/m_expression.7.gc12
-rw-r--r--tests/param.8.ckt3
-rw-r--r--tests/param.dollar.gc6
-rw-r--r--tests/s_dc.admit.gc25
-rw-r--r--tests/s_dc.bin1.ckt13
-rw-r--r--tests/s_dc.bug0.gc19
-rw-r--r--tests/s_dc.cccs0.gc16
-rw-r--r--tests/s_dc.res0.gc21
-rw-r--r--tests/s_dc.sqrt.0.gc13
-rw-r--r--tests/s_dc.sweep.1.gc31
-rw-r--r--tests/s_dc.sweep.2.gc51
-rw-r--r--tests/s_dc.sweep.3.gc15
-rw-r--r--tests/s_dc.vcg0.gc15
-rw-r--r--tests/s_dc.vcvs0.gc7
-rw-r--r--tests/s_dc.vcvs1.gc14
-rw-r--r--tests/s_dc.vs0.gc15
-rw-r--r--tests/s_dc.vs1.gc12
-rw-r--r--tests/s_dc_noprint.gc6
-rw-r--r--tests/temp.1.gc1
-rw-r--r--tests/trcurve.ckt1
-rw-r--r--tests/trcurve2.ckt1
-rw-r--r--tests/trcurves.ckt1
-rw-r--r--tests/u_attrib.1.gc32
-rw-r--r--tests/u_attrib.2.gc29
-rw-r--r--tests/u_attrib.3.gc64
-rw-r--r--tests/u_attrib.4.gc100
402 files changed, 8660 insertions, 4697 deletions
diff --git a/Makefile b/Makefile
index b596200a..f86e51f5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,15 @@
-gnucap: nothing
- #(cd include; ${MAKE} gnucap)
+gnucap:
+ #(cd conf; ${MAKE} -k)
+ #(cd include; ${MAKE} -k)
(cd lib; ${MAKE} -k)
(cd modelgen; ${MAKE} -k)
(cd main; ${MAKE} -k)
(cd apps; ${MAKE} -k)
debug:
+ #(cd conf; ${MAKE} debug)
#(cd include; ${MAKE} debug)
(cd lib; ${MAKE} debug)
(cd modelgen; ${MAKE} debug)
@@ -15,20 +17,15 @@ debug:
(cd apps; ${MAKE} debug)
g++:
+ #(cd conf; ${MAKE} g++)
#(cd include; ${MAKE} g++)
(cd lib; ${MAKE} g++)
(cd modelgen; ${MAKE} g++)
(cd main; ${MAKE} g++)
(cd apps; ${MAKE} g++)
-mingw:
- #(cd include; ${MAKE} mingw)
- (cd lib; ${MAKE} mingw)
- (cd modelgen; ${MAKE} mingw)
- (cd main; ${MAKE} mingw)
- (cd apps; ${MAKE} mingw)
-
clean:
+ #(cd conf; ${MAKE} clean)
#(cd include; ${MAKE} clean)
(cd lib; ${MAKE} clean)
(cd modelgen; ${MAKE} clean)
@@ -37,6 +34,7 @@ clean:
-rm *~ \#*\#
depend:
+ #(cd conf; ${MAKE} depend)
#(cd include; ${MAKE} depend)
(cd lib; ${MAKE} depend)
(cd modelgen; ${MAKE} depend)
@@ -44,6 +42,7 @@ depend:
(cd apps; ${MAKE} depend)
tags:
+ #(cd conf; ${MAKE} tags)
#(cd include; ${MAKE} tags)
(cd lib; ${MAKE} tags)
(cd modelgen; ${MAKE} tags)
@@ -51,27 +50,31 @@ tags:
(cd apps; ${MAKE} tags)
unconfig:
+ #(cd conf; ${MAKE} unconfig)
#(cd include; ${MAKE} unconfig)
(cd lib; ${MAKE} unconfig)
(cd modelgen; ${MAKE} unconfig)
(cd main; ${MAKE} unconfig)
(cd apps; ${MAKE} unconfig)
-install: nothing
+install:
+ (cd conf; ${MAKE} install)
(cd include; ${MAKE} install)
(cd lib; ${MAKE} install)
(cd modelgen; ${MAKE} install)
(cd main; ${MAKE} install)
(cd apps; ${MAKE} install)
-install-debug: nothing
+install-debug:
+ (cd conf; ${MAKE} install-debug)
(cd include; ${MAKE} install-debug)
(cd lib; ${MAKE} install-debug)
(cd modelgen; ${MAKE} install-debug)
(cd main; ${MAKE} install-debug)
(cd apps; ${MAKE} install-debug)
-uninstall: nothing
+uninstall:
+ (cd conf; ${MAKE} uninstall)
(cd include; ${MAKE} uninstall)
(cd lib; ${MAKE} uninstall)
(cd modelgen; ${MAKE} uninstall)
@@ -79,6 +82,7 @@ uninstall: nothing
(cd apps; ${MAKE} uninstall)
manifest:
+ (cd conf; ${MAKE} manifest)
(cd include; ${MAKE} manifest)
(cd lib; ${MAKE} manifest)
(cd modelgen; ${MAKE} manifest)
@@ -86,6 +90,7 @@ manifest:
(cd apps; ${MAKE} manifest)
header-check:
+ (cd conf; ${MAKE} header-check)
(cd include; ${MAKE} header-check)
(cd lib; ${MAKE} header-check)
(cd modelgen; ${MAKE} header-check)
@@ -99,5 +104,4 @@ checkin:
$(MAKE) date
-git commit -a
-nothing:
-
+.PHONY: install
diff --git a/Makefile.template b/Makefile.template
index cd9a5e1f..20c890ec 100644
--- a/Makefile.template
+++ b/Makefile.template
@@ -29,7 +29,7 @@
# The default is to use the makefile built by "configure"
default: nothing
mkdir -p O
- cat Make1 Make2 ../Make3 Make.depend >O/Makefile
+ cat Make1 Make2 ../include/Make3 Make.depend >O/Makefile
(cd O; ${MAKE} -k)
#-----------------------------------------------------------------------------
# The most common configuration is g++
@@ -38,7 +38,7 @@ default: nothing
# It is optimized for speed. Debugging is off.
g++: nothing
mkdir -p O
- cat Make1 Make2.g++ ../Make3 Make.depend >O/Makefile
+ cat Make1 ../include/Make2.g++ ../include/Make3 Make.depend >O/Makefile
(cd O; ${MAKE} -k)
#-----------------------------------------------------------------------------
# This one makes a "debug" build ...
@@ -48,30 +48,35 @@ g++: nothing
# It doesn't mean TOTALLY untested.
debug: nothing
mkdir -p O-DEBUG
- cat Make1 Make2.Debug ../Make3 Make.depend >O-DEBUG/Makefile
+ cat Make1 ../include/Make2.Debug ../include/Make3 Make.depend >O-DEBUG/Makefile
(cd O-DEBUG; ${MAKE} -k)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# MS Windows using mingw32
-mingw: nothing
- mkdir -p MSW
- cat Make1 Make2.mingw32 ../Make3 Make.depend >MSW/Makefile
- (cd MSW; ${MAKE} -k)
+# unmaintained, stale. Holding stuib here pending further work.
+#mingw: nothing
+# mkdir -p MSW
+# cat Make1 Make2.mingw32 ../include/Make3 Make.depend >MSW/Makefile
+# (cd MSW; ${MAKE} -k)
#-----------------------------------------------------------------------------
tags: nothing
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
(${MAKE} tags -f Make.aux)
#-----------------------------------------------------------------------------
depend: nothing
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux depend
#-----------------------------------------------------------------------------
checkin: nothing
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux checkin
#-----------------------------------------------------------------------------
checkout: nothing
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux checkout
#-----------------------------------------------------------------------------
install: nothing
@@ -83,7 +88,8 @@ install-debug: nothing
(cd O-DEBUG; ${MAKE} install)
#-----------------------------------------------------------------------------
uninstall: nothing
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux uninstall
#-----------------------------------------------------------------------------
# Note that the /usr/local directory is overwritten by configure.
@@ -102,32 +108,40 @@ unconfig:
rm -f Makefile
#-----------------------------------------------------------------------------
date: nothing
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux date
#-----------------------------------------------------------------------------
header-check:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux header-check
#-----------------------------------------------------------------------------
manifest:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux manifest
#-----------------------------------------------------------------------------
md5sums:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux md5sums
#-----------------------------------------------------------------------------
mostlyclean:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux mostlyclean
clean:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux clean
distclean:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux distclean
maintainer-clean:
- cat Make1 Make2 ../Make3 >Make.aux
+ rm -f Make.aux
+ cat Make1 Make2 ../include/Make3 >Make.aux
${MAKE} -f Make.aux maintainer-clean
#-----------------------------------------------------------------------------
nothing:
diff --git a/NEWS b/NEWS
index e69de29b..f42bb183 100644
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,62 @@
+NEWS for Gnucap. Each snapshot corresponds to a tag in the git repository and
+associated tarball. This file summarizes the important changes.
+
+== 20240220
+
+- prepare build system files for use in extension packages
+- support for directories in attach plugin
+- Tokenize Verilog-AMS arrays
+- local search for gnucap.rc, see manual
+- Library improvements related to Verilog-AMS
+
+== development snapshot 20231131
+
+- instanciate logic devices using any language
+- VAMS LRM compliant logic device ports
+
+== development snapshot 20231031
+
+- attribute instance
+
+== development snapshot 20230930
+
+- revisit resistor short condition handling
+- fix uninitialised access in getlines
+- fix a mem leak in ternary op
+- add CS::reset_fail
+- parse string in angle brackets
+
+== development snapshot 20230729
+
+- white space in quoted strings
+- escaped chars in quoted strings
+- more testing and interactive testing
+- typed NOT_INPUT override
+- version presented at fsic23
+
+== development snapshot 20230623
+
+This is a development snapshot addressing expression handling.
+
+- ternary operator
+- modulo binary operator
+- quoted strings
+
+== development snapshot 20230520
+
+- param eval recursion bugfix
+- allow '$' in identifiers
+- add man pages from Debian
+
+== development snapshot 20230214
+
+This snapshot relates to new Verilog-AMS work.
+
+- module overloading interface
+- allow '$' in identifiers
+- explicitly specify c++11 during build
+- move COMPONENT::_value to ELEMENT
+- ELEMENT cleanup and parameter sweeps
+- "override" decorators
+- more scope flexibility in commands
+- fix case insensitivity in label compare
diff --git a/README b/README
index 080daf2c..e4f4df54 100644
--- a/README
+++ b/README
@@ -1,4 +1,18 @@
-Readme for development snapshot 2013-04-23
+This directory contains the 20240131 Gnucap Release
+
+Gnucap is a modular mixed-signal circuit simulator that partially implements
+Verilog-AMS, that aspires to eventually implement the complete language.
+
+The full manual is available as a wiki at http://gnucap.org.
+
+Combined with Modelgen-Verilog, this release concludes the project on
+Verilog-AMS funded through the NGI0 Entrust Fund, a fund established by NLnet
+with financial support from the European Commission's Next Generation Internet
+programme, under the aegis of DG Communications Networks, Content and
+Technology under grant agreement No 101069594. See
+https://nlnet.nl/project/Gnucap-VerilogAMS/
+
+== old Readme, development snapshot 2013-04-23
This is a development snapshot. As such, there may be problems due to
new work.
diff --git a/apps/Make.depend b/apps/Make.depend
index ecf8d7b7..c4c14c36 100644
--- a/apps/Make.depend
+++ b/apps/Make.depend
@@ -1,479 +1,384 @@
-d_mos1.o: d_mos1.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos1.h d_mos123.h d_mos_base.h d_mos.h d_diode.h \
- ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_mos2.o: d_mos2.cc ../include/l_compar.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_denoise.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/e_base.h \
- ../include/l_stlextra.h ../include/ap.h ../include/e_elemnt.h \
+d_admit.o: d_admit.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h d_mos2.h d_mos123.h \
- d_mos_base.h d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
- ../include/e_subckt.h ../include/e_model.h
-d_mos3.o: d_mos3.cc ../include/l_denoise.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
- ../include/ap.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos3.h d_mos123.h d_mos_base.h d_mos.h d_diode.h \
- ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_mos4.o: d_mos4.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos4.h d_mos_base.h d_mos.h d_diode.h \
- ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_mos5.o: d_mos5.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_cardlist.h ../include/e_card.h
+d_cap.o: d_cap.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_storag.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos5.h d_mos_base.h d_mos.h d_diode.h \
- ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_mos6.o: d_mos6.cc ../include/l_denoise.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
- ../include/ap.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos6.h d_mos123.h d_mos_base.h d_mos.h d_diode.h \
- ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_mos7.o: d_mos7.cc ../include/l_compar.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_denoise.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/e_base.h \
- ../include/l_stlextra.h ../include/ap.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h d_mos7.h d_mos_base.h \
- d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
- ../include/e_subckt.h ../include/e_model.h
-d_mos8.o: d_mos8.cc ../include/l_compar.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_denoise.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/e_base.h \
- ../include/l_stlextra.h ../include/ap.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h d_mos8.h d_mos_base.h \
- d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
- ../include/e_subckt.h ../include/e_model.h
-d_mos123.o: d_mos123.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_card.h
+d_cccs.o: d_cccs.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_ccsrc.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos123.h d_mos_base.h d_mos.h d_diode.h \
- ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_mos_base.o: d_mos_base.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_mos_base.h d_mos.h d_diode.h ../include/u_sdp.h \
- ../include/e_node.h ../include/e_subckt.h ../include/e_model.h
-d_mos.o: d_mos.cc ../include/u_limit.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/e_storag.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/u_opt.h \
+ ../include/e_card.h
+d_ccvs.o: d_ccvs.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/ap.h \
- ../include/e_cardlist.h ../include/e_card.h d_mos_base.h d_mos.h \
- d_diode.h ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_elemnt.h
-d_bjt.o: d_bjt.cc ../include/u_limit.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h d_bjt.h d_diode.h ../include/u_sdp.h \
- ../include/e_node.h ../include/e_subckt.h ../include/e_model.h
-d_diode.o: d_diode.cc ../include/e_aux.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_compar.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/e_storag.h ../include/e_elemnt.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/ap.h ../include/e_cardlist.h ../include/e_card.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/e_elemnt.h \
- d_diode.h ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
- ../include/e_model.h
-d_admit.o: d_admit.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_ccsrc.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h
-d_cap.o: d_cap.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_storag.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
-d_cccs.o: d_cccs.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_ccsrc.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
-d_ccvs.o: d_ccvs.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_ccsrc.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
d_coil.o: d_coil.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/e_subckt.h ../include/e_compon.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h ../include/e_ccsrc.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_storag.h
+ ../include/e_logicnode.h ../include/e_logicval.h ../include/e_node.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_storag.h
d_cs.o: d_cs.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
d_poly_g.o: d_poly_g.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
-d_poly_cap.o: d_poly_cap.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/e_storag.h ../include/e_elemnt.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/e_cardlist.h ../include/e_card.h
-d_res.o: d_res.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+d_poly_cap.o: d_poly_cap.cc ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_storag.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h
+d_res.o: d_res.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
d_switch.o: d_switch.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/e_model.h ../include/u_parameter.h ../include/m_expression.h \
../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h
+ ../include/e_card.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h
d_trln.o: d_trln.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
../include/m_cpoly.h ../include/constant.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h
-d_vcg.o: d_vcg.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/e_logicnode.h ../include/e_logicval.h ../include/e_node.h \
+ ../include/u_sim_data.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h
+d_vcg.o: d_vcg.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
d_vcr.o: d_vcr.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
d_vcvs.o: d_vcvs.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
d_vs.o: d_vs.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
d_meter.o: d_meter.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/u_xprobe.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/u_xprobe.h
+d_logic.o: d_logic.cc ../include/e_logicmod.h ../include/e_model.h \
+ ../include/u_parameter.h ../include/u_opt.h ../include/mode.h \
+ ../include/io_.h ../include/l_lib.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/m_expression.h \
+ ../include/m_base.h ../include/ap.h ../include/constant.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/l_indirect.h ../include/u_lang.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/l_stlextra.h \
+ ../include/e_subckt.h ../include/e_compon.h ../include/u_sim_data.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/u_time_pair.h \
+ ../include/u_xprobe.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/m_cpoly.h \
+ ../include/l_denoise.h
bm_complex.o: bm_complex.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/bm.h
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/bm.h
bm_exp.o: bm_exp.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/u_lang.h \
+ ../include/bm.h
+bm_fit.o: bm_fit.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/u_lang.h ../include/bm.h
-bm_fit.o: bm_fit.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h ../include/m_spline.h ../include/bm.h
bm_generator.o: bm_generator.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/bm.h
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/bm.h
bm_model.o: bm_model.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/e_model.h ../include/u_parameter.h ../include/m_expression.h \
../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
../include/e_card.h ../include/bm.h ../include/e_compon.h \
../include/u_sim_data.h ../include/l_compar.h ../include/m_matrix.h \
../include/u_time_pair.h
bm_poly.o: bm_poly.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h ../include/bm.h
bm_posy.o: bm_posy.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/bm.h
-bm_pulse.o: bm_pulse.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/u_lang.h ../include/bm.h
+ ../include/e_card.h ../include/bm.h
+bm_pulse.o: bm_pulse.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/u_lang.h \
+ ../include/bm.h
bm_pwl.o: bm_pwl.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/m_interp.h ../include/bm.h
-bm_sffm.o: bm_sffm.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/l_denoise.h ../include/u_lang.h \
- ../include/bm.h
+ ../include/e_card.h ../include/m_interp.h ../include/bm.h
+bm_sffm.o: bm_sffm.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/l_denoise.h \
+ ../include/u_lang.h ../include/bm.h
bm_sin.o: bm_sin.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/u_lang.h \
+ ../include/l_denoise.h ../include/bm.h
+bm_tanh.o: bm_tanh.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/u_lang.h ../include/l_denoise.h \
- ../include/bm.h
-bm_tanh.o: bm_tanh.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h ../include/bm.h
bmm_table.o: bmm_table.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h ../include/m_spline.h ../include/e_model.h \
../include/bm.h
bmm_semi.o: bmm_semi.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_lang.h ../include/e_model.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/constant.h \
../include/e_cardlist.h ../include/e_card.h ../include/bm.h \
../include/e_compon.h ../include/u_sim_data.h ../include/l_compar.h \
../include/m_matrix.h ../include/u_time_pair.h
c_clear.o: c_clear.cc ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/globals.h ../include/l_dispatcher.h \
../include/l_stlextra.h ../include/u_opt.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/ap.h
+ ../include/io_.h ../include/l_lib.h
c_comand.o: c_comand.cc ../include/constant.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/c_comand.h \
- ../include/e_card.h ../include/e_base.h ../include/globals.h \
+ ../include/e_card.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/globals.h \
../include/l_dispatcher.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h
+ ../include/mode.h ../include/io_.h ../include/l_lib.h
c_delete.o: c_delete.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/e_cardlist.h ../include/c_comand.h ../include/e_card.h
c_exp.o: c_exp.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_expression.h ../include/m_base.h ../include/constant.h \
../include/c_comand.h ../include/e_card.h
c_genrat.o: c_genrat.cc ../include/u_sim_data.h ../include/constant.h \
@@ -481,82 +386,92 @@ c_genrat.o: c_genrat.cc ../include/u_sim_data.h ../include/constant.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/ap.h ../include/c_comand.h \
- ../include/e_card.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/c_comand.h ../include/e_card.h
c_help.o: c_help.cc ../include/l_dispatcher.h ../include/e_base.h \
- ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/u_attrib.h ../include/ap.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_indirect.h \
../include/l_stlextra.h ../include/u_opt.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/c_comand.h ../include/e_card.h ../include/globals.h \
- ../include/l_dispatcher.h
+ ../include/io_.h ../include/l_lib.h ../include/c_comand.h \
+ ../include/e_card.h ../include/globals.h ../include/l_dispatcher.h
c_list.o: c_list.cc ../include/e_cardlist.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/u_lang.h \
- ../include/e_base.h ../include/u_opt.h ../include/mode.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/c_comand.h \
../include/e_card.h ../include/globals.h ../include/l_dispatcher.h \
- ../include/l_stlextra.h ../include/ap.h
+ ../include/l_stlextra.h
c_measure.o: c_measure.cc ../include/u_parameter.h ../include/u_opt.h \
../include/mode.h ../include/io_.h ../include/l_lib.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/m_expression.h \
../include/m_base.h ../include/ap.h ../include/constant.h \
../include/e_cardlist.h ../include/u_function.h ../include/e_base.h \
- ../include/c_comand.h ../include/e_card.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/l_stlextra.h
+ ../include/u_attrib.h ../include/l_indirect.h ../include/c_comand.h \
+ ../include/e_card.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/l_stlextra.h
c_modify.o: c_modify.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/u_cardst.h ../include/c_comand.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/u_cardst.h \
+ ../include/e_elemnt.h ../include/c_comand.h
c_param.o: c_param.cc ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/u_parameter.h ../include/u_opt.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/u_parameter.h ../include/u_opt.h \
../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/m_expression.h ../include/m_base.h ../include/ap.h \
- ../include/constant.h ../include/e_cardlist.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/l_stlextra.h
+ ../include/m_expression.h ../include/m_base.h ../include/constant.h \
+ ../include/e_cardlist.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/l_stlextra.h
c_prbcmd.o: c_prbcmd.cc ../include/u_sim_data.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/u_prblst.h ../include/u_probe.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/ap.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/u_prblst.h ../include/u_probe.h \
+ ../include/globals.h ../include/l_dispatcher.h
c_status.o: c_status.cc ../include/u_sim_data.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/u_status.h ../include/l_timer.h \
../include/c_comand.h ../include/e_card.h ../include/e_base.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/ap.h
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/globals.h ../include/l_dispatcher.h
c_sweep.o: c_sweep.cc ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/globals.h ../include/l_dispatcher.h \
../include/l_stlextra.h ../include/u_opt.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/ap.h
+ ../include/io_.h ../include/l_lib.h
c_sim.o: c_sim.cc ../include/u_sim_data.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/globals.h ../include/l_dispatcher.h \
- ../include/ap.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/globals.h ../include/l_dispatcher.h
c_system.o: c_system.cc ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/globals.h ../include/l_dispatcher.h \
../include/l_stlextra.h ../include/u_opt.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/ap.h
+ ../include/io_.h ../include/l_lib.h
s__init.o: s__init.cc ../include/e_cardlist.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/u_status.h \
../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/l_timer.h ../include/u_sim_data.h ../include/constant.h \
../include/l_compar.h ../include/u_opt.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/s__.h ../include/c_comand.h \
- ../include/e_card.h ../include/e_base.h
+ ../include/e_card.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h
s__out.o: s__out.cc ../include/u_sim_data.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
@@ -564,40 +479,47 @@ s__out.o: s__out.cc ../include/u_sim_data.h ../include/constant.h \
../include/l_stlextra.h ../include/u_status.h ../include/l_timer.h \
../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
../include/m_cpoly.h ../include/u_prblst.h ../include/u_probe.h \
- ../include/e_base.h ../include/declare.h ../include/s__.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/declare.h ../include/s__.h \
../include/c_comand.h ../include/e_card.h
s__solve.o: s__solve.cc ../include/e_cardlist.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/u_status.h \
../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/l_timer.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/u_opt.h \
- ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/s__.h ../include/c_comand.h ../include/e_card.h
+ ../include/l_timer.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/u_opt.h ../include/m_matrix.h \
+ ../include/l_stlextra.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/s__.h \
+ ../include/c_comand.h ../include/e_card.h
s_ac.o: s_ac.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
../include/m_matrix.h ../include/u_status.h ../include/l_timer.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/e_cardlist.h ../include/u_prblst.h ../include/u_probe.h \
../include/s__.h ../include/c_comand.h ../include/e_card.h
s_dc.o: s_dc.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_status.h ../include/l_timer.h ../include/u_prblst.h \
../include/u_probe.h ../include/l_compar.h ../include/u_cardst.h \
- ../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
- ../include/m_matrix.h ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
+ ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/s__.h \
+ ../include/e_card.h ../include/e_elemnt.h ../include/s__.h \
../include/c_comand.h
s_fo.o: s_fo.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
../include/m_matrix.h ../include/u_status.h ../include/l_timer.h \
../include/m_phase.h ../include/declare.h ../include/u_prblst.h \
@@ -605,9 +527,10 @@ s_fo.o: s_fo.cc ../include/globals.h ../include/l_dispatcher.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/s__.h ../include/c_comand.h ../include/e_card.h
s_tr.o: s_tr.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
../include/m_matrix.h ../include/u_status.h ../include/l_timer.h \
../include/s_tr.h ../include/u_parameter.h ../include/m_expression.h \
@@ -618,10 +541,11 @@ s_tr_set.o: s_tr_set.cc ../include/u_sim_data.h ../include/constant.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/u_prblst.h ../include/u_probe.h \
- ../include/e_base.h ../include/ap.h ../include/s_tr.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/ap.h ../include/s_tr.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/ap.h ../include/e_cardlist.h ../include/s__.h \
- ../include/c_comand.h ../include/e_card.h
+ ../include/e_cardlist.h ../include/s__.h ../include/c_comand.h \
+ ../include/e_card.h
s_tr_swp.o: s_tr_swp.cc ../include/u_time_pair.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/u_sim_data.h ../include/l_compar.h ../include/u_opt.h \
@@ -630,44 +554,49 @@ s_tr_swp.o: s_tr_swp.cc ../include/u_time_pair.h ../include/constant.h \
../include/l_timer.h ../include/declare.h ../include/s_tr.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/ap.h ../include/e_cardlist.h ../include/s__.h \
- ../include/c_comand.h ../include/e_card.h ../include/e_base.h
+ ../include/c_comand.h ../include/e_card.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/l_indirect.h
lang_spice.o: lang_spice.cc ../include/u_nodemap.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_status.h ../include/l_timer.h ../include/c_comand.h \
+ ../include/e_card.h ../include/d_dot.h ../include/d_coment.h \
+ ../include/e_subckt.h ../include/e_compon.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/u_lang.h ../include/e_model.h ../include/e_elemnt.h \
+ ../include/e_logicnode.h ../include/e_logicval.h ../include/e_node.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/bm.h
+lang_spectre.o: lang_spectre.cc ../include/u_nodemap.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_status.h ../include/l_timer.h \
../include/c_comand.h ../include/e_card.h ../include/d_dot.h \
../include/d_coment.h ../include/e_subckt.h ../include/e_compon.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
../include/m_matrix.h ../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/u_lang.h ../include/d_logic.h ../include/e_model.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/bm.h
-lang_spectre.o: lang_spectre.cc ../include/u_nodemap.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/c_comand.h ../include/e_card.h \
- ../include/d_dot.h ../include/d_coment.h ../include/e_subckt.h \
- ../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_model.h ../include/u_lang.h
+ ../include/e_model.h ../include/u_lang.h
lang_verilog.o: lang_verilog.cc ../include/u_nodemap.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/c_comand.h ../include/e_card.h \
- ../include/d_dot.h ../include/d_coment.h ../include/e_subckt.h \
- ../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_model.h ../include/u_lang.h
+ ../include/c_comand.h ../include/e_card.h ../include/d_dot.h \
+ ../include/d_coment.h ../include/e_subckt.h ../include/e_compon.h \
+ ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
+ ../include/m_matrix.h ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_model.h ../include/u_lang.h
func_core.o: func_core.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/constant.h ../include/e_cardlist.h ../include/u_function.h
measure_eval.o: measure_eval.cc ../include/u_parameter.h \
@@ -675,71 +604,252 @@ measure_eval.o: measure_eval.cc ../include/u_parameter.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/m_expression.h ../include/m_base.h ../include/ap.h \
../include/constant.h ../include/e_cardlist.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
- ../include/u_function.h
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_function.h
measure_max.o: measure_max.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
- ../include/m_cpoly.h ../include/u_function.h
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
measure_min.o: measure_min.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
- ../include/m_cpoly.h ../include/u_function.h
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
measure_slewrate.o: measure_slewrate.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/l_compar.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/constant.h \
- ../include/e_cardlist.h ../include/m_wave.h ../include/l_denoise.h \
- ../include/m_interp.h ../include/m_cpoly.h ../include/u_function.h
-measure_cross.o: measure_cross.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
+ ../include/l_compar.h ../include/u_parameter.h ../include/m_expression.h \
../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
../include/m_cpoly.h ../include/u_function.h
+measure_cross.o: measure_cross.cc ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
measure_integral.o: measure_integral.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
- ../include/m_cpoly.h ../include/u_function.h
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
measure_average.o: measure_average.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
- ../include/m_cpoly.h ../include/u_function.h
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
measure_rms.o: measure_rms.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
- ../include/m_cpoly.h ../include/u_function.h
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
measure_at.o: measure_at.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
- ../include/m_wave.h ../include/l_denoise.h ../include/m_interp.h \
- ../include/m_cpoly.h ../include/u_function.h
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/constant.h ../include/e_cardlist.h ../include/m_wave.h \
+ ../include/l_denoise.h ../include/m_interp.h ../include/m_cpoly.h \
+ ../include/u_function.h
signon.o: signon.cc ../include/io_.h ../include/l_lib.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/patchlev.h
+d_mos1.o: d_mos1.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos1.h d_mos123.h \
+ d_mos_base.h d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
+d_mos2.o: d_mos2.cc ../include/l_compar.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_denoise.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/l_stlextra.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h d_mos2.h d_mos123.h d_mos_base.h d_mos.h d_diode.h \
+ ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
+ ../include/e_model.h
+d_mos3.o: d_mos3.cc ../include/l_denoise.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos3.h d_mos123.h \
+ d_mos_base.h d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
+d_mos4.o: d_mos4.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos4.h d_mos_base.h \
+ d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
+d_mos5.o: d_mos5.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos5.h d_mos_base.h \
+ d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
+d_mos6.o: d_mos6.cc ../include/l_denoise.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos6.h d_mos123.h \
+ d_mos_base.h d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
+d_mos7.o: d_mos7.cc ../include/l_compar.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_denoise.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/l_stlextra.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h d_mos7.h d_mos_base.h d_mos.h d_diode.h \
+ ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
+ ../include/e_model.h
+d_mos8.o: d_mos8.cc ../include/l_compar.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_denoise.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/l_stlextra.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h d_mos8.h d_mos_base.h d_mos.h d_diode.h \
+ ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
+ ../include/e_model.h
+d_mos123.o: d_mos123.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos123.h d_mos_base.h \
+ d_mos.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
+d_mos_base.o: d_mos_base.cc ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos_base.h d_mos.h \
+ d_diode.h ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
+ ../include/e_model.h
+d_mos.o: d_mos.cc ../include/u_limit.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/e_storag.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/u_opt.h ../include/mode.h \
+ ../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
+ ../include/l_stlextra.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_mos_base.h d_mos.h \
+ d_diode.h ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
+ ../include/e_model.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_elemnt.h
+d_bjt.o: d_bjt.cc ../include/u_limit.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h d_bjt.h d_diode.h \
+ ../include/u_sdp.h ../include/e_node.h ../include/e_subckt.h \
+ ../include/e_model.h
+d_diode.o: d_diode.cc ../include/e_aux.h ../include/e_node.h \
+ ../include/u_sim_data.h ../include/constant.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_compar.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/e_storag.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/m_cpoly.h ../include/l_denoise.h \
+ ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_elemnt.h d_diode.h ../include/u_sdp.h ../include/e_node.h \
+ ../include/e_subckt.h ../include/e_model.h
diff --git a/apps/Make1 b/apps/Make1
index 43a22662..0d70055a 100644
--- a/apps/Make1
+++ b/apps/Make1
@@ -1,4 +1,4 @@
-#$Id: Make1 $ -*- Makefile -*-
+#$Id: apps/Make1 $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <[email protected]>
#
@@ -19,13 +19,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#------------------------------------------------------------------------
-TARGET = gnucap-default-plugins
-#------------------------------------------------------------------------
-INSTALL_FILES = $(TARGET)$(TARGET_EXT)
+TARGET_LIB = gnucap-default-plugins
+TARGET_LIB_EXT = .so
#------------------------------------------------------------------------
+INSTALL_FILES = $(TARGET_LIB)$(TARGET_LIB_EXT)
INSTALL_DIR = $(PREFIX)/lib/gnucap
-#------------------------------------------------------------------------
-DELETED =
+INCLUDE = -I. -I../include -I../../include
#------------------------------------------------------------------------
# These source files can be omitted, and supplied as plugins.
# device models defined in high level .model files
@@ -40,7 +39,7 @@ D_SRCS = \
d_admit.cc d_cap.cc d_cccs.cc d_ccvs.cc d_coil.cc \
d_cs.cc d_poly_g.cc d_poly_cap.cc d_res.cc d_switch.cc \
d_trln.cc d_vcg.cc d_vcr.cc d_vcvs.cc d_vs.cc \
-d_meter.cc
+d_meter.cc d_logic.cc
# behavioral modeling functions
BM_SRCS = \
@@ -85,7 +84,7 @@ $(LANG_SRCS) \
$(FUNC_SRCS) \
$(OTHER_SRCS)
#------------------------------------------------------------------------
-RAW_OTHER = Make1 Make2.g++ Make2.Debug Make2.mingw32 configure test_readline.cc
+RAW_OTHER = Make1 configure test_readline.cc
#------------------------------------------------------------------------
RAW = $(RAW_HDRS) $(RAW_SRCS) $(RAW_OTHER) $(MODELS)
#------------------------------------------------------------------------
@@ -107,7 +106,7 @@ IMPORTED_DIST = $(IMPORTED)
DIST_FILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
-SRCS = $(IMPORTED_SRCS) $(GENERATED_SRCS) $(RAW_SRCS)
+SRCS = $(RAW_SRCS) $(GENERATED_SRCS) $(IMPORTED_SRCS)
HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
OBJS = ${SRCS:.cc=.o}
TARGET_DEPENDS = $(OBJS) $(RAW) $(MODELS)
diff --git a/apps/Make2.Debug b/apps/Make2.Debug
deleted file mode 100644
index b35ac81b..00000000
--- a/apps/Make2.Debug
+++ /dev/null
@@ -1,98 +0,0 @@
-#$Id: Make2.Debug $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-# Standard base for g++, debugging, a little optimization
-# Running the program will give a spew of line markers for debugging.
-
-CCC = g++
-TARGET_EXT = .so
-
-CCFLAGS = \
--fPIC \
--DHAVE_LIBREADLINE \
--DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \
--Wall -Wextra \
--Wswitch-enum -Wundef -Wpointer-arith -Woverloaded-virtual \
--Wcast-qual -Wcast-align -Wpacked -Wshadow -Wconversion \
--Winit-self -Wmissing-include-dirs -Winvalid-pch \
--Wvolatile-register-var -Wstack-protector \
--Wvla -Woverlength-strings -Wno-sign-conversion -Wno-unused-const-variable
-#last line not in 4.1
-
-LIBS = \
-
-LDFLAGS = -shared
-
-%.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-# warnings turned off, because they warn of nothing wrong
-# 4.3
-#-Wswitch-default -- lack of default is correct with enum
-#-Wfloat-equal -- warns on NA, div by zero trap
-#-Wpadded -- a bool in a class is enough
-#-Wredundant-decls -- in both header and func is an error check
-#-Wmissing-declarations -- pascal style
-#-Wmissing-noreturn -- warns when always throws exception
-#-Wunreachable-code -- warns even if reachable .. compiler bug??
-#-Waggregate-return -- warns even if passed by reference
-#-Wunsafe-loop-optimizations -- if can't unroll a loop
-#-Winline
-#-Wdisabled-optimization -- -O0 disables optimization, so it warns
-
-# 4.2
-#-Wpadded -- a bool in a class is enough
-#-Winline
-#-Waggregate-return -- warns even if passed by reference
-#-Wfloat-equal -- warns on NA, div by zero trap
-#-Wredundant-decls -- in both header and func is an error check
-#-Wunsafe-loop-optimizations -- warns on any loop with variable count
-
-# warnings turned off, because of the public headers
-#-Wunreachable-code -- didn't use nonportable syntax to hide
-#-Wmissing-noreturn -- didn't use nonportable syntax to hide
-
-# warnings turned off, issues with clang
-#-Wlogical-op -- not recognized
-#-Wsign-conversion -- int to size_t
-#-Wunused-const-variable -- generated code
-
-# warnings that should be on, but ...
-#-Wshadow -- lambda functions
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "debug" version, with extra warnings and run-time tracing.
-# If you get errors or warnings, make a copy of it and modify that.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to [email protected]
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/apps/Make2.g++ b/apps/Make2.g++
deleted file mode 100644
index c7581c95..00000000
--- a/apps/Make2.g++
+++ /dev/null
@@ -1,57 +0,0 @@
-#$Id: Make2.g++ 2014/07/03 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-# Standard base for g++.
-
-CCC = g++
-TARGET_EXT = .so
-
-CCFLAGS = \
--fPIC \
--DUNIX -O3 -DNDEBUG -I. -I../include -I../../include -W
-
-LIBS = \
-
-LDFLAGS = -shared
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to [email protected]
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/apps/Make2.mingw32 b/apps/Make2.mingw32
deleted file mode 100644
index 8a9345e9..00000000
--- a/apps/Make2.mingw32
+++ /dev/null
@@ -1,45 +0,0 @@
-#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-CCC = i586-mingw32msvc-g++
-DLLTOOL = i586-mingw32msvc-dlltool
-TARGET_EXT = .dll
-
-CCFLAGS = \
--O2 -DNDEBUG -I. -I../../include
-
-LIBS = -lgnucap
-
-LDFLAGS = -shared -L../../lib/MSW
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET)$(TARGET_EXT)
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/apps/bm_complex.cc b/apps/bm_complex.cc
index 462d34c0..cf1169ec 100644
--- a/apps/bm_complex.cc
+++ b/apps/bm_complex.cc
@@ -37,14 +37,14 @@ public:
explicit EVAL_BM_COMPLEX(int c=0);
~EVAL_BM_COMPLEX() {}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_COMPLEX(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
- void tr_eval(ELEMENT*)const;
- void ac_eval(ELEMENT*)const;
- std::string name()const {return "complex";}
- bool ac_too()const {untested();return true;}
- bool parse_numlist(CS&);
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_COMPLEX(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
+ void tr_eval(ELEMENT*)const override;
+ void ac_eval(ELEMENT*)const override;
+ std::string name()const override {return "complex";}
+ bool ac_too()const override {untested();return true;}
+ bool parse_numlist(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_exp.cc b/apps/bm_exp.cc
index 191ba44d..e8ff14c1 100644
--- a/apps/bm_exp.cc
+++ b/apps/bm_exp.cc
@@ -52,17 +52,17 @@ public:
explicit EVAL_BM_EXP(int c=0);
~EVAL_BM_EXP() {}
private: // override vitrual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_EXP(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_EXP(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- TIME_PAIR tr_review(COMPONENT*)const;
- std::string name()const {return "exp";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*)override;
+ void tr_eval(ELEMENT*)const override;
+ TIME_PAIR tr_review(COMPONENT*)const override;
+ std::string name()const override {return "exp";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_fit.cc b/apps/bm_fit.cc
index e67bfcda..dc33aef1 100644
--- a/apps/bm_fit.cc
+++ b/apps/bm_fit.cc
@@ -50,16 +50,16 @@ public:
explicit EVAL_BM_FIT(int c=0);
~EVAL_BM_FIT();
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_FIT(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_FIT(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {return "fit";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*) override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {return "fit";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_generator.cc b/apps/bm_generator.cc
index 5f761c14..9fa36c8a 100644
--- a/apps/bm_generator.cc
+++ b/apps/bm_generator.cc
@@ -38,14 +38,14 @@ public:
explicit EVAL_BM_GENERATOR(int c=0);
~EVAL_BM_GENERATOR() {}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_GENERATOR(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
- void tr_eval(ELEMENT*)const;
- void ac_eval(ELEMENT*)const;
- std::string name()const {return "generator";}
- bool ac_too()const {return true;}
- bool parse_numlist(CS&);
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_GENERATOR(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
+ void tr_eval(ELEMENT*)const override;
+ void ac_eval(ELEMENT*)const override;
+ std::string name()const override {return "generator";}
+ bool ac_too()const override {return true;}
+ bool parse_numlist(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_model.cc b/apps/bm_model.cc
index bb03b28a..8f2d5e77 100644
--- a/apps/bm_model.cc
+++ b/apps/bm_model.cc
@@ -38,16 +38,16 @@ public:
explicit EVAL_BM_MODEL(int c=0);
~EVAL_BM_MODEL() {detach_common(&_func);}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_MODEL(*this);}
- void parse_common_obsolete_callback(CS&);
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
- void expand(const COMPONENT*);
- COMMON_COMPONENT* deflate() {return (_func) ? _func->deflate() : this;}
- void tr_eval(ELEMENT*d)const {assert(_func); _func->tr_eval(d);}
- void ac_eval(ELEMENT*d)const {assert(_func); _func->ac_eval(d);}
- std::string name()const {itested();return modelname();}
- bool ac_too()const {return true;}
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_MODEL(*this);}
+ void parse_common_obsolete_callback(CS&)override;
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
+ void expand(const COMPONENT*)override;
+ COMMON_COMPONENT* deflate()override {return (_func) ? _func->deflate() : this;}
+ void tr_eval(ELEMENT*d)const override{assert(_func); _func->tr_eval(d);}
+ void ac_eval(ELEMENT*d)const override{assert(_func); _func->ac_eval(d);}
+ std::string name()const override {itested();return modelname();}
+ bool ac_too()const override {return true;}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_poly.cc b/apps/bm_poly.cc
index ec981c92..7dfbeb10 100644
--- a/apps/bm_poly.cc
+++ b/apps/bm_poly.cc
@@ -44,17 +44,17 @@ public:
explicit EVAL_BM_POLY(int c=0);
~EVAL_BM_POLY() {}
private: // override vitrual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_POLY(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_POLY(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {return "poly";}
- bool ac_too()const {untested();return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
- void skip_type_tail(CS& cmd)const {cmd.umatch("(1)");}
+ void precalc_last(const CARD_LIST*)override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {return "poly";}
+ bool ac_too()const override {untested();return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
+ void skip_type_tail(CS& cmd)const override {cmd.umatch("(1)");}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_posy.cc b/apps/bm_posy.cc
index 67c65899..faf38dc8 100644
--- a/apps/bm_posy.cc
+++ b/apps/bm_posy.cc
@@ -49,16 +49,16 @@ public:
explicit EVAL_BM_POSY(int c=0);
~EVAL_BM_POSY() {}
private: // override vitrual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_POSY(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_POSY(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {return "posy";}
- bool ac_too()const {untested();return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*)override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {return "posy";}
+ bool ac_too()const override {untested();return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_pulse.cc b/apps/bm_pulse.cc
index cb35014f..fa39ca0f 100644
--- a/apps/bm_pulse.cc
+++ b/apps/bm_pulse.cc
@@ -52,17 +52,17 @@ public:
explicit EVAL_BM_PULSE(int c=0);
~EVAL_BM_PULSE() {}
private: // override vitrual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_PULSE(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_PULSE(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- TIME_PAIR tr_review(COMPONENT*)const;
- std::string name()const {return "pulse";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*)override;
+ void tr_eval(ELEMENT*)const override;
+ TIME_PAIR tr_review(COMPONENT*)const override;
+ std::string name()const override {return "pulse";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_pwl.cc b/apps/bm_pwl.cc
index 97398b77..858954ec 100644
--- a/apps/bm_pwl.cc
+++ b/apps/bm_pwl.cc
@@ -44,18 +44,18 @@ public:
explicit EVAL_BM_PWL(int c=0);
~EVAL_BM_PWL() {}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_PWL(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_PWL(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- TIME_PAIR tr_review(COMPONENT*)const;
- std::string name()const {return "pwl";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
- void skip_type_tail(CS& cmd)const {cmd.umatch("(1)");}
+ void precalc_last(const CARD_LIST*)override;
+ void tr_eval(ELEMENT*)const override;
+ TIME_PAIR tr_review(COMPONENT*)const override;
+ std::string name()const override {return "pwl";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
+ void skip_type_tail(CS& cmd)const override {cmd.umatch("(1)");}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_sffm.cc b/apps/bm_sffm.cc
index 79aaa34c..5d49b1de 100644
--- a/apps/bm_sffm.cc
+++ b/apps/bm_sffm.cc
@@ -55,17 +55,17 @@ public:
explicit EVAL_BM_SFFM(int c=0);
~EVAL_BM_SFFM() {}
private: // override vitrual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_SFFM(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_SFFM(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- TIME_PAIR tr_review(COMPONENT*)const;
- std::string name()const {return "sffm";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*) override;
+ void tr_eval(ELEMENT*)const override;
+ TIME_PAIR tr_review(COMPONENT*)const override;
+ std::string name()const override {return "sffm";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&) override;
+ bool parse_params_obsolete_callback(CS&) override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_sin.cc b/apps/bm_sin.cc
index 99cd3bdf..aafc729e 100644
--- a/apps/bm_sin.cc
+++ b/apps/bm_sin.cc
@@ -56,17 +56,17 @@ public:
explicit EVAL_BM_SIN(int c=0);
~EVAL_BM_SIN() {}
private: // override vitrual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_SIN(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_SIN(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- TIME_PAIR tr_review(COMPONENT*)const;
- std::string name()const {return "sin";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*) override;
+ void tr_eval(ELEMENT*)const override;
+ TIME_PAIR tr_review(COMPONENT*)const override;
+ std::string name()const override {return "sin";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&) override;
+ bool parse_params_obsolete_callback(CS&) override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bm_tanh.cc b/apps/bm_tanh.cc
index 6a6c2591..9884ee1b 100644
--- a/apps/bm_tanh.cc
+++ b/apps/bm_tanh.cc
@@ -41,16 +41,16 @@ public:
explicit EVAL_BM_TANH(int c=0);
~EVAL_BM_TANH() {}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_TANH(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_TANH(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {return "tanh";}
- bool ac_too()const {untested();return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_last(const CARD_LIST*) override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {return "tanh";}
+ bool ac_too()const override {untested();return false;}
+ bool parse_numlist(CS&)override;
+ bool parse_params_obsolete_callback(CS&)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/bmm_semi.cc b/apps/bmm_semi.cc
index 6d57875c..599335c1 100644
--- a/apps/bmm_semi.cc
+++ b/apps/bmm_semi.cc
@@ -42,17 +42,17 @@ protected:
explicit EVAL_BM_SEMI_BASE(int c=0);
~EVAL_BM_SEMI_BASE() {untested();}
protected: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const = 0;
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override = 0;
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void expand(const COMPONENT*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {untested();return modelname().c_str();}
- bool ac_too()const {untested();return false;}
- bool parse_params_obsolete_callback(CS&);
- bool parse_numlist(CS& cmd);
+ void precalc_last(const CARD_LIST*) override;
+ void expand(const COMPONENT*) override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {untested();return modelname().c_str();}
+ bool ac_too()const override {untested();return false;}
+ bool parse_params_obsolete_callback(CS&) override;
+ bool parse_numlist(CS& cmd) override;
};
/*--------------------------------------------------------------------------*/
class EVAL_BM_SEMI_CAPACITOR : public EVAL_BM_SEMI_BASE {
@@ -64,10 +64,10 @@ public:
:EVAL_BM_SEMI_BASE(c) {}
~EVAL_BM_SEMI_CAPACITOR() {untested();}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {untested();return new EVAL_BM_SEMI_CAPACITOR(*this);}
- void expand(const COMPONENT*);
- void precalc_last(const CARD_LIST*);
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override{untested();return new EVAL_BM_SEMI_CAPACITOR(*this);}
+ void expand(const COMPONENT*)override;
+ void precalc_last(const CARD_LIST*)override;
};
/*--------------------------------------------------------------------------*/
class EVAL_BM_SEMI_RESISTOR : public EVAL_BM_SEMI_BASE {
@@ -79,10 +79,10 @@ public:
:EVAL_BM_SEMI_BASE(c) {}
~EVAL_BM_SEMI_RESISTOR() {untested();}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {untested();return new EVAL_BM_SEMI_RESISTOR(*this);}
- void expand(const COMPONENT*);
- void precalc_last(const CARD_LIST*);
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {untested();return new EVAL_BM_SEMI_RESISTOR(*this);}
+ void expand(const COMPONENT*)override;
+ void precalc_last(const CARD_LIST*)override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
@@ -101,15 +101,15 @@ protected:
explicit MODEL_SEMI_BASE();
explicit MODEL_SEMI_BASE(const MODEL_SEMI_BASE& p);
protected: // override virtual
- void precalc_first();
+ void precalc_first()override;
//void precalc_last();
//CARD* clone()const //MODEL_CARD/pure
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (4 + MODEL_CARD::param_count());}
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override{return (4 + MODEL_CARD::param_count());}
};
/*--------------------------------------------------------------------------*/
class MODEL_SEMI_CAPACITOR : public MODEL_SEMI_BASE {
@@ -124,17 +124,17 @@ private:
public:
explicit MODEL_SEMI_CAPACITOR();
private: // override virtual
- std::string dev_type()const {return "c";}
- void precalc_first();
+ std::string dev_type()const override {return "c";}
+ void precalc_first()override;
//void precalc_last();
- COMMON_COMPONENT* new_common()const {return new EVAL_BM_SEMI_CAPACITOR;}
- CARD* clone()const {return new MODEL_SEMI_CAPACITOR(*this);}
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (2 + MODEL_SEMI_BASE::param_count());}
+ COMMON_COMPONENT* new_common()const override {return new EVAL_BM_SEMI_CAPACITOR;}
+ CARD* clone()const override {return new MODEL_SEMI_CAPACITOR(*this);}
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (2 + MODEL_SEMI_BASE::param_count());}
};
/*--------------------------------------------------------------------------*/
class MODEL_SEMI_RESISTOR : public MODEL_SEMI_BASE {
@@ -147,17 +147,17 @@ private:
public:
explicit MODEL_SEMI_RESISTOR();
private: // override virtual
- std::string dev_type()const {return "r";}
- void precalc_first();
+ std::string dev_type()const override {return "r";}
+ void precalc_first()override;
//void precalc_last();
- COMMON_COMPONENT* new_common()const {return new EVAL_BM_SEMI_RESISTOR;}
- CARD* clone()const {return new MODEL_SEMI_RESISTOR(*this);}
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (1 + MODEL_SEMI_BASE::param_count());}
+ COMMON_COMPONENT* new_common()const override {return new EVAL_BM_SEMI_RESISTOR;}
+ CARD* clone()const override {return new MODEL_SEMI_RESISTOR(*this);}
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (1 + MODEL_SEMI_BASE::param_count());}
};
/*--------------------------------------------------------------------------*/
double const EVAL_BM_SEMI_BASE::_default_length = NOT_INPUT;
diff --git a/apps/bmm_table.cc b/apps/bmm_table.cc
index 67b814af..6cb2be2f 100644
--- a/apps/bmm_table.cc
+++ b/apps/bmm_table.cc
@@ -39,13 +39,13 @@ public:
explicit EVAL_BM_TABLE(int c=0);
~EVAL_BM_TABLE() {}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_TABLE(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
- void expand(const COMPONENT*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {untested();return modelname().c_str();}
- bool ac_too()const {untested();return false;}
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_TABLE(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
+ void expand(const COMPONENT*) override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {untested();return modelname().c_str();}
+ bool ac_too()const override {untested();return false;}
};
/*--------------------------------------------------------------------------*/
class MODEL_TABLE : public MODEL_CARD {
@@ -65,17 +65,17 @@ public:
explicit MODEL_TABLE();
~MODEL_TABLE();
private: // override virtual
- std::string dev_type()const {return "table";}
- void precalc_first();
- COMMON_COMPONENT* new_common()const {return new EVAL_BM_TABLE;}
- CARD* clone()const {return new MODEL_TABLE(*this);}
+ std::string dev_type()const override {return "table";}
+ void precalc_first() override;
+ COMMON_COMPONENT* new_common()const override {return new EVAL_BM_TABLE;}
+ CARD* clone()const override {return new MODEL_TABLE(*this);}
- bool use_obsolete_callback_print()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- void print_args_obsolete_callback(OMSTREAM&,LANGUAGE*)const;
- bool parse_params_obsolete_callback(CS&);
+ bool use_obsolete_callback_print()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ void print_args_obsolete_callback(OMSTREAM&,LANGUAGE*)const override;
+ bool parse_params_obsolete_callback(CS&) override;
- void tr_eval(COMPONENT*)const;
+ void tr_eval(COMPONENT*)const override;
};
/*--------------------------------------------------------------------------*/
int const MODEL_TABLE::_default_order = 3;
diff --git a/apps/c_clear.cc b/apps/c_clear.cc
index d844cd51..423fc539 100644
--- a/apps/c_clear.cc
+++ b/apps/c_clear.cc
@@ -33,8 +33,7 @@ namespace {
*/
class CMD_CLEAR : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {
+ void do_it(CS&, CARD_LIST* Scope)override {
command("unfault", Scope);
command("unmark", Scope);
//command("ic clear", Scope);
diff --git a/apps/c_comand.cc b/apps/c_comand.cc
index 325b5d5d..ed3144d5 100644
--- a/apps/c_comand.cc
+++ b/apps/c_comand.cc
@@ -30,7 +30,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_END : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope) {
+ void do_it(CS&, CARD_LIST* Scope)override {
switch (ENV::run_mode) {
case rPRE_MAIN: unreachable(); break;
case rPRESET: untested(); break; //BUG// this should close the file
@@ -60,7 +60,7 @@ DISPATCHER<CMD>::INSTALL d0(&command_dispatcher, "end", &p0);
/*--------------------------------------------------------------------------*/
class CMD_PAUSE : public CMD {
public:
- void do_it(CS&, CARD_LIST*) {untested();
+ void do_it(CS&, CARD_LIST*)override {untested();
//BUG// buffer problem
//BUG// redirection problem
IO::error << "Continue? ";
@@ -75,7 +75,7 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "pause", &p1);
/*--------------------------------------------------------------------------*/
class CMD_QUIT : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope) {
+ void do_it(CS&, CARD_LIST* Scope)override {
switch (ENV::run_mode) {
case rPRE_MAIN: unreachable(); break;
case rINTERACTIVE:
@@ -89,7 +89,7 @@ DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "quit|exit", &p2);
/*--------------------------------------------------------------------------*/
class CMD_TEMP : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*) {itested();
+ void do_it(CS& cmd, CARD_LIST*)override {itested();
double t = NOT_INPUT;
size_t here = cmd.cursor();
cmd >> '=' >> t;
@@ -104,7 +104,7 @@ DISPATCHER<CMD>::INSTALL d3(&command_dispatcher, "temperature|temp", &p3);
/*--------------------------------------------------------------------------*/
class CMD_TITLE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*) {
+ void do_it(CS& cmd, CARD_LIST*)override {
if (cmd.more()) {
head = cmd.tail();
}else{itested();
diff --git a/apps/c_delete.cc b/apps/c_delete.cc
index c10bdf21..c1092a99 100644
--- a/apps/c_delete.cc
+++ b/apps/c_delete.cc
@@ -103,10 +103,13 @@ private:
return false;
}
//-----------------------------------
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
if (cmd.umatch("all ")) {
- CARD_LIST::card_list.erase_all();
+ Scope->erase_all();
}else{
while (cmd.more()) {
size_t mark = cmd.cursor();
diff --git a/apps/c_exp.cc b/apps/c_exp.cc
index 2e165413..427d1f78 100644
--- a/apps/c_exp.cc
+++ b/apps/c_exp.cc
@@ -29,12 +29,16 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_ : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ size_t here = cmd.cursor();
Expression e(cmd);
cmd.check(bDANGER, "syntax error");
- Expression r(e, Scope);
- std::cout << e << '=' << r << '\n';
+ try{
+ Expression r(e, Scope);
+ std::cout << e << '=' << r << '\n';
+ }catch(Exception const& ee){
+ cmd.warn(bWARNING, here, ee.message());
+ }
}
} p0;
DISPATCHER<CMD>::INSTALL d0(&command_dispatcher, "exp|eval", &p0);
diff --git a/apps/c_genrat.cc b/apps/c_genrat.cc
index 7334cf16..cb57c4df 100644
--- a/apps/c_genrat.cc
+++ b/apps/c_genrat.cc
@@ -45,8 +45,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_ : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST*)override {
OMSTREAM where = (cmd.more()) ? OMSTREAM() : IO::mstdout;
size_t here = cmd.cursor();
do{
diff --git a/apps/c_help.cc b/apps/c_help.cc
index d40969f3..8b668c8a 100644
--- a/apps/c_help.cc
+++ b/apps/c_help.cc
@@ -44,8 +44,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_HELP : public CMD {
public:
- void do_it(CS& Cmd, CARD_LIST*)
- {
+ void do_it(CS& Cmd, CARD_LIST*)override {
size_t tail = Cmd.cursor();
std::string topic;
@@ -68,8 +67,7 @@ public:
}
}
- std::string help_text()const
- {
+ std::string help_text()const override {
return
"help command\n"
"Provides help on a variety of topics\n"
diff --git a/apps/c_list.cc b/apps/c_list.cc
index 23af0880..eedc3949 100644
--- a/apps/c_list.cc
+++ b/apps/c_list.cc
@@ -32,7 +32,11 @@ namespace {
/*--------------------------------------------------------------------------*/
void list_save(CS& cmd, OMSTREAM out, CARD_LIST* scope)
{
- CARD_LIST::card_list.precalc_first();
+ assert(scope);
+ if (scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+ scope->precalc_first();
//out.setfloatwidth(7);
switch (ENV::run_mode) {
@@ -105,8 +109,11 @@ void list_save(CS& cmd, OMSTREAM out, CARD_LIST* scope)
/*--------------------------------------------------------------------------*/
class CMD_LIST : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
list_save(cmd, IO::mstdout, Scope);
}
} p1;
@@ -114,8 +121,11 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "list", &p1);
/*--------------------------------------------------------------------------*/
class CMD_SAVE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {itested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {itested();
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {untested();
+ }else{untested();
+ }
cmd.reset(); /* back up to beginning of input line */
OMSTREAM out; // = IO::mstdout;
list_save(cmd, *outset(cmd,&out), Scope);
diff --git a/apps/c_measure.cc b/apps/c_measure.cc
index 88d4068b..b92c0160 100644
--- a/apps/c_measure.cc
+++ b/apps/c_measure.cc
@@ -31,8 +31,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_MEASURE : public CMD {
public:
- void do_it(CS& Cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& Cmd, CARD_LIST* Scope)override {
std::string assign_to, function;
Cmd >> assign_to >> '=' >> function >> '(';
if (FUNCTION* f = measure_dispatcher[function]) {
diff --git a/apps/c_modify.cc b/apps/c_modify.cc
index 55f36006..28651056 100644
--- a/apps/c_modify.cc
+++ b/apps/c_modify.cc
@@ -129,8 +129,7 @@ void modify_fault(CS& cmd, WHATTODO command, CARD_LIST* scope)
/*--------------------------------------------------------------------------*/
class CMD_MODIFY : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
modify_fault(cmd, MODIFY, Scope);
}
} p1;
@@ -138,8 +137,7 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "modify|alter", &p1);
/*--------------------------------------------------------------------------*/
class CMD_FAULT : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
modify_fault(cmd, FAULT, Scope);
}
} p2;
@@ -147,8 +145,7 @@ DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "fault", &p2);
/*--------------------------------------------------------------------------*/
class CMD_RESTORE : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {untested();
+ void do_it(CS&, CARD_LIST* Scope)override {untested();
command("unfault", Scope);
command("unmark", Scope);
}
@@ -157,8 +154,7 @@ DISPATCHER<CMD>::INSTALL d3(&command_dispatcher, "restore", &p3);
/*--------------------------------------------------------------------------*/
class CMD_UNFAULT : public CMD {
public:
- void do_it(CS&, CARD_LIST*)
- {
+ void do_it(CS&, CARD_LIST*)override {
while (!faultstack.empty()) {
faultstack.back().restore();
faultstack.pop_back();
diff --git a/apps/c_param.cc b/apps/c_param.cc
index d5541225..521a9ae2 100644
--- a/apps/c_param.cc
+++ b/apps/c_param.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_PARAM : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
PARAM_LIST* pl = Scope->params();
if (cmd.is_end()) {
pl->print(IO::mstdout, OPT::language);
diff --git a/apps/c_prbcmd.cc b/apps/c_prbcmd.cc
index d4bfc81d..dfbc8b5b 100644
--- a/apps/c_prbcmd.cc
+++ b/apps/c_prbcmd.cc
@@ -28,12 +28,21 @@
#include "c_comand.h"
#include "u_prblst.h"
#include "globals.h"
+#ifdef TRACE_UNTESTED
+#include "e_cardlist.h" // not actually used.
+#endif
/*--------------------------------------------------------------------------*/
namespace {
/*--------------------------------------------------------------------------*/
-void do_probe(CS& cmd, PROBELIST *probes)
+void do_probe(CS& cmd, PROBELIST *probes, CARD_LIST *scope)
{
assert(probes);
+ assert(scope);
+#ifdef TRACE_UNTESTED
+ if (scope == &CARD_LIST::card_list) {
+ }else{itested();
+ }
+#endif
CKT_BASE::_sim->set_command_none();
enum {aADD, aDELETE, aNEW} action;
@@ -77,7 +86,7 @@ void do_probe(CS& cmd, PROBELIST *probes)
}else if (cmd.umatch("clear ")) {untested();/* clear */
probes[simtype].clear();
}else{ /* add/remove */
- CKT_BASE::_sim->init();
+ CKT_BASE::_sim->init(scope);
if (cmd.match1('-')) {itested(); /* setup cases like: */
action = aDELETE; /* .probe ac + .... */
cmd.skip();
@@ -103,7 +112,7 @@ void do_probe(CS& cmd, PROBELIST *probes)
if (action == aDELETE) {
probes[simtype].remove_list(cmd);
}else{
- probes[simtype].add_list(cmd);
+ probes[simtype].add_list(cmd, scope);
}
}
}
@@ -112,46 +121,66 @@ void do_probe(CS& cmd, PROBELIST *probes)
/*--------------------------------------------------------------------------*/
class CMD_STORE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+#ifdef TRACE_UNTESTED
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+#endif
assert(_probe_lists);
assert(_probe_lists->store);
- do_probe(cmd,_probe_lists->store);
+ do_probe(cmd, _probe_lists->store, Scope);
}
} p0;
DISPATCHER<CMD>::INSTALL d0(&command_dispatcher, "store", &p0);
/*--------------------------------------------------------------------------*/
class CMD_ALARM : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+#ifdef TRACE_UNTESTED
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+#endif
assert(_probe_lists);
assert(_probe_lists->alarm);
- do_probe(cmd,_probe_lists->alarm);
+ do_probe(cmd, _probe_lists->alarm, Scope);
}
} p1;
DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "alarm", &p1);
/*--------------------------------------------------------------------------*/
class CMD_PLOT : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+#ifdef TRACE_UNTESTED
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+#endif
IO::plotset = true;
assert(_probe_lists);
assert(_probe_lists->plot);
- do_probe(cmd,_probe_lists->plot);
+ do_probe(cmd, _probe_lists->plot, Scope);
}
} p2;
DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "iplot|plot", &p2);
/*--------------------------------------------------------------------------*/
class CMD_PRINT : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+#ifdef TRACE_UNTESTED
+ if (Scope == &CARD_LIST::card_list) {
+ }else{itested();
+ }
+#endif
IO::plotset = false;
assert(_probe_lists);
assert(_probe_lists->print);
- do_probe(cmd,_probe_lists->print);
+ do_probe(cmd, _probe_lists->print, Scope);
}
} p3;
DISPATCHER<CMD>::INSTALL d3(&command_dispatcher, "iprint|print|probe", &p3);
diff --git a/apps/c_sim.cc b/apps/c_sim.cc
index b2ab15a5..fde55418 100644
--- a/apps/c_sim.cc
+++ b/apps/c_sim.cc
@@ -30,8 +30,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_MARK : public CMD {
public:
- void do_it(CS&, CARD_LIST*)
- {itested();
+ void do_it(CS&, CARD_LIST*)override {itested();
_sim->_freezetime = true;
}
} p6;
@@ -39,8 +38,7 @@ DISPATCHER<CMD>::INSTALL d6(&command_dispatcher, "mark|freeze", &p6);
/*--------------------------------------------------------------------------*/
class CMD_UNMARK : public CMD {
public:
- void do_it(CS&, CARD_LIST*)
- {
+ void do_it(CS&, CARD_LIST*)override {
_sim->_freezetime = false;
}
} p7;
diff --git a/apps/c_status.cc b/apps/c_status.cc
index 15078714..1e66fbc3 100644
--- a/apps/c_status.cc
+++ b/apps/c_status.cc
@@ -35,8 +35,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_STATUS : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST*)override {
IO::mstdout << "Gnucap System status\n";
if (!cmd.umatch("n{otime} ")) {
diff --git a/apps/c_sweep.cc b/apps/c_sweep.cc
index 32e9d1c5..1fa7cadc 100644
--- a/apps/c_sweep.cc
+++ b/apps/c_sweep.cc
@@ -133,8 +133,7 @@ static void doit(CARD_LIST* scope)
/*--------------------------------------------------------------------------*/
class CMD_SWEEP : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
if (cmd.more()) {
buildfile(cmd);
}else{
diff --git a/apps/c_system.cc b/apps/c_system.cc
index f50a1563..da9c28ed 100644
--- a/apps/c_system.cc
+++ b/apps/c_system.cc
@@ -33,8 +33,7 @@ namespace {
*/
class CMD_EDIT : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {itested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {itested();
std::string editor(OS::getenv("EDITOR"));
if (editor == "") {
throw Exception("no editor defined\n"
@@ -56,8 +55,7 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "edit", &p1);
/*--------------------------------------------------------------------------*/
class CMD_SYSTEM : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {itested();
+ void do_it(CS& cmd, CARD_LIST*)override {itested();
if (cmd.more()) {itested();
OS::system(cmd.tail());
}else{
@@ -69,8 +67,7 @@ DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "system|!", &p2);
/*--------------------------------------------------------------------------*/
class CMD_CHDIR : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {itested();
+ void do_it(CS& cmd, CARD_LIST*)override {itested();
if (cmd.more()) {
OS::chdir(cmd.ctos(""));
}else{
diff --git a/apps/configure b/apps/configure
index 1fbb9878..48e59b3e 100755
--- a/apps/configure
+++ b/apps/configure
@@ -1,5 +1,4 @@
#!/bin/sh
-# configure for library (shared object)
mkdir -p O
#------------- Stuff added to enable --prefix --------------
@@ -25,34 +24,30 @@ sed -e "s#/usr/local#$prefix#" ../Makefile.template > Makefile
#----------------------------------------------------------------
echo "CCFLAGS = -fPIC \\" >Make.ccflags
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
-
-echo "LIBS = \\" >Make.libs
-echo "" >>Make.libs
-echo "PREFIX = " $prefix >>Make.libs
-echo "" >>Make.libs
+echo "-std=c++11 -DUNIX -O2 -DNDEBUG \$(INCLUDE) -W \\" >>Make.ccflags
+# begin special stuff
+# end special stuff
+echo "" >>Make.ccflags
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
-TARGET_EXT = .so
-
-LDFLAGS = -shared
+CXX = c++
.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.SUFFIXES: .so .o .cc
+.cc.o:; \$(CXX) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.cc.so:; \$(MAKE_LIB) \$<
#------------------------------------------------------------------------
-\$(TARGET)\$(TARGET_EXT): \$(TARGET_DEPENDS)
- rm -f \$@
- \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -o \$@
+MAKE_EXE = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -o \$@
+MAKE_LIB = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -shared -o \$@
#------------------------------------------------------------------------
CAT_EOF
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------ >>Make2
-cat Make.ccflags Make.libs Make.sys >>Make2
-rm Make.ccflags Make.libs Make.sys
+echo "PREFIX = " $prefix >>Make2
+cat Make.ccflags Make.sys >>Make2
+rm Make.ccflags Make.sys
exit 0
diff --git a/apps/d_admit.cc b/apps/d_admit.cc
index 1846f892..ee429e5a 100644
--- a/apps/d_admit.cc
+++ b/apps/d_admit.cc
@@ -41,31 +41,32 @@ protected:
public:
explicit DEV_ADMITTANCE() :ELEMENT() {}
protected: // override virtual
- char id_letter()const {return 'Y';}
- std::string value_name()const {return "g";}
- std::string dev_type()const {return "admittance";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return 2;}
- bool has_iv_probe()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_ADMITTANCE(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_passive();}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_passive();}
- void tr_unload() {tr_unload_passive();}
- double tr_involts()const {return tr_outvolts();}
- double tr_involts_limited()const {return tr_outvolts_limited();}
- void ac_iwant_matrix() {ac_iwant_matrix_passive();}
- void ac_begin() {_acg = _ev = _y[0].f1;}
- void do_ac();
- void ac_load() {ac_load_passive();}
- COMPLEX ac_involts()const {untested();return ac_outvolts();}
+ char id_letter()const override {return 'Y';}
+ std::string value_name()const override{return "g";}
+ std::string dev_type()const override {return "admittance";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return 2;}
+ bool has_iv_probe()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_ADMITTANCE(*this);}
+ void precalc_last()override;
+ void dc_advance()override;
+ void tr_iwant_matrix() override {tr_iwant_matrix_passive();}
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_passive();}
+ void tr_unload()override {tr_unload_passive();}
+ double tr_involts()const override {return tr_outvolts();}
+ double tr_involts_limited()const override {return tr_outvolts_limited();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_passive();}
+ void ac_begin()override {ELEMENT::ac_begin(); _acg = _ev = _y[0].f1;}
+ void do_ac()override;
+ void ac_load()override {ac_load_passive();}
+ COMPLEX ac_involts()const override {untested();return ac_outvolts();}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
@@ -79,25 +80,25 @@ protected:
public:
explicit DEV_VCCS() :DEV_ADMITTANCE() {}
protected: // override virtual
- char id_letter()const {return 'G';}
- std::string value_name()const {return "gm";}
- std::string dev_type()const {return "vccs";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- bool has_iv_probe()const {return false;}
- CARD* clone()const {return new DEV_VCCS(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_active();}
- void tr_load() {tr_load_active();}
- void tr_unload() {untested();tr_unload_active();}
- double tr_involts()const {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- void ac_iwant_matrix() {ac_iwant_matrix_active();}
- void ac_load() {ac_load_active();}
- COMPLEX ac_involts()const {untested();return _n[IN1]->vac() - _n[IN2]->vac();}
+ char id_letter()const override {return 'G';}
+ std::string value_name()const override {return "gm";}
+ std::string dev_type()const override {return "vccs";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ bool has_iv_probe()const override {return false;}
+ CARD* clone()const override {return new DEV_VCCS(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_active();}
+ void tr_load()override {tr_load_active();}
+ void tr_unload()override {untested();tr_unload_active();}
+ double tr_involts()const override {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
+ double tr_involts_limited()const override {return volts_limited(_n[IN1],_n[IN2]);}
+ void ac_iwant_matrix()override {ac_iwant_matrix_active();}
+ void ac_load()override {ac_load_active();}
+ COMPLEX ac_involts()const override {untested();return _n[IN1]->vac() - _n[IN2]->vac();}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"sink", "src", "ps", "ns"};
@@ -109,10 +110,29 @@ protected: // override virtual
void DEV_ADMITTANCE::precalc_last()
{
ELEMENT::precalc_last();
- set_constant(!has_tr_eval());
+ set_constant(!using_tr_eval());
set_converged(!has_tr_eval());
}
/*--------------------------------------------------------------------------*/
+void DEV_ADMITTANCE::dc_advance()
+{
+ ELEMENT::dc_advance();
+ if(using_tr_eval()){
+ }else{
+ _y[0].f1 = value();
+ _y[0].f0 = LINEAR;
+
+ if(_y[0].f1 != _y1.f1){
+ store_values();
+ _m0.c1 = _y[0].f1;
+ _m0.c0 = 0.;
+ q_load();
+ // set_constant(false); not needed. nothing to do in do_tr.
+ }else{
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
void DEV_ADMITTANCE::tr_begin()
{
ELEMENT::tr_begin();
diff --git a/apps/d_cap.cc b/apps/d_cap.cc
index 112fb629..120d4ab3 100644
--- a/apps/d_cap.cc
+++ b/apps/d_cap.cc
@@ -41,30 +41,30 @@ protected:
public:
explicit DEV_CAPACITANCE() :STORAGE() {}
protected: // override virtual
- char id_letter()const {return 'C';}
- std::string value_name()const {return "c";}
- std::string dev_type()const {return "capacitor";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return 2;}
- bool has_iv_probe()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_CAPACITANCE(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_passive();}
- bool do_tr();
- void tr_load() {tr_load_passive();}
- void tr_unload() {tr_unload_passive();}
- double tr_involts()const {return tr_outvolts();}
- double tr_involts_limited()const {return tr_outvolts_limited();}
- double tr_probe_num(const std::string&)const;
- void ac_iwant_matrix() {ac_iwant_matrix_passive();}
- void ac_begin() {_ev = _y[0].f1;}
- void do_ac();
- void ac_load() {ac_load_passive();}
- COMPLEX ac_involts()const {itested();return ac_outvolts();}
+ char id_letter()const override {return 'C';}
+ std::string value_name()const override{return "c";}
+ std::string dev_type()const override {return "capacitor";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return 2;}
+ bool has_iv_probe()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_CAPACITANCE(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_passive();}
+ bool do_tr()override;
+ void tr_load()override {tr_load_passive();}
+ void tr_unload()override {tr_unload_passive();}
+ double tr_involts()const override {return tr_outvolts();}
+ double tr_involts_limited()const override {return tr_outvolts_limited();}
+ double tr_probe_num(const std::string&)const override;
+ void ac_iwant_matrix()override {ac_iwant_matrix_passive();}
+ void ac_begin()override {STORAGE::ac_begin(); _ev = _y[0].f1;}
+ void do_ac()override;
+ void ac_load()override {ac_load_passive();}
+ COMPLEX ac_involts()const override {itested();return ac_outvolts();}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
@@ -78,24 +78,24 @@ private:
public:
explicit DEV_TRANSCAP() :DEV_CAPACITANCE() {}
private: // override virtual
- char id_letter()const {untested();return '\0';}
- std::string value_name()const {untested(); return "c";}
- std::string dev_type()const {return "tcap";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- bool has_iv_probe()const {untested(); return false;}
- bool f_is_value()const {untested();return true;}
- CARD* clone()const {return new DEV_TRANSCAP(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_active();}
- void tr_load() {tr_load_active();}
- double tr_involts()const {return dn_diff(_n[IN1].v0(),_n[IN2].v0());}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- void ac_iwant_matrix() {ac_iwant_matrix_active();}
- void ac_load() {untested(); ac_load_active();}
+ char id_letter()const override {untested();return '\0';}
+ std::string value_name()const override{untested(); return "c";}
+ std::string dev_type()const override {return "tcap";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ bool has_iv_probe()const override {untested(); return false;}
+ bool f_is_value()const override {untested();return true;}
+ CARD* clone()const override {return new DEV_TRANSCAP(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_active();}
+ void tr_load()override {tr_load_active();}
+ double tr_involts()const override {return dn_diff(_n[IN1].v0(),_n[IN2].v0());}
+ double tr_involts_limited()const override {return volts_limited(_n[IN1],_n[IN2]);}
+ void ac_iwant_matrix()override {ac_iwant_matrix_active();}
+ void ac_load()override {untested(); ac_load_active();}
- std::string port_name(int i)const {untested();
+ std::string port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"p", "n", "ps", "ns"};
@@ -110,23 +110,23 @@ private:
public:
explicit DEV_VCCAP() :DEV_CAPACITANCE() {}
private: // override virtual
- char id_letter()const {untested();return '\0';}
- std::string value_name()const {untested(); return "c";}
- std::string dev_type()const {return "vccap";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- bool has_iv_probe()const {untested(); return false;}
- bool f_is_value()const {untested();return true;}
- CARD* clone()const {return new DEV_VCCAP(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- bool do_tr();
- double tr_involts()const {return dn_diff(_n[IN1].v0(),_n[IN2].v0());}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
+ char id_letter()const override {untested();return '\0';}
+ std::string value_name()const override{untested(); return "c";}
+ std::string dev_type()const override {return "vccap";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ bool has_iv_probe()const override {untested(); return false;}
+ bool f_is_value()const override {untested();return true;}
+ CARD* clone()const override {return new DEV_VCCAP(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_extended();}
+ bool do_tr()override;
+ double tr_involts()const override {return dn_diff(_n[IN1].v0(),_n[IN2].v0());}
+ double tr_involts_limited()const override {return volts_limited(_n[IN1],_n[IN2]);}
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
- std::string port_name(int i)const {untested();
+ std::string port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"p", "n", "ps", "ns"};
diff --git a/apps/d_cccs.cc b/apps/d_cccs.cc
index 5838cb65..286fca33 100644
--- a/apps/d_cccs.cc
+++ b/apps/d_cccs.cc
@@ -35,29 +35,30 @@ private:
public:
explicit DEV_CCCS() :CCSRC_BASE() {}
private: // override virtual
- char id_letter()const {return 'F';}
- std::string value_name()const {return "gain";}
- std::string dev_type()const {return "cccs";}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_CCCS(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_active();}
- void tr_begin();
- bool do_tr() {_sim->_late_evalq.push_back(this); return true;}
- bool do_tr_last();
- void tr_load() {tr_load_active();}
- void ac_iwant_matrix() {ac_iwant_matrix_active();}
- void ac_begin() {_ev = _y[0].f1;}
- void do_ac();
- void ac_load() {ac_load_active();}
+ char id_letter()const override {return 'F';}
+ std::string value_name()const override{return "gain";}
+ std::string dev_type()const override {return "cccs";}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_CCCS(*this);}
+ void precalc_last()override;
+ void dc_advance()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_active();}
+ void tr_begin()override;
+ bool do_tr()override {_sim->_late_evalq.push_back(this); return true;}
+ bool do_tr_last()override;
+ void tr_load()override {tr_load_active();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_active();}
+ void ac_begin()override {CCSRC_BASE::ac_begin(); _ev = _y[0].f1;}
+ void do_ac()override;
+ void ac_load()override {ac_load_active();}
- std::string port_name(int i)const {untested();
+ std::string port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"sink", "src"};
return names[i];
}
- std::string current_port_name(int i)const {untested();
+ std::string current_port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 1);
static std::string names[] = {"in"};
@@ -66,11 +67,28 @@ private: // override virtual
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
+void DEV_CCCS::dc_advance()
+{
+ CCSRC_BASE::dc_advance();
+ if(using_tr_eval()){
+ }else{
+ _y[0].f1 = value();
+
+ if(_y1.f1 != _y[0].f1){
+ store_values();
+ // q_load(); // called unconditionally in do_tr_last.
+ _m0.c0 = _y[0].f1;
+ // set_constant(false); not needed. nothing to do in do_tr.
+ }else{
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
void DEV_CCCS::precalc_last()
{
CCSRC_BASE::precalc_last();
- set_converged();
- assert(!is_constant()); /* because of incomplete analysis */
+ set_converged(!has_tr_eval());
+ set_constant(!using_tr_eval());
}
/*--------------------------------------------------------------------------*/
void DEV_CCCS::tr_begin()
diff --git a/apps/d_ccvs.cc b/apps/d_ccvs.cc
index 76ef02ca..8de31f29 100644
--- a/apps/d_ccvs.cc
+++ b/apps/d_ccvs.cc
@@ -35,30 +35,30 @@ private:
public:
explicit DEV_CCVS() :CCSRC_BASE() {}
private: // override virtual
- char id_letter()const {return 'H';}
- std::string value_name()const {untested(); return "gain";}
- std::string dev_type()const {return "ccvs";}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_CCVS(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- void tr_begin();
- bool do_tr() {_sim->_late_evalq.push_back(this); return true;}
- bool do_tr_last();
- void tr_load() {tr_load_shunt(); tr_load_active();}
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void ac_begin() {_loss1=_loss0=1./OPT::shortckt; _ev = _y[0].f1;}
- void do_ac();
- void ac_load() {ac_load_active();}
- COMPLEX ac_amps()const {untested(); return ELEMENT::ac_amps();}
+ char id_letter()const override {return 'H';}
+ std::string value_name()const override{itested(); return "gain";}
+ std::string dev_type()const override {return "ccvs";}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_CCVS(*this);}
+ void precalc_last() override;
+ void tr_iwant_matrix() override {tr_iwant_matrix_extended();}
+ void tr_begin()override;
+ bool do_tr()override {_sim->_late_evalq.push_back(this); return true;}
+ bool do_tr_last()override;
+ void tr_load()override {tr_load_shunt(); tr_load_active();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void ac_begin()override {_loss1=_loss0=1./OPT::shortckt; _ev = _y[0].f1;}
+ void do_ac()override;
+ void ac_load()override {ac_load_active();}
+ COMPLEX ac_amps()const override {untested(); return ELEMENT::ac_amps();}
- std::string port_name(int i)const {untested();
+ std::string port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
return names[i];
}
- std::string current_port_name(int i)const {untested();
+ std::string current_port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 1);
static std::string names[] = {"in"};
diff --git a/apps/d_coil.cc b/apps/d_coil.cc
index 19765d5b..688f82c5 100644
--- a/apps/d_coil.cc
+++ b/apps/d_coil.cc
@@ -41,39 +41,40 @@ public:
explicit DEV_INDUCTANCE()
:STORAGE(), _c_model(false) {}
public: // override virtual
- char id_letter()const {return 'L';}
- std::string value_name()const {return "l";}
- std::string dev_type()const {return "inductor";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int net_nodes()const {return 2;}
- int int_nodes()const {return (!_c_model) ? 0 : 1;}
- int matrix_nodes()const {return net_nodes() + int_nodes();}
+ char id_letter()const override {return 'L';}
+ std::string value_name()const override {return "l";}
+ std::string dev_type()const override {return "inductor";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int net_nodes()const override {return 2;}
+ int int_nodes()const override {return (!_c_model) ? 0 : 1;}
+ int matrix_nodes()const override {return net_nodes() + int_nodes();}
- bool has_inode()const {return _c_model;}
- bool has_iv_probe()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_INDUCTANCE(*this);}
- void expand();
- void tr_iwant_matrix();
- void tr_begin();
- bool do_tr();
- void tr_load();
- void tr_unload();
- double tr_involts()const {return tr_outvolts();}
- double tr_input()const;
- double tr_involts_limited()const {return tr_outvolts_limited();}
- double tr_input_limited()const;
- double tr_amps()const;
- double tr_probe_num(const std::string&)const;
- void ac_iwant_matrix();
- void ac_begin() {_loss1 = _loss0 = ((!_c_model) ? 0. : 1.); _ev = _y[0].f1;}
- void do_ac();
- void ac_load();
- COMPLEX ac_involts()const {return ac_outvolts();}
- COMPLEX ac_amps()const;
+ bool has_inode()const override {return _c_model;}
+ bool has_iv_probe()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_INDUCTANCE(*this);}
+ void expand()override;
+ void precalc_last()override;
+ void tr_iwant_matrix()override;
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override;
+ void tr_unload()override;
+ double tr_involts()const override {return tr_outvolts();}
+ double tr_input()const override;
+ double tr_involts_limited()const override {return tr_outvolts_limited();}
+ double tr_input_limited()const override;
+ double tr_amps()const override;
+ double tr_probe_num(const std::string&)const override;
+ void ac_iwant_matrix()override;
+ void ac_begin()override;
+ void do_ac()override;
+ void ac_load()override;
+ COMPLEX ac_involts()const override {return ac_outvolts();}
+ COMPLEX ac_amps()const override;
- std::string port_name(int i)const {itested();
+ std::string port_name(int i)const override {itested();
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
@@ -105,44 +106,44 @@ private:
public:
explicit DEV_MUTUAL_L();
private: // override virtual
- char id_letter()const {return 'K';}
- bool print_type_in_spice()const {return false;}
- std::string value_name()const {return "k";}
- std::string dev_type()const {untested(); return "mutual_inductor";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return 0;}
- int num_current_ports()const {return 2;}
- bool has_iv_probe()const {untested(); return false;}
- bool use_obsolete_callback_parse()const {return false;}
- CARD* clone()const {return new DEV_MUTUAL_L(*this);}
- void expand_first();
- void expand_last();
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_passive();}
- void tr_begin();
- void dc_advance();
- void tr_advance();
- bool do_tr() {_sim->_late_evalq.push_back(this); return true;}
- bool do_tr_last();
- void tr_load();
- TIME_PAIR tr_review() {return TIME_PAIR(NEVER,NEVER);}
- void tr_unload();
- double tr_input()const {return tr_involts();}
- double tr_input_limited()const {untested(); return tr_involts_limited();}
- double tr_amps()const {untested(); return _loss0 * tr_outvolts();}
- double tr_probe_num(const std::string&)const;
+ char id_letter()const override {return 'K';}
+ bool print_type_in_spice()const override {return false;}
+ std::string value_name()const override {return "k";}
+ std::string dev_type()const override {untested(); return "mutual_inductor";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return 0;}
+ int num_current_ports()const override {return 2;}
+ bool has_iv_probe()const override {untested(); return false;}
+ bool use_obsolete_callback_parse()const override {return false;}
+ CARD* clone()const override {return new DEV_MUTUAL_L(*this);}
+ void expand_first()override;
+ void expand_last()override;
+ void precalc_last()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_passive();}
+ void tr_begin()override;
+ void dc_advance()override;
+ void tr_advance()override;
+ bool do_tr()override {_sim->_late_evalq.push_back(this); return true;}
+ bool do_tr_last()override;
+ void tr_load()override;
+ TIME_PAIR tr_review()override {return TIME_PAIR(NEVER,NEVER);}
+ void tr_unload()override;
+ double tr_input()const override {return tr_involts();}
+ double tr_input_limited()const override {untested(); return tr_involts_limited();}
+ double tr_amps()const override {untested(); return _loss0 * tr_outvolts();}
+ double tr_probe_num(const std::string&)const override;
- void ac_iwant_matrix() {ac_iwant_matrix_passive();}
- void ac_load();
- COMPLEX ac_amps()const {untested(); return _loss0 * ac_outvolts();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_passive();}
+ void ac_load()override;
+ COMPLEX ac_amps()const override {untested(); return _loss0 * ac_outvolts();}
- void set_port_by_name(std::string& Name, std::string& Value)
- {untested(); COMPONENT::set_port_by_name(Name,Value);}
- void set_port_by_index(int Index, std::string& Value)
+ int set_port_by_name(std::string& Name, std::string& Value)override
+ {untested(); return COMPONENT::set_port_by_name(Name,Value);}
+ void set_port_by_index(int Index, std::string& Value)override
{set_current_port_by_index(Index, Value);}
- bool node_is_connected(int i)const {
+ bool node_is_connected(int i)const override {
switch (i) {
case 0: return _output_label != "";
case 1: return _input_label != "";
@@ -150,23 +151,23 @@ private: // override virtual
}
}
- std::string port_name(int)const {untested();
+ std::string port_name(int)const override {untested();
return "";
}
- std::string current_port_name(int i)const {untested();
+ std::string current_port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"l1", "l2"};
return names[i];
}
- const std::string current_port_value(int i)const {
+ const std::string current_port_value(int i)const override {
switch (i) {
case 0: return _output_label;
case 1: return _input_label;
default: unreachable(); return COMPONENT::current_port_value(i);
}
}
- void set_current_port_by_index(int i, const std::string& s) {
+ void set_current_port_by_index(int i, const std::string& s) override {
switch (i) {
case 0: _output_label = s; break;
case 1: _input_label = s; break;
@@ -214,6 +215,18 @@ DEV_MUTUAL_L::DEV_MUTUAL_L(const DEV_MUTUAL_L& p)
assert(_yr1 == _yr[0]);
}
/*--------------------------------------------------------------------------*/
+void DEV_INDUCTANCE::precalc_last()
+{
+ STORAGE::precalc_last();
+ // Something like it should be moved to ac_begin.
+ if (_sim->has_op() == s_NONE) {
+ _y[0].x = 0.;
+ _y[0].f0 = LINEAR;
+ _y[0].f1 = value();
+ }else{
+ }
+}
+/*--------------------------------------------------------------------------*/
void DEV_INDUCTANCE::expand()
{
STORAGE::expand();
@@ -490,6 +503,14 @@ void DEV_INDUCTANCE::ac_iwant_matrix()
}
}
/*--------------------------------------------------------------------------*/
+void DEV_INDUCTANCE::ac_begin()
+{
+ // STORAGE::ac_begin();
+
+ _loss1 = _loss0 = ((!_c_model) ? 0. : 1.);
+ _ev = _y[0].f1;
+}
+/*--------------------------------------------------------------------------*/
void DEV_INDUCTANCE::do_ac()
{
if (using_ac_eval()) {
diff --git a/apps/d_cs.cc b/apps/d_cs.cc
index f1fb6274..a66c1671 100644
--- a/apps/d_cs.cc
+++ b/apps/d_cs.cc
@@ -34,34 +34,35 @@ private:
public:
explicit DEV_CS() :ELEMENT() {}
private: // override virtual
- char id_letter()const {return 'I';}
- std::string value_name()const {itested(); return "dc";}
- std::string dev_type()const {return "isource";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return 2;}
- bool is_source()const {return true;}
- bool f_is_value()const {return true;}
- bool has_iv_probe()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_CS(*this);}
- void precalc_last();
- void tr_iwant_matrix() {/* nothing */}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_source();}
- void tr_unload() {untested();tr_unload_source();}
- double tr_involts()const {return 0.;}
- double tr_involts_limited()const {unreachable(); return 0.;}
- void ac_iwant_matrix() {/* nothing */}
- void ac_begin() {_acg = _ev = 0.;}
- void do_ac();
- void ac_load() {ac_load_source();}
- COMPLEX ac_involts()const {untested();return 0.;}
- COMPLEX ac_amps()const {return _acg;}
+ char id_letter()const override {return 'I';}
+ std::string value_name()const override{return "dc";}
+ std::string dev_type()const override {return "isource";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return 2;}
+ bool is_source()const override {return true;}
+ bool f_is_value()const override {return true;}
+ bool has_iv_probe()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_CS(*this);}
+ void precalc_last()override;
+ void dc_advance()override;
+ void tr_iwant_matrix()override {/* nothing */}
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_source();}
+ void tr_unload()override {untested();tr_unload_source();}
+ double tr_involts()const override {return 0.;}
+ double tr_involts_limited()const override {unreachable(); return 0.;}
+ void ac_iwant_matrix()override {/* nothing */}
+ void ac_begin()override {_acg = _ev = 0.;}
+ void do_ac()override;
+ void ac_load()override {ac_load_source();}
+ COMPLEX ac_involts()const override {untested();return 0.;}
+ COMPLEX ac_amps()const override {return _acg;}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
@@ -72,11 +73,27 @@ private: // override virtual
/*--------------------------------------------------------------------------*/
void DEV_CS::precalc_last()
{
- //ELEMENT::precalc_last(); //BUG// skip
- COMPONENT::precalc_last();
- set_constant(!has_tr_eval());
+ ELEMENT::precalc_last();
+ set_constant(!using_tr_eval());
set_converged(!has_tr_eval());
- set_constant(false);
+}
+/*--------------------------------------------------------------------------*/
+void DEV_CS::dc_advance()
+{
+ ELEMENT::dc_advance();
+
+ if(using_tr_eval()){
+ }else{
+ _y[0].f1 = value();
+
+ if(_y1.f1 != _y[0].f1){
+ store_values();
+ q_load();
+ _m0.c0 = _y[0].f1;
+ // set_constant(false); not needed. nothing to do in do_tr.
+ }else{
+ }
+ }
}
/*--------------------------------------------------------------------------*/
void DEV_CS::tr_begin()
@@ -103,7 +120,7 @@ bool DEV_CS::do_tr()
q_load();
_m0.c0 = _y[0].f1;
assert(_m0.c1 == 0.);
- }else{untested();
+ }else{
assert(_y[0].x == 0.);
assert(_y[0].f0 == 0.);
assert(_y[0].f1 == value());
@@ -121,7 +138,7 @@ void DEV_CS::do_ac()
if (using_ac_eval()) {
ac_eval();
_acg = _ev;
- }else{untested();
+ }else{itested();
assert(_acg == 0.);
}
}
diff --git a/lib/d_logic.cc b/apps/d_logic.cc
index 4ac5285e..c86322c3 100644
--- a/lib/d_logic.cc
+++ b/apps/d_logic.cc
@@ -24,34 +24,241 @@
* device: mxxxx out gnd vdd in1 in2 ... family gatetype
* model: .model mname LOGIC <args>
*/
-//testing=script,sparse 2006.07.17
+//testing=script,sparse 2023.11.22
+#include "e_logicmod.h"
+#include "u_lang.h"
#include "globals.h"
#include "e_subckt.h"
#include "u_xprobe.h"
-#include "d_logic.h"
+#include "e_elemnt.h"
/*--------------------------------------------------------------------------*/
-int DEV_LOGIC::_count = -1;
-int COMMON_LOGIC::_count = -1;
-int MODEL_LOGIC::_count = -1; // there is one in e_node.cc, and the dispatcher
-static LOGIC_NONE Default_LOGIC(CC_STATIC);
+namespace {
+/*--------------------------------------------------------------------------*/
+class DEV_LOGIC : public ELEMENT {
+public:
+ enum {OUTNODE=0,BEGIN_IN=1}; //node labels
+ enum {PORTS_PER_GATE = 10};
+private:
+ int _lastchangenode;
+ int _quality;
+ std::string _failuremode;
+ smode_t _oldgatemode;
+ smode_t _gatemode;
+ static int _count;
+ node_t nodes[PORTS_PER_GATE]; /* PORTS_PER_GATE <= PORTSPERSUBCKT */
+public:
+ explicit DEV_LOGIC(COMMON_COMPONENT* c=NULL);
+ explicit DEV_LOGIC(const DEV_LOGIC& p);
+ ~DEV_LOGIC() {--_count;}
+private: // override virtuals
+ char id_letter()const override {untested();return 'U';}
+ std::string value_name()const override{return "";}
+ bool print_type_in_spice()const override{return true;}
+ std::string dev_type()const override{assert(has_common()); return common()->name();}
+ int tail_size()const override {return 2;}
+ int max_nodes()const override {return PORTS_PER_GATE;}
+ int min_nodes()const override {return BEGIN_IN+1;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return _net_nodes;}
+ CARD* clone()const override {return new DEV_LOGIC(*this);}
+ void precalc_first()override {ELEMENT::precalc_first(); if (subckt()) {subckt()->precalc_first();}}
+ void expand()override;
+ void precalc_last() override{ELEMENT::precalc_last(); if (subckt()) {subckt()->precalc_last();}}
+ //void map_nodes();
+
+ void tr_iwant_matrix()override;
+ void tr_begin()override;
+ void tr_restore()override;
+ void dc_advance()override;
+ void tr_advance()override;
+ void tr_regress()override;
+ bool tr_needs_eval()const override;
+ void tr_queue_eval()override;
+ bool do_tr()override;
+ void tr_load()override;
+ void tr_unload()override;
+ TIME_PAIR tr_review()override;
+ void tr_accept()override;
+ double tr_involts()const override {unreachable(); return 0;}
+ //double tr_input()const //ELEMENT
+ double tr_involts_limited()const override {unreachable(); return 0;}
+ //double tr_input_limited()const //ELEMENT
+ //double tr_amps()const //ELEMENT
+ double tr_probe_num(const std::string&)const override;
+
+ void ac_iwant_matrix()override;
+ void ac_begin()override;
+ void do_ac()override {untested(); assert(subckt()); subckt()->do_ac();}
+ void ac_load()override {untested(); assert(subckt()); subckt()->ac_load();}
+ COMPLEX ac_involts()const override {unreachable(); return 0.;}
+ COMPLEX ac_amps()const override {unreachable(); return 0.;}
+ XPROBE ac_probe_ext(const std::string&)const override;
+
+ std::string port_name(int i)const override {
+ assert(i >= 0);
+ assert(i < PORTS_PER_GATE);
+ static std::string names[PORTS_PER_GATE] = {"out",
+ "in1", "in2", "in3", "in4", "in5", "in6", "in7", "in8", "in9"};
+ return names[i];
+ }
+public:
+ static int count() {untested();return _count;}
+private:
+ bool tr_eval_digital();
+ bool want_analog()const;
+ bool want_digital()const;
+};
/*--------------------------------------------------------------------------*/
-static DEV_LOGIC p1;
-static DISPATCHER<CARD>::INSTALL
-d1(&device_dispatcher, "U|logic", &p1);
+class INTERFACE COMMON_LOGIC : public COMMON_COMPONENT {
+protected:
+ explicit COMMON_LOGIC(int c=0)
+ :COMMON_COMPONENT(c) {++_count;}
+ explicit COMMON_LOGIC(const COMMON_LOGIC& p)
+ :COMMON_COMPONENT(p) {++_count;}
+public:
+ ~COMMON_LOGIC() {--_count;}
+ bool operator==(const COMMON_COMPONENT&)const override;
+ static int count() {untested();return _count;}
+ virtual LOGICVAL logic_eval(const node_t*, int)const = 0;
+
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (1 + COMMON_COMPONENT::param_count());}
+protected:
+ static int _count;
+};
/*--------------------------------------------------------------------------*/
-static MODEL_LOGIC p2(&p1);
-static DISPATCHER<MODEL_CARD>::INSTALL
-d2(&model_dispatcher, "logic", &p2);
+class LOGIC_AND : public COMMON_LOGIC {
+private:
+ explicit LOGIC_AND(const LOGIC_AND& p) :COMMON_LOGIC(p){itested();++_count;}
+ COMMON_COMPONENT* clone()const override{itested();return new LOGIC_AND(*this);}
+public:
+ explicit LOGIC_AND(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int incount)const override {itested();
+ LOGICVAL out(n[0]->lv());
+ for (int ii=1; ii<incount; ++ii) {itested();
+ out &= n[ii]->lv();
+ }
+ return out;
+ }
+ std::string name()const override {itested();return "and";}
+};
+/*--------------------------------------------------------------------------*/
+class LOGIC_NAND : public COMMON_LOGIC {
+private:
+ explicit LOGIC_NAND(const LOGIC_NAND&p):COMMON_LOGIC(p){++_count;}
+ COMMON_COMPONENT* clone()const override {return new LOGIC_NAND(*this);}
+public:
+ explicit LOGIC_NAND(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int incount)const override {itested();
+ LOGICVAL out(n[0]->lv());
+ for (int ii=1; ii<incount; ++ii) {itested();
+ out &= n[ii]->lv();
+ }
+ return ~out;
+ }
+ std::string name()const override {return "nand";}
+};
+/*--------------------------------------------------------------------------*/
+class LOGIC_OR : public COMMON_LOGIC {
+private:
+ explicit LOGIC_OR(const LOGIC_OR& p) :COMMON_LOGIC(p){itested();++_count;}
+ COMMON_COMPONENT* clone()const override {itested(); return new LOGIC_OR(*this);}
+public:
+ explicit LOGIC_OR(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int incount)const override{untested();
+ LOGICVAL out(n[0]->lv());
+ for (int ii=1; ii<incount; ++ii) {untested();
+ out |= n[ii]->lv();
+ }
+ return out;
+ }
+ std::string name()const override {itested();return "or";}
+};
+/*--------------------------------------------------------------------------*/
+class LOGIC_NOR : public COMMON_LOGIC {
+private:
+ explicit LOGIC_NOR(const LOGIC_NOR& p) :COMMON_LOGIC(p) {++_count;}
+ COMMON_COMPONENT* clone()const override {return new LOGIC_NOR(*this);}
+public:
+ explicit LOGIC_NOR(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int incount)const override {
+ LOGICVAL out(n[0]->lv());
+ for (int ii=1; ii<incount; ++ii) {
+ out |= n[ii]->lv();
+ }
+ return ~out;
+ }
+ std::string name()const override {return "nor";}
+};
+/*--------------------------------------------------------------------------*/
+class LOGIC_XOR : public COMMON_LOGIC {
+private:
+ explicit LOGIC_XOR(const LOGIC_XOR& p) :COMMON_LOGIC(p){itested();++_count;}
+ COMMON_COMPONENT* clone()const override {itested(); return new LOGIC_XOR(*this);}
+public:
+ explicit LOGIC_XOR(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int incount)const override {untested();
+ LOGICVAL out(n[0]->lv());
+ for (int ii=1; ii<incount; ++ii) {untested();
+ out ^= n[ii]->lv();
+ }
+ return out;
+ }
+ std::string name()const override {itested();return "xor";}
+};
/*--------------------------------------------------------------------------*/
-DEV_LOGIC::DEV_LOGIC()
- :ELEMENT(),
+class LOGIC_XNOR : public COMMON_LOGIC {
+private:
+ explicit LOGIC_XNOR(const LOGIC_XNOR&p):COMMON_LOGIC(p){itested();++_count;}
+ COMMON_COMPONENT* clone()const override {itested(); return new LOGIC_XNOR(*this);}
+public:
+ explicit LOGIC_XNOR(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int incount)const override {untested();
+ LOGICVAL out(n[0]->lv());
+ for (int ii=1; ii<incount; ++ii) {untested();
+ out ^= n[ii]->lv();
+ }
+ return ~out;
+ }
+ std::string name()const override {itested();return "xnor";}
+};
+/*--------------------------------------------------------------------------*/
+class LOGIC_INV : public COMMON_LOGIC {
+private:
+ explicit LOGIC_INV(const LOGIC_INV& p) :COMMON_LOGIC(p){++_count;}
+ COMMON_COMPONENT* clone()const override {return new LOGIC_INV(*this);}
+public:
+ explicit LOGIC_INV(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t* n, int)const override {
+ return ~n[0]->lv();
+ }
+ std::string name()const override {return "inv";}
+};
+/*--------------------------------------------------------------------------*/
+class LOGIC_NONE : public COMMON_LOGIC {
+private:
+ explicit LOGIC_NONE(const LOGIC_NONE&p):COMMON_LOGIC(p){untested();++_count;}
+ COMMON_COMPONENT* clone()const override {untested(); return new LOGIC_NONE(*this);}
+public:
+ explicit LOGIC_NONE(int c=0) :COMMON_LOGIC(c) {}
+ LOGICVAL logic_eval(const node_t*, int)const override {untested();
+ return lvUNKNOWN;
+ }
+ std::string name()const override {untested();return "error";}
+};
+/*--------------------------------------------------------------------------*/
+DEV_LOGIC::DEV_LOGIC(COMMON_COMPONENT* c)
+ :ELEMENT(c),
_lastchangenode(0),
_quality(qGOOD),
_failuremode("ok"),
_oldgatemode(moUNKNOWN),
_gatemode(moUNKNOWN)
{
- attach_common(&Default_LOGIC);
_n = nodes;
++_count;
}
@@ -77,16 +284,15 @@ void DEV_LOGIC::expand()
ELEMENT::expand();
const COMMON_LOGIC* c = prechecked_cast<const COMMON_LOGIC*>(common());
assert(c);
-
- attach_model();
+ attach_model();
const MODEL_LOGIC* m = dynamic_cast<const MODEL_LOGIC*>(c->model());
if (!m) {
throw Exception_Model_Type_Mismatch(long_label(), c->modelname(), "logic family (LOGIC)");
}else{
}
- std::string subckt_name(c->modelname()+c->name()+to_string(c->incount));
+ std::string subckt_name(c->modelname()+c->name()+to_string(net_nodes()-BEGIN_IN));
try {
const CARD* model = find_looking_out(subckt_name);
@@ -112,7 +318,7 @@ void DEV_LOGIC::tr_iwant_matrix()
subckt()->tr_iwant_matrix();
}else{
}
- tr_iwant_matrix_passive();
+ ////////tr_iwant_matrix_passive();
}
/*--------------------------------------------------------------------------*/
void DEV_LOGIC::tr_begin()
@@ -247,8 +453,8 @@ bool DEV_LOGIC::tr_needs_eval()const
}else{
}
return (_sim->analysis_is_static() || _sim->analysis_is_restore());
- case moANALOG:
- untested();
+ case moANALOG:untested();
+
assert(!is_q_for_eval());
assert(subckt());
return subckt()->tr_needs_eval();
@@ -289,7 +495,7 @@ bool DEV_LOGIC::tr_eval_digital()
_y[0].f0 = 0.;
_m0.x = 0.;
_m0.c1 = 1./m->rs;
- _m0.c0 = _y[0].f1 / -m->rs;
+ _m0.c0 = _y[0].f1 / m->rs;
set_converged(conv_check());
store_values();
q_load();
@@ -313,11 +519,39 @@ void DEV_LOGIC::tr_load()
switch (_gatemode) {
case moUNKNOWN: unreachable(); break;
case moMIXED: unreachable(); break;
- case moDIGITAL: tr_load_passive(); break;
+ case moDIGITAL:
+ tr_load_diagonal_point(_n[OUTNODE], &_m0.c1, &_m1.c1);
+ tr_load_source_point(_n[OUTNODE], &_m0.c0, &_m1.c0);
+ break;
case moANALOG: assert(subckt()); subckt()->tr_load(); break;
}
}
/*--------------------------------------------------------------------------*/
+void DEV_LOGIC::tr_unload()
+{
+ if (subckt()) {
+ switch (_gatemode) {
+ case moUNKNOWN: unreachable(); break;
+ case moMIXED: unreachable(); break;
+ case moDIGITAL: break;
+ case moANALOG: untested(); break;
+ }
+ subckt()->tr_unload();
+ assert(_m0.c0 == 0.);
+ assert(_m0.c1 == 0.);
+ }else{untested();
+ switch (_gatemode) {
+ case moUNKNOWN: unreachable(); break;
+ case moMIXED: unreachable(); break;
+ case moDIGITAL: untested(); break;
+ case moANALOG: untested(); break;
+ }
+ _m0.c0 = _m0.c1 = 0.;
+ _sim->mark_inc_mode_bad();
+ tr_load();
+ }
+}
+/*--------------------------------------------------------------------------*/
TIME_PAIR DEV_LOGIC::tr_review()
{
// not calling ELEMENT::tr_review();
@@ -406,7 +640,7 @@ void DEV_LOGIC::tr_accept()
|| _lastchangenode != OUTNODE
|| _sim->analysis_is_static()
|| _sim->analysis_is_restore()) {
- LOGICVAL future_state = c->logic_eval(&_n[BEGIN_IN]);
+ LOGICVAL future_state = c->logic_eval(&_n[BEGIN_IN], net_nodes()-BEGIN_IN);
// ^^^^^^^^^^
if ((_n[OUTNODE]->is_unknown()) &&
(_sim->analysis_is_static() || _sim->analysis_is_restore())) {
@@ -437,7 +671,7 @@ void DEV_LOGIC::tr_accept()
_n[OUTNODE]->set_event(m->delay, future_state);
_sim->new_event(_n[OUTNODE]->final_time());
//assert(future_state == _n[OUTNODE].lv_future());
- if (_lastchangenode == OUTNODE) {
+ if (_lastchangenode == OUTNODE) {untested();
unreachable();
error(bDANGER, "%s:%u:%g non-event state change\n",
long_label().c_str(), _sim->iteration_tag(), _sim->_time0);
@@ -454,15 +688,6 @@ void DEV_LOGIC::tr_accept()
}
}
/*--------------------------------------------------------------------------*/
-void DEV_LOGIC::tr_unload()
-{
- if (subckt()) {
- subckt()->tr_unload();
- }else{untested();
- }
- tr_unload_passive();
-}
-/*--------------------------------------------------------------------------*/
void DEV_LOGIC::ac_iwant_matrix()
{
if (subckt()) {
@@ -506,7 +731,6 @@ bool COMMON_LOGIC::operator==(const COMMON_COMPONENT& x)const
{
const COMMON_LOGIC* p = dynamic_cast<const COMMON_LOGIC*>(&x);
bool rv = p
- && incount == p->incount
&& COMMON_COMPONENT::operator==(x);
if (rv) {
}else{
@@ -514,5 +738,96 @@ bool COMMON_LOGIC::operator==(const COMMON_COMPONENT& x)const
return rv;
}
/*--------------------------------------------------------------------------*/
+void COMMON_LOGIC::set_param_by_index(int I, std::string& Value, int Offset)
+{
+ switch (COMMON_LOGIC::param_count() - 1 - I) {
+ case 0: _modelname = Value; break;
+ default:untested();untested(); COMMON_COMPONENT::set_param_by_index(I, Value, Offset); break;
+ }
+}
+/*--------------------------------------------------------------------------*/
+bool COMMON_LOGIC::param_is_printable(int I)const
+{
+ switch (COMMON_LOGIC::param_count() - 1 - I) {
+ case 0: return OPT::language
+ && OPT::language->name() != "spice" && OPT::language->name() != "acs";
+ default: return COMMON_COMPONENT::param_is_printable(I);
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string COMMON_LOGIC::param_name(int I)const
+{
+ switch (COMMON_LOGIC::param_count() - 1 - I) {
+ case 0: return "model";
+ default:untested(); return COMMON_COMPONENT::param_name(I);
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string COMMON_LOGIC::param_name(int I, int j)const
+{
+ if (j == 0) {
+ return param_name(I);
+ }else if (I >= COMMON_COMPONENT::param_count()) {untested();
+ return "";
+ }else{untested();
+ return COMMON_COMPONENT::param_name(I, j);
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string COMMON_LOGIC::param_value(int I)const
+{
+ switch (COMMON_LOGIC::param_count() - 1 - I) {
+ case 0: return _modelname;
+ default:untested(); return COMMON_COMPONENT::param_value(I);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+int DEV_LOGIC::_count = -1;
+int COMMON_LOGIC::_count = -1;
+/*--------------------------------------------------------------------------*/
+static LOGIC_NONE Default_LOGIC(CC_STATIC);
+static DEV_LOGIC p1(&Default_LOGIC);
+static DISPATCHER<CARD>::INSTALL d1(&device_dispatcher, "logic", &p1);
+
+static LOGIC_AND c_and(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_and(&bm_dispatcher, "and", &c_and);
+static DEV_LOGIC d_and(&c_and);
+static DISPATCHER<CARD>::INSTALL dd_and(&device_dispatcher, "and", &d_and);
+
+static LOGIC_NAND c_nand(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_nand(&bm_dispatcher, "nand", &c_nand);
+static DEV_LOGIC d_nand(&c_nand);
+static DISPATCHER<CARD>::INSTALL dd_nand(&device_dispatcher, "nand", &d_nand);
+
+static LOGIC_OR c_or(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_or(&bm_dispatcher, "or", &c_or);
+static DEV_LOGIC d_or(&c_or);
+static DISPATCHER<CARD>::INSTALL dd_or(&device_dispatcher, "or", &d_or);
+
+static LOGIC_NOR c_nor(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_nor(&bm_dispatcher, "nor", &c_nor);
+static DEV_LOGIC d_nor(&c_nor);
+static DISPATCHER<CARD>::INSTALL dd_nor(&device_dispatcher, "nor", &d_nor);
+
+static LOGIC_XOR c_xor(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_xor(&bm_dispatcher, "xor", &c_xor);
+static DEV_LOGIC d_xor(&c_xor);
+static DISPATCHER<CARD>::INSTALL dd_xor(&device_dispatcher, "xor", &d_xor);
+
+static LOGIC_XNOR c_xnor(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_xnor(&bm_dispatcher, "xnor", &c_xnor);
+static DEV_LOGIC d_xnor(&c_xnor);
+static DISPATCHER<CARD>::INSTALL dd_xnor(&device_dispatcher, "xnor", &d_xnor);
+
+static LOGIC_INV c_inv(CC_STATIC);
+DISPATCHER<COMMON_COMPONENT>::INSTALL dc_inv(&bm_dispatcher, "inv", &c_inv);
+static DEV_LOGIC d_inv(&c_inv);
+static DISPATCHER<CARD>::INSTALL dd_inv(&device_dispatcher, "inv", &d_inv);
+
+static MODEL_LOGIC p2(&p1);
+static DISPATCHER<MODEL_CARD>::INSTALL d2(&model_dispatcher, "logic", &p2);
+}
+/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// vim:ts=8:sw=2:noet:
diff --git a/apps/d_meter.cc b/apps/d_meter.cc
index 7762e55d..f18a011a 100644
--- a/apps/d_meter.cc
+++ b/apps/d_meter.cc
@@ -34,24 +34,24 @@ private:
public:
explicit DEV() :ELEMENT() {}
private: // override virtual
- char id_letter()const {return '\0';}
- std::string value_name()const {return "";}
- std::string dev_type()const {return "meter";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- CARD* clone()const {return new DEV(*this);}
- void tr_iwant_matrix() {}
- void ac_iwant_matrix() {}
- void precalc_last();
- double tr_involts()const {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
- double tr_involts_limited()const {return tr_involts();}
- COMPLEX ac_involts()const {return _n[IN1]->vac() - _n[IN2]->vac();}
- double tr_probe_num(const std::string&)const;
- XPROBE ac_probe_ext(const std::string&)const;
+ char id_letter()const override {return '\0';}
+ std::string value_name()const override {return "";}
+ std::string dev_type()const override {return "meter";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ CARD* clone()const override {return new DEV(*this);}
+ void tr_iwant_matrix()override {}
+ void ac_iwant_matrix()override {}
+ void precalc_last()override;
+ double tr_involts()const override {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
+ double tr_involts_limited()const override {return tr_involts();}
+ COMPLEX ac_involts()const override {return _n[IN1]->vac() - _n[IN2]->vac();}
+ double tr_probe_num(const std::string&)const override;
+ XPROBE ac_probe_ext(const std::string&)const override;
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"outp", "outn", "inp", "inn"};
diff --git a/apps/d_mos123.model b/apps/d_mos123.model
index eb0f1a53..315d5d66 100644
--- a/apps/d_mos123.model
+++ b/apps/d_mos123.model
@@ -95,8 +95,7 @@ model BUILT_IN_MOS123 {
error(((!_sim->is_first_expand()) ? (bDEBUG) : (bWARNING)),
long_label()+": tox <= 0, treating as if not input\n");
}
- if (has_hard_value(nsub_cm) && nsub < NI) {
- untested();
+ if (has_hard_value(nsub_cm) && nsub < NI) { itested();
nsub = NA;
error(((!_sim->is_first_expand()) ? (bDEBUG) : (bWARNING)),
long_label()+": nsub < ni, treating as if not input\n");
diff --git a/apps/d_poly_cap.cc b/apps/d_poly_cap.cc
index 1bf3f3da..66f941d0 100644
--- a/apps/d_poly_cap.cc
+++ b/apps/d_poly_cap.cc
@@ -49,29 +49,29 @@ public:
explicit DEV_CPOLY_CAP();
~DEV_CPOLY_CAP();
protected: // override virtual
- char id_letter()const {unreachable(); return '\0';}
- std::string value_name()const {incomplete(); return "";}
- std::string dev_type()const {unreachable(); return "cpoly_cap";}
- int max_nodes()const {return net_nodes();}
- int min_nodes()const {return net_nodes();}
- int matrix_nodes()const {return _n_ports*2;}
- int net_nodes()const {return _n_ports*2;}
- CARD* clone()const {unreachable();return new DEV_CPOLY_CAP(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- bool tr_needs_eval()const {/*assert(!is_q_for_eval());*/ return true;}
- bool do_tr();
- void tr_load();
- TIME_PAIR tr_review() {return _time_by.reset();}//BUG//review(_i0.f0, _it1.f0);}
- void tr_unload();
- double tr_involts()const {unreachable(); return NOT_VALID;}
- double tr_involts_limited()const {unreachable(); return NOT_VALID;}
- double tr_amps()const;
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void ac_load();
- COMPLEX ac_involts()const {itested(); return NOT_VALID;}
- COMPLEX ac_amps()const {itested(); return NOT_VALID;}
+ char id_letter()const override {unreachable(); return '\0';}
+ std::string value_name()const override{incomplete(); return "";}
+ std::string dev_type()const override {unreachable(); return "cpoly_cap";}
+ int max_nodes()const override {return net_nodes();}
+ int min_nodes()const override {return net_nodes();}
+ int matrix_nodes()const override {return _n_ports*2;}
+ int net_nodes()const override {return _n_ports*2;}
+ CARD* clone()const override {unreachable();return new DEV_CPOLY_CAP(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_extended();}
+ bool tr_needs_eval()const override {/*assert(!is_q_for_eval());*/ return true;}
+ bool do_tr()override;
+ void tr_load()override;
+ TIME_PAIR tr_review()override {return _time_by.reset();}//BUG//review(_i0.f0, _it1.f0);}
+ void tr_unload()override;
+ double tr_involts()const override {unreachable(); return NOT_VALID;}
+ double tr_involts_limited()const override {unreachable(); return NOT_VALID;}
+ double tr_amps()const override;
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void ac_load()override;
+ COMPLEX ac_involts()const override {itested(); return NOT_VALID;}
+ COMPLEX ac_amps()const override {itested(); return NOT_VALID;}
- std::string port_name(int)const {untested();
+ std::string port_name(int)const override {untested();
incomplete();
unreachable();
return "";
@@ -80,7 +80,7 @@ public:
void set_parameters(const std::string& Label, CARD* Parent,
COMMON_COMPONENT* Common, double Value,
int state_count, double state[],
- int node_count, const node_t nodes[]);
+ int node_count, const node_t nodes[])override;
// const double* inputs[]=0);
protected:
bool do_tr_con_chk_and_q();
@@ -93,10 +93,10 @@ private:
public:
explicit DEV_FPOLY_CAP() :DEV_CPOLY_CAP() {}
private: // override virtual
- char id_letter()const {unreachable(); return '\0';}
- std::string dev_type()const{unreachable(); return "fpoly_cap";}
- CARD* clone()const {return new DEV_FPOLY_CAP(*this);}
- bool do_tr();
+ char id_letter()const override {unreachable(); return '\0';}
+ std::string dev_type()const override {unreachable(); return "fpoly_cap";}
+ CARD* clone()const override {return new DEV_FPOLY_CAP(*this);}
+ bool do_tr()override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/apps/d_poly_g.cc b/apps/d_poly_g.cc
index e634937f..91394bc0 100644
--- a/apps/d_poly_g.cc
+++ b/apps/d_poly_g.cc
@@ -47,27 +47,27 @@ public:
explicit DEV_CPOLY_G();
~DEV_CPOLY_G();
protected: // override virtual
- char id_letter()const {unreachable(); return '\0';}
- std::string value_name()const {incomplete(); return "";}
- std::string dev_type()const {unreachable(); return "cpoly_g";}
- int max_nodes()const {return net_nodes();}
- int min_nodes()const {return net_nodes();}
- int matrix_nodes()const {return _n_ports*2;}
- int net_nodes()const {return _n_ports*2;}
- CARD* clone()const {return new DEV_CPOLY_G(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- bool do_tr();
- void tr_load();
- void tr_unload();
- double tr_involts()const {unreachable(); return NOT_VALID;}
- double tr_involts_limited()const {unreachable(); return NOT_VALID;}
- double tr_amps()const;
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void ac_load();
- COMPLEX ac_involts()const {itested(); return NOT_VALID;}
- COMPLEX ac_amps()const {itested(); return NOT_VALID;}
+ char id_letter()const override {unreachable(); return '\0';}
+ std::string value_name()const override{incomplete(); return "";}
+ std::string dev_type()const override {unreachable(); return "cpoly_g";}
+ int max_nodes()const override {return net_nodes();}
+ int min_nodes()const override {return net_nodes();}
+ int matrix_nodes()const override {return _n_ports*2;}
+ int net_nodes()const override {return _n_ports*2;}
+ CARD* clone()const override {return new DEV_CPOLY_G(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_extended();}
+ bool do_tr()override;
+ void tr_load()override;
+ void tr_unload()override;
+ double tr_involts()const override {unreachable(); return NOT_VALID;}
+ double tr_involts_limited()const override {unreachable(); return NOT_VALID;}
+ double tr_amps()const override;
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void ac_load()override;
+ COMPLEX ac_involts()const override {itested(); return NOT_VALID;}
+ COMPLEX ac_amps()const override {itested(); return NOT_VALID;}
- std::string port_name(int)const {untested();
+ std::string port_name(int)const override {untested();
incomplete();
unreachable();
return "";
@@ -76,7 +76,7 @@ public:
void set_parameters(const std::string& Label, CARD* Parent,
COMMON_COMPONENT* Common, double Value,
int state_count, double state[],
- int node_count, const node_t nodes[]);
+ int node_count, const node_t nodes[])override;
// const double* inputs[]=0);
protected:
bool do_tr_con_chk_and_q();
diff --git a/apps/d_res.cc b/apps/d_res.cc
index 8b1d76fa..4ae582ea 100644
--- a/apps/d_res.cc
+++ b/apps/d_res.cc
@@ -35,33 +35,35 @@ private:
public:
explicit DEV_RESISTANCE() :ELEMENT() {}
private: // override virtual
- char id_letter()const {return 'R';}
- std::string value_name()const {return "r";}
- std::string dev_type()const {return "resistor";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return 2;}
- bool has_iv_probe()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_RESISTANCE(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_passive();}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_passive();}
- void tr_unload() {untested();tr_unload_passive();}
- double tr_involts()const {return tr_outvolts();}
- double tr_input()const {untested(); return _m0.c0 + _m0.c1 * tr_involts();}
- double tr_involts_limited()const {return tr_outvolts_limited();}
- double tr_input_limited()const {return _m0.c0+_m0.c1*tr_involts_limited();}
- void ac_iwant_matrix() {ac_iwant_matrix_passive();}
- void ac_begin() {_ev = _y[0].f1; _acg = 1. / _ev;}
- void do_ac();
- void ac_load() {ac_load_passive();}
- COMPLEX ac_involts()const {return ac_outvolts();}
+ char id_letter()const override {return 'R';}
+ std::string value_name()const override{return "r";}
+ std::string dev_type()const override {return "resistor";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return 2;}
+ bool has_iv_probe()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_RESISTANCE(*this);}
+ void precalc_last()override;
+ void dc_advance()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_passive();}
+ void tr_begin()override;
+ void tr_restore()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_passive();}
+ void tr_unload()override {untested();tr_unload_passive();}
+ double tr_involts()const override {return tr_outvolts();}
+ double tr_input()const override {untested(); return _m0.c0 + _m0.c1 * tr_involts();}
+ double tr_involts_limited()const override {return tr_outvolts_limited();}
+ double tr_input_limited()const override {return _m0.c0+_m0.c1*tr_involts_limited();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_passive();}
+ void ac_begin()override;
+ void do_ac()override;
+ void ac_load()override {ac_load_passive();}
+ COMPLEX ac_involts()const override {return ac_outvolts();}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
@@ -72,26 +74,81 @@ private: // override virtual
void DEV_RESISTANCE::precalc_last()
{
ELEMENT::precalc_last();
- set_constant(!has_tr_eval());
+ set_constant(!using_tr_eval());
set_converged(!has_tr_eval());
}
/*--------------------------------------------------------------------------*/
+void DEV_RESISTANCE::dc_advance()
+{
+ ELEMENT::dc_advance();
+
+ if(using_tr_eval()){
+ }else{
+ assert(_m0.c0 == 0.);
+ if(value() == 0.) {
+ _y[0].f1 = OPT::shortckt;
+ }else if(std::abs(value())<OPT::shortckt){
+ _y[0].f1 = OPT::shortckt;
+ }else {
+ _y[0].f1 = value();
+ }
+ if(_y[0].f1 != _y1.f1) {
+ store_values();
+ q_load();
+ _m0.c1 = 1./_y[0].f1;
+ assert(_m0.c0 == 0.);
+ // set_constant(false); not needed. nothing to do in do_tr.
+ }else{
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
void DEV_RESISTANCE::tr_begin()
{
ELEMENT::tr_begin();
- _y1.f1 = _y[0].f1 = (value() != 0.) ? value() : OPT::shortckt;
- _m0.x = _y[0].x;
+ if(value() == 0.){
+ _y[0].f1 = OPT::shortckt;
+ }else if(std::abs(value()) < OPT::shortckt) {
+ _y[0].f1 = OPT::shortckt;
+ }else {
+ _y[0].f1 = value();
+ }
+ _y1.f1 = _y[0].f1;
+ _m0.x = _y[0].x;
_m0.c1 = 1./_y[0].f1;
_m0.c0 = 0.;
_m1 = _m0;
assert(_loss0 == 0.);
assert(_loss1 == 0.);
- if (value() == 0. && !has_common()) {
+ if(has_common()) {
+ }else if (std::abs(value()) <= OPT::shortckt) {
error(bPICKY, long_label() + ": short circuit\n");
}else{
}
}
/*--------------------------------------------------------------------------*/
+void DEV_RESISTANCE::tr_restore()
+{
+ ELEMENT::tr_restore();
+
+ // is this needed in ELEMENT?
+ if (_time[0] > _sim->_time0) {untested();
+ }else if (_time[0] != _sim->_time0) {untested();
+ }else if (_y[0].f0 != LINEAR){
+ }else if (using_tr_eval()) {
+ trace3("tr_restore invent history", long_label(), _y[0].f0, _y[1].f1);
+ _m0.x = tr_involts_limited();
+ _y[0].x = tr_input_limited();
+ tr_eval();
+ store_values();
+ for (int i=1 ; i<OPT::_keep_time_steps; ++i) {
+ _time[i] = 0;
+ _y[i] = _y[0];
+ }
+ }else{
+ }
+}
+/*--------------------------------------------------------------------------*/
bool DEV_RESISTANCE::do_tr()
{
if (using_tr_eval()) {
@@ -99,16 +156,30 @@ bool DEV_RESISTANCE::do_tr()
_y[0].x = tr_input_limited();;
tr_eval();
assert(_y[0].f0 != LINEAR);
- if (_y[0].f1 == 0.) {
+ if (_y[0].f1 >= OPT::shortckt) {
+ }else if (_y[0].f1 <= - OPT::shortckt) { untested();
+ }else if (_y[0].f1 >= 0) {
error(bPICKY, long_label() + ": short circuit\n");
_y[0].f1 = OPT::shortckt;
+ if (0. <= _y[0].f0 && _y[0].f0 <= _y[0].x * _y[0].f1) {
+ _y[0].f0 = _y[0].x * _y[0].f1;
+ }else{
+ }
+ set_converged(conv_check());
+ }else{ untested();
+ error(bPICKY, long_label() + ": short circuit\n");
+ _y[0].f1 = - OPT::shortckt;
+ if( 0. >= _y[0].f0 && _y[0].f0 >= _y[0].x * _y[0].f1 ) { untested();
+ _y[0].f0 = _y[0].x * _y[0].f1;
+ }else{ untested();
+ }
set_converged(conv_check());
- }else{
}
store_values();
q_load();
_m0.c1 = 1./_y[0].f1;
_m0.c0 = _y[0].x - _y[0].f0 / _y[0].f1;
+ trace4("DEV_RESISTANCE::dtr", long_label(), _sim->_time0, _y[0].f0, _y[0].f1);
}else{
assert(_y[0].f0 == LINEAR);
assert(_y[0].f1 == value() || _y[0].f1 == OPT::shortckt);
@@ -120,11 +191,18 @@ bool DEV_RESISTANCE::do_tr()
return converged();
}
/*--------------------------------------------------------------------------*/
+void DEV_RESISTANCE::ac_begin()
+{
+ ELEMENT::ac_begin();
+ _ev = _y[0].f1;
+ _acg = 1. / _ev;
+}
+/*--------------------------------------------------------------------------*/
void DEV_RESISTANCE::do_ac()
{
if (using_ac_eval()) {
ac_eval();
- if (_ev == 0.) {
+ if (std::abs(_ev) <= OPT::shortckt) {
error(bPICKY, long_label() + ": short circuit\n");
_ev = OPT::shortckt;
}else{
diff --git a/apps/d_switch.cc b/apps/d_switch.cc
index 249b0deb..36003790 100644
--- a/apps/d_switch.cc
+++ b/apps/d_switch.cc
@@ -43,15 +43,15 @@ private:
public:
explicit COMMON_SWITCH(int c=0)
:COMMON_COMPONENT(c), _ic(_UNKNOWN) {}
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new COMMON_SWITCH(*this);}
- std::string name()const {untested(); return "switch";}
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override{return new COMMON_SWITCH(*this);}
+ std::string name()const override {untested(); return "switch";}
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (1 + COMMON_COMPONENT::param_count());}
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (1 + COMMON_COMPONENT::param_count());}
public:
state_t _ic; /* initial state, belongs in common */
//BUG// no way to set _ic
@@ -59,37 +59,37 @@ public:
/*--------------------------------------------------------------------------*/
class SWITCH_BASE : public ELEMENT {
protected:
- explicit SWITCH_BASE();
+ explicit SWITCH_BASE(COMMON_COMPONENT* c=NULL);
explicit SWITCH_BASE(const SWITCH_BASE& p);
protected: // override virtual
- std::string value_name()const {return "";}
- std::string dev_type()const {assert(common()); return common()->modelname().c_str();}
- bool print_type_in_spice()const {return true;}
- int tail_size()const {return 1;}
- int max_nodes()const = 0;
- int min_nodes()const = 0;
- int matrix_nodes()const {return 2;}
- int net_nodes()const = 0;
- CARD* clone()const = 0;
- void expand();
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_passive();}
- void tr_begin();
- void dc_advance();
- void tr_advance();
- void tr_regress();
- bool tr_needs_eval()const {return _sim->analysis_is_static();} // also q by tr_advance
- bool do_tr();
- void tr_load() {tr_load_passive();}
- TIME_PAIR tr_review();
- void tr_unload() {untested(); tr_unload_passive();}
- double tr_involts()const {untested(); return tr_outvolts();}
- double tr_involts_limited()const {unreachable(); return tr_outvolts_limited();}
- void ac_iwant_matrix() {ac_iwant_matrix_passive();}
- void ac_begin() {_ev = _y[0].f1; _acg = _m0.c1;}
- void do_ac();
- void ac_load() {ac_load_passive();}
- COMPLEX ac_involts()const {untested(); return ac_outvolts();}
+ std::string value_name()const override {return "";}
+ std::string dev_type()const override {assert(common()); return common()->modelname().c_str();}
+ bool print_type_in_spice()const override {return true;}
+ int tail_size()const override {return 1;}
+ int max_nodes()const override = 0;
+ int min_nodes()const override = 0;
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override = 0;
+ CARD* clone()const override = 0;
+ void expand()override;
+ void precalc_last()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_passive();}
+ void tr_begin()override;
+ void dc_advance()override;
+ void tr_advance()override;
+ void tr_regress()override;
+ bool tr_needs_eval()const override {return _sim->analysis_is_static();} // also q by tr_advance
+ bool do_tr()override;
+ void tr_load()override {tr_load_passive();}
+ TIME_PAIR tr_review()override;
+ void tr_unload()override {untested(); tr_unload_passive();}
+ double tr_involts()const override {itested(); return tr_outvolts();}
+ double tr_involts_limited()const override {unreachable(); return tr_outvolts_limited();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_passive();}
+ void ac_begin()override {_ev = _y[0].f1; _acg = _m0.c1;}
+ void do_ac()override;
+ void ac_load()override {ac_load_passive();}
+ COMPLEX ac_involts()const override {untested(); return ac_outvolts();}
protected:
const ELEMENT* _input;
private:
@@ -101,15 +101,15 @@ class DEV_VSWITCH : public SWITCH_BASE {
private:
explicit DEV_VSWITCH(const DEV_VSWITCH& p) :SWITCH_BASE(p) {}
public:
- explicit DEV_VSWITCH() :SWITCH_BASE() {}
+ explicit DEV_VSWITCH(COMMON_COMPONENT* c=NULL) :SWITCH_BASE(c) {}
private: // override virtual
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- CARD* clone()const {return new DEV_VSWITCH(*this);}
- char id_letter()const {return 'S';}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ CARD* clone()const override {return new DEV_VSWITCH(*this);}
+ char id_letter()const override {return 'S';}
- std::string port_name(int i)const {itested();
+ std::string port_name(int i)const override {itested();
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"p", "n", "ps", "ns"};
@@ -122,29 +122,29 @@ private:
explicit DEV_CSWITCH(const DEV_CSWITCH& p)
:SWITCH_BASE(p), _input_label(p._input_label) {}
public:
- explicit DEV_CSWITCH() :SWITCH_BASE(), _input_label() {}
+ explicit DEV_CSWITCH(COMMON_COMPONENT* c=NULL) :SWITCH_BASE(c), _input_label() {}
private: // override virtual
- int max_nodes()const {return 3;}
- int ext_nodes()const {return 2;}
- int min_nodes()const {return 3;}
- int net_nodes()const {return 2;}
- int num_current_ports()const {return 1;}
- const std::string current_port_value(int)const {return _input_label;};
- CARD* clone()const {return new DEV_CSWITCH(*this);}
- void expand();
- char id_letter()const {return 'W';}
- void set_port_by_name(std::string& Name, std::string& Value)
- {untested(); SWITCH_BASE::set_port_by_name(Name,Value);}
- void set_port_by_index(int, std::string&);
- bool node_is_connected(int)const;
+ int max_nodes()const override {return 3;}
+ int ext_nodes()const override {return 2;}
+ int min_nodes()const override {return 3;}
+ int net_nodes()const override {return 2;}
+ int num_current_ports()const override {return 1;}
+ const std::string current_port_value(int)const override {return _input_label;};
+ CARD* clone()const override {return new DEV_CSWITCH(*this);}
+ void expand()override;
+ char id_letter()const override {return 'W';}
+ int set_port_by_name(std::string& Name, std::string& Value)override
+ {untested(); return SWITCH_BASE::set_port_by_name(Name,Value);}
+ void set_port_by_index(int, std::string&)override;
+ bool node_is_connected(int)const override;
- std::string port_name(int i)const {itested();
+ std::string port_name(int i)const override {itested();
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
return names[i];
}
- std::string current_port_name(int i)const {
+ std::string current_port_name(int i)const override {
assert(i >= 0);
assert(i < 1);
static std::string names[] = {"in"};
@@ -160,16 +160,16 @@ private:
public:
explicit MODEL_SWITCH(const SWITCH_BASE*);
private: // override virtual
- void set_dev_type(const std::string& nt);
- std::string dev_type()const;
- CARD* clone()const {return new MODEL_SWITCH(*this);}
- void precalc_first();
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (6 + MODEL_CARD::param_count());}
+ void set_dev_type(const std::string& nt)override;
+ std::string dev_type()const override;
+ CARD* clone()const override {return new MODEL_SWITCH(*this);}
+ void precalc_first()override;
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (6 + MODEL_CARD::param_count());}
public:
PARAMETER<double> vt; /* threshold voltage */
PARAMETER<double> vh; /* hysteresis voltage */
@@ -186,7 +186,6 @@ private:
static double const _default_roff;
};
/*--------------------------------------------------------------------------*/
-static COMMON_SWITCH Default_SWITCH(CC_STATIC);
double const MODEL_SWITCH::_default_vt = 0.;
double const MODEL_SWITCH::_default_vh = 0.;
double const MODEL_SWITCH::_default_ron = 1.;
@@ -377,11 +376,10 @@ std::string MODEL_SWITCH::param_value(int i)const
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-SWITCH_BASE::SWITCH_BASE()
- :ELEMENT(),
+SWITCH_BASE::SWITCH_BASE(COMMON_COMPONENT* c)
+ :ELEMENT(c),
_input(NULL)
{
- attach_common(&Default_SWITCH);
std::fill_n(_in, int(OPT::_keep_time_steps), 0.);
std::fill_n(_state, int(OPT::_keep_time_steps), _UNKNOWN);
}
@@ -632,8 +630,9 @@ bool DEV_CSWITCH::node_is_connected(int i)const
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-DEV_VSWITCH p2;
-DEV_CSWITCH p3;
+COMMON_SWITCH Default_SWITCH(CC_STATIC);
+DEV_VSWITCH p2(&Default_SWITCH);
+DEV_CSWITCH p3(&Default_SWITCH);
DISPATCHER<CARD>::INSTALL
d2(&device_dispatcher, "S|vswitch", &p2),
d3(&device_dispatcher, "W|cswitch|iswitch", &p3);
diff --git a/apps/d_trln.cc b/apps/d_trln.cc
index b7de414d..561a7f18 100644
--- a/apps/d_trln.cc
+++ b/apps/d_trln.cc
@@ -50,18 +50,18 @@ private:
explicit COMMON_TRANSLINE(const COMMON_TRANSLINE& p);
public:
explicit COMMON_TRANSLINE(int c=0);
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new COMMON_TRANSLINE(*this);}
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new COMMON_TRANSLINE(*this);}
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (9 + COMMON_COMPONENT::param_count());}
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (9 + COMMON_COMPONENT::param_count());}
public:
- void precalc_last(const CARD_LIST*);
- std::string name()const {untested(); return "transline";}
+ void precalc_last(const CARD_LIST*)override;
+ std::string name()const override {untested(); return "transline";}
};
/*--------------------------------------------------------------------------*/
class DEV_TRANSLINE : public ELEMENT {
@@ -78,36 +78,36 @@ private:
explicit DEV_TRANSLINE(const DEV_TRANSLINE& p)
:ELEMENT(p), _forward(), _reflect(), _if0(0), _ir0(0), _if1(0), _ir1(0) {}
public:
- explicit DEV_TRANSLINE();
+ explicit DEV_TRANSLINE(COMMON_COMPONENT* c=NULL);
private: // override virtual
- char id_letter()const {return 'T';}
- std::string value_name()const {return "#";}
- std::string dev_type()const {itested(); return "tline";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- CARD* clone()const {return new DEV_TRANSLINE(*this);}
- void precalc_last();
- void tr_iwant_matrix();
- void tr_begin();
- void dc_advance();
- void tr_advance();
- void tr_regress();
- bool tr_needs_eval()const;
- bool do_tr();
- void tr_load();
- TIME_PAIR tr_review();
- void tr_accept();
- void tr_unload();
- double tr_involts()const;
- double tr_involts_limited()const;
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void do_ac();
- void ac_load();
- COMPLEX ac_involts()const;
+ char id_letter()const override {return 'T';}
+ std::string value_name()const override {return "#";}
+ std::string dev_type()const override {itested(); return "tline";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ CARD* clone()const override {return new DEV_TRANSLINE(*this);}
+ void precalc_last()override;
+ void tr_iwant_matrix()override;
+ void tr_begin()override;
+ void dc_advance()override;
+ void tr_advance()override;
+ void tr_regress()override;
+ bool tr_needs_eval()const override;
+ bool do_tr()override;
+ void tr_load()override;
+ TIME_PAIR tr_review()override;
+ void tr_accept()override;
+ void tr_unload()override;
+ double tr_involts()const override;
+ double tr_involts_limited()const override;
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void do_ac()override;
+ void ac_load()override;
+ COMPLEX ac_involts()const override;
- std::string port_name(int i)const {itested();
+ std::string port_name(int i)const override {itested();
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"t1", "b1", "t2", "b2"};
@@ -150,7 +150,6 @@ const double _default_td (NOT_INPUT);
const double _default_f (NOT_INPUT);
const double _default_nl (0.25);
const double LINLENTOL = .000001;
-static COMMON_TRANSLINE Default_TRANSLINE(CC_STATIC);
/*--------------------------------------------------------------------------*/
COMMON_TRANSLINE::COMMON_TRANSLINE(int c)
:COMMON_COMPONENT(c),
@@ -365,13 +364,12 @@ void COMMON_TRANSLINE::precalc_last(const CARD_LIST* Scope)
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-DEV_TRANSLINE::DEV_TRANSLINE()
- :ELEMENT(),
+DEV_TRANSLINE::DEV_TRANSLINE(COMMON_COMPONENT* c)
+ :ELEMENT(c),
_forward(), _reflect(),
_if0(0), _ir0(0), _if1(0), _ir1(0),
_y11(), _y12()
{
- attach_common(&Default_TRANSLINE);
}
/*--------------------------------------------------------------------------*/
void DEV_TRANSLINE::precalc_last()
@@ -547,7 +545,8 @@ void DEV_TRANSLINE::ac_load()
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-DEV_TRANSLINE p1;
+COMMON_TRANSLINE Default_TRANSLINE(CC_STATIC);
+DEV_TRANSLINE p1(&Default_TRANSLINE);
DISPATCHER<CARD>::INSTALL d1(&device_dispatcher, "T|tline", &p1);
}
/*--------------------------------------------------------------------------*/
diff --git a/apps/d_vcg.cc b/apps/d_vcg.cc
index 0204d532..0af517a4 100644
--- a/apps/d_vcg.cc
+++ b/apps/d_vcg.cc
@@ -41,29 +41,29 @@ private:
public:
explicit DEV_VCG() :ELEMENT() {}
private: // override virtual
- char id_letter()const {untested();return '\0';}
- std::string value_name()const {untested(); return "g";}
- std::string dev_type()const {return "vcg";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_VCG(*this);}
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_shunt(); tr_load_active();}
- void tr_unload() {untested(); tr_unload_shunt(); tr_unload_active();}
- double tr_involts()const {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void ac_begin() {_ev = _y[0].f0; _acg = _m0.c1;}
- void do_ac();
- void ac_load() {ac_load_shunt(); ac_load_active();}
- COMPLEX ac_involts()const {return _n[IN1]->vac() - _n[IN2]->vac();}
+ char id_letter()const override {untested();return '\0';}
+ std::string value_name()const override {untested(); return "g";}
+ std::string dev_type()const override {return "vcg";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_VCG(*this);}
+ void tr_iwant_matrix()override {tr_iwant_matrix_extended();}
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_shunt(); tr_load_active();}
+ void tr_unload() override {untested(); tr_unload_shunt(); tr_unload_active();}
+ double tr_involts()const override {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
+ double tr_involts_limited()const override {return volts_limited(_n[IN1],_n[IN2]);}
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void ac_begin()override {_ev = _y[0].f0; _acg = _m0.c1;}
+ void do_ac()override;
+ void ac_load()override {ac_load_shunt(); ac_load_active();}
+ COMPLEX ac_involts()const override {return _n[IN1]->vac() - _n[IN2]->vac();}
- std::string port_name(int i)const {untested();
+ std::string port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"p", "n", "ps", "ns"};
diff --git a/apps/d_vcr.cc b/apps/d_vcr.cc
index 63a457f3..5a270213 100644
--- a/apps/d_vcr.cc
+++ b/apps/d_vcr.cc
@@ -36,32 +36,32 @@ private:
public:
explicit DEV_VCR() :ELEMENT() {}
private: // override virtual
- char id_letter()const {itested();return '\0';}
- std::string value_name()const {itested(); return "r";}
- std::string dev_type()const {return "vcr";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_VCR(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_shunt(); tr_load_active();}
- void tr_unload() {untested(); tr_unload_shunt(); tr_unload_active();}
- double tr_involts()const {untested(); return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- double tr_amps()const {untested(); return ELEMENT::tr_amps();}
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void ac_begin();
- void do_ac();
- void ac_load() {ac_load_shunt(); ac_load_active();}
- COMPLEX ac_involts()const {untested();return _n[IN1]->vac()-_n[IN2]->vac();}
- COMPLEX ac_amps()const {untested(); return ELEMENT::ac_amps();}
+ char id_letter()const override {itested();return '\0';}
+ std::string value_name()const override{itested(); return "r";}
+ std::string dev_type()const override {return "vcr";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_VCR(*this);}
+ void precalc_last()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_extended();}
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_shunt(); tr_load_active();}
+ void tr_unload()override {untested(); tr_unload_shunt(); tr_unload_active();}
+ double tr_involts()const override {untested(); return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
+ double tr_involts_limited()const override {return volts_limited(_n[IN1],_n[IN2]);}
+ double tr_amps()const override {untested(); return ELEMENT::tr_amps();}
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void ac_begin()override;
+ void do_ac()override;
+ void ac_load()override {ac_load_shunt(); ac_load_active();}
+ COMPLEX ac_involts()const override {untested();return _n[IN1]->vac()-_n[IN2]->vac();}
+ COMPLEX ac_amps()const override {untested(); return ELEMENT::ac_amps();}
- std::string port_name(int i)const {untested();
+ std::string port_name(int i)const override {untested();
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"p", "n", "ps", "ns"};
diff --git a/apps/d_vcvs.cc b/apps/d_vcvs.cc
index 282b79aa..1214a67e 100644
--- a/apps/d_vcvs.cc
+++ b/apps/d_vcvs.cc
@@ -34,30 +34,31 @@ private:
public:
explicit DEV_VCVS() :ELEMENT() {}
private: // override virtual
- char id_letter()const {return 'E';}
- std::string value_name()const {return "gain";}
- std::string dev_type()const {return "vcvs";}
- int max_nodes()const {return 4;}
- int min_nodes()const {return 4;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 4;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_VCVS(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_extended();}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_shunt(); tr_load_active();}
- void tr_unload() {untested();tr_unload_active();}
- double tr_involts()const {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- void ac_iwant_matrix() {ac_iwant_matrix_extended();}
- void ac_begin();
- void do_ac();
- void ac_load() {ac_load_shunt(); ac_load_active();}
- COMPLEX ac_involts()const {return _n[IN1]->vac() - _n[IN2]->vac();}
+ char id_letter()const override {return 'E';}
+ std::string value_name()const override{return "gain";}
+ std::string dev_type()const override {return "vcvs";}
+ int max_nodes()const override {return 4;}
+ int min_nodes()const override {return 4;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 4;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_VCVS(*this);}
+ void precalc_last()override;
+ void dc_advance()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_extended();}
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_shunt(); tr_load_active();}
+ void tr_unload()override {untested();tr_unload_active();}
+ double tr_involts()const override {return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
+ double tr_involts_limited()const override {return volts_limited(_n[IN1],_n[IN2]);}
+ void ac_iwant_matrix()override {ac_iwant_matrix_extended();}
+ void ac_begin()override;
+ void do_ac()override;
+ void ac_load()override {ac_load_shunt(); ac_load_active();}
+ COMPLEX ac_involts()const override {return _n[IN1]->vac() - _n[IN2]->vac();}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 4);
static std::string names[] = {"p", "n", "ps", "ns"};
@@ -69,10 +70,27 @@ private: // override virtual
void DEV_VCVS::precalc_last()
{
ELEMENT::precalc_last();
- set_constant(!has_tr_eval());
+ set_constant(!using_tr_eval());
set_converged(!has_tr_eval());
}
/*--------------------------------------------------------------------------*/
+void DEV_VCVS::dc_advance()
+{
+ ELEMENT::dc_advance();
+ if(using_tr_eval()){
+ }else{
+ _y[0].f1 = value();
+
+ if(_y1.f1 != _y[0].f1){ untested();
+ store_values();
+ q_load();
+ _m0.c0 = _y[0].f1;
+ // set_constant(false); not needed. nothing to do in do_tr.
+ }else{
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
void DEV_VCVS::tr_begin()
{
ELEMENT::tr_begin();
@@ -109,6 +127,7 @@ bool DEV_VCVS::do_tr()
/*--------------------------------------------------------------------------*/
void DEV_VCVS::ac_begin()
{
+ ELEMENT::ac_begin();
_loss1 = _loss0 = 1./OPT::shortckt;
_ev = _y[0].f1;
_acg = -_loss0 * _ev;
diff --git a/apps/d_vs.cc b/apps/d_vs.cc
index e663c973..99b96681 100644
--- a/apps/d_vs.cc
+++ b/apps/d_vs.cc
@@ -34,34 +34,35 @@ private:
public:
explicit DEV_VS() :ELEMENT() {}
private: // override virtual
- char id_letter()const {return 'V';}
- std::string value_name()const {return "dc";}
- std::string dev_type()const {return "vsource";}
- int max_nodes()const {return 2;}
- int min_nodes()const {return 2;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return 2;}
- bool is_source()const {return true;}
- bool f_is_value()const {return true;}
- bool has_iv_probe()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- CARD* clone()const {return new DEV_VS(*this);}
- void precalc_last();
- void tr_iwant_matrix() {tr_iwant_matrix_passive();}
- void tr_begin();
- bool do_tr();
- void tr_load() {tr_load_shunt(); tr_load_source();}
- void tr_unload() {untested();tr_unload_source();}
- double tr_involts()const {return 0.;}
- double tr_involts_limited()const {unreachable(); return 0.;}
- void ac_iwant_matrix() {ac_iwant_matrix_passive();}
- void ac_begin() {_loss1 = _loss0 = 1./OPT::shortckt; _acg = _ev = 0.;}
- void do_ac();
- void ac_load() {ac_load_shunt(); ac_load_source();}
- COMPLEX ac_involts()const {return 0.;}
- COMPLEX ac_amps()const {return (_acg + ac_outvolts()*_loss0);}
+ char id_letter()const override {return 'V';}
+ std::string value_name()const override{return "dc";}
+ std::string dev_type()const override {return "vsource";}
+ int max_nodes()const override {return 2;}
+ int min_nodes()const override {return 2;}
+ int matrix_nodes()const override {return 2;}
+ int net_nodes()const override {return 2;}
+ bool is_source()const override {return true;}
+ bool f_is_value()const override {return true;}
+ bool has_iv_probe()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ CARD* clone()const override {return new DEV_VS(*this);}
+ void precalc_last()override;
+ void dc_advance()override;
+ void tr_iwant_matrix()override {tr_iwant_matrix_passive();}
+ void tr_begin()override;
+ bool do_tr()override;
+ void tr_load()override {tr_load_shunt(); tr_load_source();}
+ void tr_unload()override {tr_unload_source();}
+ double tr_involts()const override {return 0.;}
+ double tr_involts_limited()const override{unreachable(); return 0.;}
+ void ac_iwant_matrix()override {ac_iwant_matrix_passive();}
+ void ac_begin()override {_loss1 = _loss0 = 1./OPT::shortckt; _acg = _ev = 0.;}
+ void do_ac()override;
+ void ac_load()override {ac_load_shunt(); ac_load_source();}
+ COMPLEX ac_involts()const override {return 0.;}
+ COMPLEX ac_amps()const override {return (_acg + ac_outvolts()*_loss0);}
- std::string port_name(int i)const {
+ std::string port_name(int i)const override {
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
@@ -72,11 +73,26 @@ private: // override virtual
/*--------------------------------------------------------------------------*/
void DEV_VS::precalc_last()
{
- //ELEMENT::precalc_last(); //BUG// skip
- COMPONENT::precalc_last();
- set_constant(!has_tr_eval());
+ ELEMENT::precalc_last();
+ set_constant(!using_tr_eval());
set_converged(!has_tr_eval());
- set_constant(false);
+}
+/*--------------------------------------------------------------------------*/
+void DEV_VS::dc_advance()
+{
+ ELEMENT::dc_advance();
+
+ if(using_tr_eval()){
+ }else{
+ _y[0].f1 = value();
+ if(_y[0].f1 != _y1.f1){
+ store_values();
+ q_load();
+ _m0.c0 = -_loss0 * _y[0].f1;
+ // set_constant(false); not needed. nothing to do in do_tr.
+ }else{
+ }
+ }
}
/*--------------------------------------------------------------------------*/
void DEV_VS::tr_begin()
@@ -89,7 +105,7 @@ void DEV_VS::tr_begin()
_m0.x = 0.;
_m0.c0 = -_loss0 * _y[0].f1;
_m0.c1 = 0.;
- _m1 = _m0;
+ _m1 = _m0;
if (!using_tr_eval()) {
if (_n[OUT2].m_() == 0) {
_sim->set_limit(value());
diff --git a/apps/func_core.cc b/apps/func_core.cc
index 64c38624..b2b0d530 100644
--- a/apps/func_core.cc
+++ b/apps/func_core.cc
@@ -28,8 +28,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class abs : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -40,8 +39,7 @@ DISPATCHER<FUNCTION>::INSTALL d_abs(&function_dispatcher, "abs", &p_abs);
/*--------------------------------------------------------------------------*/
class sqrt : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -50,10 +48,21 @@ public:
} p_sqrt;
DISPATCHER<FUNCTION>::INSTALL d_sqrt(&function_dispatcher, "sqrt", &p_sqrt);
/*--------------------------------------------------------------------------*/
+class ln : public FUNCTION {
+public:
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
+ PARAMETER<double> x;
+ Cmd >> x;
+ x.e_val(NOT_INPUT, Scope);
+ return to_string(std::log(x));
+ }
+} p_ln;
+DISPATCHER<FUNCTION>::INSTALL d_ln(&function_dispatcher, "ln", &p_ln);
+/*--------------------------------------------------------------------------*/
class log : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
+ error(bDEBUG, "log("+Cmd.fullstring() + "): Ambiguous. Use 'ln', or 'log10'\n");
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -62,10 +71,20 @@ public:
} p_log;
DISPATCHER<FUNCTION>::INSTALL d_log(&function_dispatcher, "log", &p_log);
/*--------------------------------------------------------------------------*/
+class log10 : public FUNCTION {
+public:
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
+ PARAMETER<double> x;
+ Cmd >> x;
+ x.e_val(NOT_INPUT, Scope);
+ return to_string(std::log10(x));
+ }
+} p_log10;
+DISPATCHER<FUNCTION>::INSTALL d_log10(&function_dispatcher, "log10", &p_log10);
+/*--------------------------------------------------------------------------*/
class exp : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -76,8 +95,7 @@ DISPATCHER<FUNCTION>::INSTALL d_exp(&function_dispatcher, "exp", &p_exp);
/*--------------------------------------------------------------------------*/
class INT : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -88,8 +106,7 @@ DISPATCHER<FUNCTION>::INSTALL d_int(&function_dispatcher, "int", &p_int);
/*--------------------------------------------------------------------------*/
class pow : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x, y;
Cmd >> x >> y;
x.e_val(NOT_INPUT, Scope);
@@ -101,8 +118,7 @@ DISPATCHER<FUNCTION>::INSTALL d_pow(&function_dispatcher, "pow", &p_pow);
/*--------------------------------------------------------------------------*/
class MAX : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x, y;
Cmd >> x >> y;
x.e_val(NOT_INPUT, Scope);
@@ -114,9 +130,9 @@ DISPATCHER<FUNCTION>::INSTALL d_max(&function_dispatcher, "max", &p_max);
/*--------------------------------------------------------------------------*/
class MIN : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x, y;
+ trace1("min", Cmd.fullstring());
Cmd >> x >> y;
x.e_val(NOT_INPUT, Scope);
y.e_val(NOT_INPUT, Scope);
@@ -127,8 +143,7 @@ DISPATCHER<FUNCTION>::INSTALL d_min(&function_dispatcher, "min", &p_min);
/*--------------------------------------------------------------------------*/
class IF : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x, y, z;
Cmd >> x >> y >> z;
x.e_val(NOT_INPUT, Scope);
@@ -141,8 +156,7 @@ DISPATCHER<FUNCTION>::INSTALL d_if(&function_dispatcher, "if", &p_if);
/*--------------------------------------------------------------------------*/
class sin : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -153,8 +167,7 @@ DISPATCHER<FUNCTION>::INSTALL d_sin(&function_dispatcher, "sin", &p_sin);
/*--------------------------------------------------------------------------*/
class sinh : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -165,8 +178,7 @@ DISPATCHER<FUNCTION>::INSTALL d_sinh(&function_dispatcher, "sinh", &p_sinh);
/*--------------------------------------------------------------------------*/
class cos : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -177,8 +189,7 @@ DISPATCHER<FUNCTION>::INSTALL d_cos(&function_dispatcher, "cos", &p_cos);
/*--------------------------------------------------------------------------*/
class cosh : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -189,8 +200,7 @@ DISPATCHER<FUNCTION>::INSTALL d_cosh(&function_dispatcher, "cosh", &p_cosh);
/*--------------------------------------------------------------------------*/
class tan : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -201,8 +211,7 @@ DISPATCHER<FUNCTION>::INSTALL d_tan(&function_dispatcher, "tan", &p_tan);
/*--------------------------------------------------------------------------*/
class tanh : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> x;
Cmd >> x;
x.e_val(NOT_INPUT, Scope);
@@ -213,8 +222,7 @@ DISPATCHER<FUNCTION>::INSTALL d_tanh(&function_dispatcher, "tanh", &p_tanh);
/*--------------------------------------------------------------------------*/
class na : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> arg;
Cmd >> arg;
arg.e_val(NOT_INPUT, Scope);
@@ -238,8 +246,7 @@ DISPATCHER<FUNCTION>::INSTALL d_na(&function_dispatcher, "na", &p_na);
/*--------------------------------------------------------------------------*/
class RANDOM_STUB : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> arg;
Cmd >> arg;
arg.e_val(NOT_INPUT, Scope);
diff --git a/apps/lang_spectre.cc b/apps/lang_spectre.cc
index f5f2aaf5..eb9f10c2 100644
--- a/apps/lang_spectre.cc
+++ b/apps/lang_spectre.cc
@@ -35,30 +35,30 @@ class LANG_SPECTRE : public LANGUAGE {
public:
LANG_SPECTRE() {}
~LANG_SPECTRE() {}
- std::string name()const {return "spectre";}
- bool case_insensitive()const {return false;}
- UNITS units()const {return uSI;}
+ std::string name()const override {return "spectre";}
+ bool case_insensitive()const override {return false;}
+ UNITS units()const override {return uSI;}
public: // override virtual, used by callback
- std::string arg_front()const {unreachable();return " ";}
- std::string arg_mid()const {unreachable();return "=";}
- std::string arg_back()const {unreachable();return "";}
+ std::string arg_front()const override {unreachable();return " ";}
+ std::string arg_mid()const override {unreachable();return "=";}
+ std::string arg_back()const override {unreachable();return "";}
public: // override virtual, called by commands
- void parse_top_item(CS&, CARD_LIST*);
- DEV_COMMENT* parse_comment(CS&, DEV_COMMENT*);
- DEV_DOT* parse_command(CS&, DEV_DOT*);
- MODEL_CARD* parse_paramset(CS&, MODEL_CARD*);
- BASE_SUBCKT* parse_module(CS&, BASE_SUBCKT*);
- COMPONENT* parse_instance(CS&, COMPONENT*);
- std::string find_type_in_string(CS&);
+ void parse_top_item(CS&, CARD_LIST*)override;
+ DEV_COMMENT* parse_comment(CS&, DEV_COMMENT*)override;
+ DEV_DOT* parse_command(CS&, DEV_DOT*)override;
+ MODEL_CARD* parse_paramset(CS&, MODEL_CARD*)override;
+ BASE_SUBCKT* parse_module(CS&, BASE_SUBCKT*)override;
+ COMPONENT* parse_instance(CS&, COMPONENT*)override;
+ std::string find_type_in_string(CS&)override;
private: // override virtual, called by print_item
- void print_paramset(OMSTREAM&, const MODEL_CARD*);
- void print_module(OMSTREAM&, const BASE_SUBCKT*);
- void print_instance(OMSTREAM&, const COMPONENT*);
- void print_comment(OMSTREAM&, const DEV_COMMENT*);
- void print_command(OMSTREAM& o, const DEV_DOT* c);
+ void print_paramset(OMSTREAM&, const MODEL_CARD*)override;
+ void print_module(OMSTREAM&, const BASE_SUBCKT*)override;
+ void print_instance(OMSTREAM&, const COMPONENT*)override;
+ void print_comment(OMSTREAM&, const DEV_COMMENT*)override;
+ void print_command(OMSTREAM& o, const DEV_DOT* c)override;
private: // local
void print_args(OMSTREAM&, const CARD*);
} lang_spectre;
@@ -408,8 +408,7 @@ void LANG_SPECTRE::print_command(OMSTREAM& o, const DEV_DOT* x)
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class CMD_MODEL : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
// already got "model"
std::string my_name, base_name;
cmd >> my_name;
@@ -437,8 +436,7 @@ class CMD_MODEL : public CMD {
DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "model", &p1);
/*--------------------------------------------------------------------------*/
class CMD_SUBCKT : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
BASE_SUBCKT* new_module = dynamic_cast<BASE_SUBCKT*>(device_dispatcher.clone("subckt"));
assert(new_module);
assert(!new_module->owner());
@@ -452,8 +450,7 @@ class CMD_SUBCKT : public CMD {
DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "subckt", &p2);
/*--------------------------------------------------------------------------*/
class CMD_SIMULATOR : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
command("options " + cmd.tail(), Scope);
}
} p3;
@@ -461,8 +458,7 @@ DISPATCHER<CMD>::INSTALL d3(&command_dispatcher, "simulator", &p3);
/*--------------------------------------------------------------------------*/
class CMD_SPECTRE : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {
+ void do_it(CS&, CARD_LIST* Scope)override {
command("options lang=spectre", Scope);
}
} p8;
diff --git a/apps/lang_spice.cc b/apps/lang_spice.cc
index 171a05c9..e7258662 100644
--- a/apps/lang_spice.cc
+++ b/apps/lang_spice.cc
@@ -28,7 +28,8 @@
#include "d_coment.h"
#include "e_subckt.h"
#include "u_lang.h"
-#include "d_logic.h"
+#include "e_model.h"
+#include "e_elemnt.h"
#include "bm.h"
/*--------------------------------------------------------------------------*/
namespace {
@@ -40,17 +41,17 @@ public:
enum EOB {NO_EXIT_ON_BLANK, EXIT_ON_BLANK};
public: // override virtual, used by callback
- std::string arg_front()const {return " ";}
- std::string arg_mid()const {return "=";}
- std::string arg_back()const {return "";}
+ std::string arg_front()const override {return " ";}
+ std::string arg_mid()const override {return "=";}
+ std::string arg_back()const override {return "";}
public: // override virtual, called by commands
- DEV_COMMENT* parse_comment(CS&, DEV_COMMENT*);
- DEV_DOT* parse_command(CS&, DEV_DOT*);
- MODEL_CARD* parse_paramset(CS&, MODEL_CARD*);
- BASE_SUBCKT* parse_module(CS&, BASE_SUBCKT*);
- COMPONENT* parse_instance(CS&, COMPONENT*);
- std::string find_type_in_string(CS&);
+ DEV_COMMENT* parse_comment(CS&, DEV_COMMENT*)override;
+ DEV_DOT* parse_command(CS&, DEV_DOT*)override;
+ MODEL_CARD* parse_paramset(CS&, MODEL_CARD*)override;
+ BASE_SUBCKT* parse_module(CS&, BASE_SUBCKT*)override;
+ COMPONENT* parse_instance(CS&, COMPONENT*)override;
+ std::string find_type_in_string(CS&)override;
public: // "local?", called by own commands
void parse_module_body(CS&, BASE_SUBCKT*, CARD_LIST*, const std::string&,
EOB, const std::string&);
@@ -61,14 +62,12 @@ private: // local
void parse_ports(CS&, COMPONENT*, int minnodes, int start, int num_nodes, bool all_new);
private: // compatibility hacks
void parse_element_using_obsolete_callback(CS&, COMPONENT*);
- void parse_logic_using_obsolete_callback(CS&, COMPONENT*);
-
private: // override virtual, called by print_item
- void print_paramset(OMSTREAM&, const MODEL_CARD*);
- void print_module(OMSTREAM&, const BASE_SUBCKT*);
- void print_instance(OMSTREAM&, const COMPONENT*);
- void print_comment(OMSTREAM&, const DEV_COMMENT*);
- void print_command(OMSTREAM&, const DEV_DOT*);
+ void print_paramset(OMSTREAM&, const MODEL_CARD*)override;
+ void print_module(OMSTREAM&, const BASE_SUBCKT*)override;
+ void print_instance(OMSTREAM&, const COMPONENT*)override;
+ void print_comment(OMSTREAM&, const DEV_COMMENT*)override;
+ void print_command(OMSTREAM&, const DEV_DOT*)override;
private: // local
void print_args(OMSTREAM&, const MODEL_CARD*);
void print_type(OMSTREAM&, const COMPONENT*);
@@ -81,10 +80,10 @@ class LANG_SPICE : public LANG_SPICE_BASE {
public:
LANG_SPICE() {}
~LANG_SPICE() {}
- std::string name()const {return "spice";}
- bool case_insensitive()const {return true;}
- UNITS units()const {return uSPICE;}
- void parse_top_item(CS&, CARD_LIST*);
+ std::string name()const override {return "spice";}
+ bool case_insensitive()const override {return true;}
+ UNITS units()const override {return uSPICE;}
+ void parse_top_item(CS&, CARD_LIST*)override;
} lang_spice;
DISPATCHER<LANGUAGE>::INSTALL
ds(&language_dispatcher, lang_spice.name(), &lang_spice);
@@ -93,9 +92,9 @@ class LANG_ACS : public LANG_SPICE_BASE {
public:
LANG_ACS() {}
~LANG_ACS() {}
- std::string name()const {return "acs";}
- bool case_insensitive()const {return true;}
- UNITS units()const {return uSPICE;}
+ std::string name()const override {return "acs";}
+ bool case_insensitive()const override {return true;}
+ UNITS units()const override {return uSPICE;}
} lang_acs;
DISPATCHER<LANGUAGE>::INSTALL
da(&language_dispatcher, lang_acs.name(), &lang_acs);
@@ -365,7 +364,7 @@ void LANG_SPICE_BASE::parse_element_using_obsolete_callback(CS& cmd, COMPONENT*
assert(dynamic_cast<EVAL_BM_VALUE*>(dc));
// If it is a simple value, don't use a common.
// Just store the value directly.
- x->obsolete_move_parameters_from_common(dc);
+ xx->obsolete_move_parameters_from_common(dc);
delete c;
}else{
x->attach_common(dc);
@@ -377,39 +376,6 @@ void LANG_SPICE_BASE::parse_element_using_obsolete_callback(CS& cmd, COMPONENT*
cmd.check(bDANGER, "what's this?");
}
/*--------------------------------------------------------------------------*/
-void LANG_SPICE_BASE::parse_logic_using_obsolete_callback(CS& cmd, COMPONENT* x)
-{
- assert(x);
- {
- size_t here = cmd.cursor();
- int num_nodes = count_ports(cmd, x->max_nodes(), x->min_nodes(), x->tail_size(), 0/*start*/);
- cmd.reset(here);
- parse_ports(cmd, x, x->min_nodes(), 0/*start*/, num_nodes, false);
- }
- int incount = x->net_nodes() - x->min_nodes() + 1;
- assert(incount > 0);
-
- std::string modelname = cmd.ctos(TOKENTERM);
-
- COMMON_LOGIC* common = 0;
- if (cmd.umatch("and " )) {untested();common = new LOGIC_AND;}
- else if (cmd.umatch("nand ")) {common = new LOGIC_NAND;}
- else if (cmd.umatch("or " )) {untested();common = new LOGIC_OR;}
- else if (cmd.umatch("nor " )) {common = new LOGIC_NOR;}
- else if (cmd.umatch("xor " )) {untested();common = new LOGIC_XOR;}
- else if (cmd.umatch("xnor ")) {untested();common = new LOGIC_XNOR;}
- else if (cmd.umatch("inv " )) {common = new LOGIC_INV;}
- else {untested();
- cmd.warn(bWARNING,"need and,nand,or,nor,xor,xnor,inv");
- common=new LOGIC_NONE;
- }
-
- assert(common);
- common->incount = incount;
- common->set_modelname(modelname);
- x->attach_common(common);
-}
-/*--------------------------------------------------------------------------*/
void LANG_SPICE_BASE::parse_type(CS& cmd, CARD* x)
{
assert(x);
@@ -609,8 +575,6 @@ COMPONENT* LANG_SPICE_BASE::parse_instance(CS& cmd, COMPONENT* x)
if (x->use_obsolete_callback_parse()) {
parse_element_using_obsolete_callback(cmd, x);
- }else if (DEV_LOGIC* xx = dynamic_cast<DEV_LOGIC*>(x)) {
- parse_logic_using_obsolete_callback(cmd, xx);
}else{
{
size_t here = cmd.cursor();
@@ -620,6 +584,10 @@ COMPONENT* LANG_SPICE_BASE::parse_instance(CS& cmd, COMPONENT* x)
}
if (x->print_type_in_spice()) {
parse_type(cmd, x);
+ if (x->tail_size() == 2) {
+ cmd.skiparg(); // hack for logic device syntax
+ }else{ // eat it for syntax, already got it
+ }
}else{
}
parse_args(cmd, x);
@@ -657,13 +625,20 @@ std::string LANG_SPICE_BASE::find_type_in_string(CS& cmd)
break;
case 'G':
here = cmd.cursor();
-
if (cmd.scan("vccap |vcg |vcr |vccs ")) {
s = cmd.trimmed_last_match();
}else{
s = "G";
}
break;
+ case 'U':
+ here = cmd.cursor();
+ if (cmd.scan("and |nand |or |nor |xor |xnor |inv ")) {
+ s = cmd.trimmed_last_match();
+ }else{untested();
+ s = "U";
+ }
+ break;
default:
s = id_letter;
break;
@@ -744,7 +719,7 @@ void LANG_SPICE_BASE::print_comment(OMSTREAM& o, const DEV_COMMENT* x)
}
/*--------------------------------------------------------------------------*/
void LANG_SPICE_BASE::print_command(OMSTREAM& o, const DEV_DOT* x)
-{untested();
+{itested();
assert(x);
o << x->s() << '\n';
}
@@ -770,8 +745,13 @@ void LANG_SPICE_BASE::print_type(OMSTREAM& o, const COMPONENT* x)
{
assert(x);
if (x->print_type_in_spice()) {
- o << " " << x->dev_type();
- }else if (fix_case(x->short_label()[0]) != fix_case(x->id_letter())) {untested();
+ if (x->tail_size() == 2) { // hack for logic device syntax
+ assert(x->common());
+ o << " " << x->common()->modelname() << " " << x->dev_type();
+ }else{
+ o << " " << x->dev_type();
+ }
+ }else if (fix_case(x->short_label()[0]) != fix_case(x->id_letter())) {
o << " " << x->dev_type();
}else{
// don't print type
@@ -824,8 +804,7 @@ void LANG_SPICE_BASE::print_ports(OMSTREAM& o, const COMPONENT* x)
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class CMD_MODEL : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
// already got "model"
std::string my_name, base_name;
cmd >> my_name;
@@ -869,8 +848,7 @@ class CMD_MODEL : public CMD {
DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, ".model", &p1);
/*--------------------------------------------------------------------------*/
class CMD_SUBCKT : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
BASE_SUBCKT* new_module = dynamic_cast<BASE_SUBCKT*>(device_dispatcher.clone("subckt"));
assert(new_module);
assert(!new_module->owner());
@@ -948,8 +926,7 @@ static void getmerge(CS& cmd, Skip_Header skip_header, CARD_LIST* Scope)
*/
class CMD_LIB : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
size_t here = cmd.cursor();
std::string section_name, more_stuff;
cmd >> section_name >> more_stuff;
@@ -975,8 +952,7 @@ DISPATCHER<CMD>::INSTALL d33(&command_dispatcher, ".lib|lib", &p33);
*/
class CMD_INCLUDE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {untested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {untested();
getmerge(cmd, NO_HEADER, Scope);
}
} p3;
@@ -987,8 +963,7 @@ DISPATCHER<CMD>::INSTALL d3(&command_dispatcher, ".include", &p3);
*/
class CMD_MERGE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {untested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {untested();
SET_RUN_MODE xx(rPRESET);
getmerge(cmd, NO_HEADER, Scope);
}
@@ -1002,8 +977,7 @@ DISPATCHER<CMD>::INSTALL d4(&command_dispatcher, ".merge|merge", &p4);
*/
class CMD_RUN : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
while (cmd.match1('<')) {untested();
command("clear", Scope);
cmd.skip();
@@ -1021,8 +995,7 @@ DISPATCHER<CMD>::INSTALL d5(&command_dispatcher, "<", &p5);
*/
class CMD_GET : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
SET_RUN_MODE xx(rPRESET);
command("clear", Scope);
getmerge(cmd, SKIP_HEADER, Scope);
@@ -1040,8 +1013,7 @@ DISPATCHER<CMD>::INSTALL d6(&command_dispatcher, ".get|get", &p6);
*/
class CMD_BUILD : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {untested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {untested();
SET_RUN_MODE xx(rPRESET);
::status.get.reset().start();
lang_spice.parse_module_body(cmd, NULL, Scope, ">", lang_spice.EXIT_ON_BLANK, ". ");
@@ -1052,8 +1024,7 @@ DISPATCHER<CMD>::INSTALL d7(&command_dispatcher, ".build|build", &p7);
/*--------------------------------------------------------------------------*/
class CMD_SPICE : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {
+ void do_it(CS&, CARD_LIST* Scope)override {
command("options lang=spice", Scope);
}
} p8;
@@ -1061,8 +1032,7 @@ DISPATCHER<CMD>::INSTALL d8(&command_dispatcher, "spice", &p8);
/*--------------------------------------------------------------------------*/
class CMD_ACS : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {untested();
+ void do_it(CS&, CARD_LIST* Scope)override {itested();
command("options lang=acs", Scope);
}
} p9;
@@ -1070,8 +1040,7 @@ DISPATCHER<CMD>::INSTALL d9(&command_dispatcher, "acs", &p9);
/*--------------------------------------------------------------------------*/
class CMD_ENDC : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {untested();
+ void do_it(CS&, CARD_LIST* Scope)override {untested();
if (OPT::language == &lang_acs) {untested();
command("options lang=spice", Scope);
}else{untested();
@@ -1082,8 +1051,7 @@ DISPATCHER<CMD>::INSTALL d88(&command_dispatcher, ".endc", &p88);
/*--------------------------------------------------------------------------*/
class CMD_CONTROL : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {untested();
+ void do_it(CS&, CARD_LIST* Scope)override {untested();
if (OPT::language == &lang_spice) {untested();
command("options lang=acs", Scope);
}else{untested();
diff --git a/apps/lang_verilog.cc b/apps/lang_verilog.cc
index 14311a9f..cdf9c669 100644
--- a/apps/lang_verilog.cc
+++ b/apps/lang_verilog.cc
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
-//testing=script 2016.09.10
+//testing=script 2023.10.25
#include "u_nodemap.h"
#include "globals.h"
#include "c_comand.h"
@@ -38,61 +38,93 @@ class LANG_VERILOG : public LANGUAGE {
public:
LANG_VERILOG() : arg_count(INACTIVE) {}
~LANG_VERILOG() {}
- std::string name()const {return "verilog";}
- bool case_insensitive()const {return false;}
- UNITS units()const {return uSI;}
+ std::string name()const override {return "verilog";}
+ bool case_insensitive()const override {return false;}
+ UNITS units()const override {return uSI;}
public: // override virtual, used by callback
- std::string arg_front()const {untested();
+ std::string arg_front()const override {
switch (_mode) {
case mPARAMSET:untested(); return " ."; break;
- case mDEFAULT:untested(); return (arg_count++ > 0) ? ", ." : "."; break;
+ case mDEFAULT: return (arg_count++ > 0) ? ", ." : "."; break;
}
unreachable();
return "";
}
- std::string arg_mid()const {untested();
+ std::string arg_mid()const override {
switch (_mode) {
case mPARAMSET:untested(); return "="; break;
- case mDEFAULT:untested(); return "("; break;
+ case mDEFAULT: return "("; break;
}
unreachable();
return "";
}
- std::string arg_back()const {untested();
+ std::string arg_back()const override {
switch (_mode) {
case mPARAMSET:untested(); return ";"; break;
- case mDEFAULT:untested(); return ")"; break;
+ case mDEFAULT: return ")"; break;
}
unreachable();
return "";
}
public: // override virtual, called by commands
- void parse_top_item(CS&, CARD_LIST*);
- DEV_COMMENT* parse_comment(CS&, DEV_COMMENT*);
- DEV_DOT* parse_command(CS&, DEV_DOT*);
- MODEL_CARD* parse_paramset(CS&, MODEL_CARD*);
- BASE_SUBCKT* parse_module(CS&, BASE_SUBCKT*);
- COMPONENT* parse_instance(CS&, COMPONENT*);
- std::string find_type_in_string(CS&);
+ void parse_top_item(CS&, CARD_LIST*)override;
+ DEV_COMMENT* parse_comment(CS&, DEV_COMMENT*)override;
+ DEV_DOT* parse_command(CS&, DEV_DOT*)override;
+ MODEL_CARD* parse_paramset(CS&, MODEL_CARD*)override;
+ BASE_SUBCKT* parse_module(CS&, BASE_SUBCKT*)override;
+ COMPONENT* parse_instance(CS&, COMPONENT*)override;
+ std::string find_type_in_string(CS&)override;
+private: // local
+ void skip_attributes(CS& cmd);
+ void parse_attributes(CS& cmd, const void* x);
+ void parse_type(CS& cmd, CARD* x);
+ void parse_args_paramset(CS& cmd, MODEL_CARD* x);
+ void parse_args_instance(CS& cmd, CARD* x);
+ void parse_label(CS& cmd, CARD* x);
+ void parse_ports(CS& cmd, COMPONENT* x, bool all_new);
private: // override virtual, called by print_item
- void print_paramset(OMSTREAM&, const MODEL_CARD*);
- void print_module(OMSTREAM&, const BASE_SUBCKT*);
- void print_instance(OMSTREAM&, const COMPONENT*);
- void print_comment(OMSTREAM&, const DEV_COMMENT*);
- void print_command(OMSTREAM& o, const DEV_DOT* c);
+ void print_paramset(OMSTREAM&, const MODEL_CARD*)override;
+ void print_module(OMSTREAM&, const BASE_SUBCKT*)override;
+ void print_instance(OMSTREAM&, const COMPONENT*)override;
+ void print_comment(OMSTREAM&, const DEV_COMMENT*)override;
+ void print_command(OMSTREAM& o, const DEV_DOT*)override;
private: // local
+ void print_attributes(OMSTREAM&, const void*);
void print_args(OMSTREAM&, const MODEL_CARD*);
void print_args(OMSTREAM&, const COMPONENT*);
+ void print_type(OMSTREAM& o, const COMPONENT* x);
+ void print_label(OMSTREAM& o, const COMPONENT* x);
+ void print_ports_long(OMSTREAM& o, const COMPONENT* x);
+ void print_ports_short(OMSTREAM& o, const COMPONENT* x);
} lang_verilog;
DISPATCHER<LANGUAGE>::INSTALL
d(&language_dispatcher, lang_verilog.name(), &lang_verilog);
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-static void parse_type(CS& cmd, CARD* x)
+void LANG_VERILOG::skip_attributes(CS& cmd)
+{
+ while (cmd >> "(*") {
+ cmd.skipto1('*') && (cmd >> "*)");
+ }
+}
+/*--------------------------------------------------------------------------*/
+void LANG_VERILOG::parse_attributes(CS& cmd, const void* x)
+{
+ assert(x);
+ while (cmd >> "(*") {
+ std::string attrib_string;
+ while(cmd.ns_more() && !(cmd >> "*)")) {
+ attrib_string += cmd.ctoc();
+ }
+ attributes(x).add_to(attrib_string, x);
+ }
+}
+/*--------------------------------------------------------------------------*/
+void LANG_VERILOG::parse_type(CS& cmd, CARD* x)
{
assert(x);
std::string new_type;
@@ -100,51 +132,80 @@ static void parse_type(CS& cmd, CARD* x)
x->set_dev_type(new_type);
}
/*--------------------------------------------------------------------------*/
-static void parse_args_paramset(CS& cmd, MODEL_CARD* x)
+void LANG_VERILOG::parse_args_paramset(CS& cmd, MODEL_CARD* x)
{
assert(x);
while (cmd >> '.') {
size_t here = cmd.cursor();
- std::string name, value;
+ std::string Name, value;
try{
- cmd >> name >> '=' >> value >> ';';
- x->set_param_by_name(name, value);
+ cmd >> Name >> '=' >> value >> ';';
+ x->set_param_by_name(Name, value);
}catch (Exception_No_Match&) {untested();
- cmd.warn(bDANGER, here, x->long_label() + ": bad parameter " + name + " ignored");
+ cmd.warn(bDANGER, here, x->long_label() + ": bad parameter " + Name + " ignored");
}
}
}
/*--------------------------------------------------------------------------*/
-static void parse_args_instance(CS& cmd, CARD* x)
+void LANG_VERILOG::parse_args_instance(CS& cmd, CARD* x)
{
assert(x);
if (cmd >> "#(") {
+ size_t c_attrib = cmd.cursor();
+ skip_attributes(cmd);
+ size_t c_arg = cmd.cursor();
+
if (cmd.match1('.')) {
// by name
while (cmd >> '.') {
- size_t here = cmd.cursor();
- std::string name = cmd.ctos("(", "", "");
+ std::string Name = cmd.ctos("(", "", "");
std::string value = cmd.ctos(",)", "(", ")");
cmd >> ',';
try{
- x->set_param_by_name(name, value);
+ int Index = x->set_param_by_name(Name, value);
+
+ if (c_attrib != c_arg) {
+ // has attributes
+ size_t here = cmd.cursor();
+ cmd.reset(c_attrib);
+ parse_attributes(cmd, x->param_id_tag(Index));
+ assert(cmd.cursor() == c_arg);
+ cmd.reset(here);
+ }else{
+ // no attributes
+ }
}catch (Exception_No_Match&) {untested();
- cmd.warn(bDANGER, here, x->long_label() + ": bad parameter " + name + " ignored");
+ cmd.warn(bDANGER, c_arg, x->long_label() + ": bad parameter " + Name + " ignored");
}
+ c_attrib = cmd.cursor();
+ skip_attributes(cmd);
+ c_arg = cmd.cursor();
}
}else{
// by order
- int index = 1;
- while (cmd.is_alnum() || cmd.match1("+-.")) {
- size_t here = cmd.cursor();
+ for (int Index = x->param_count() - 1; cmd.is_alnum() || cmd.match1("+-."); --Index) {
try{
std::string value = cmd.ctos(",)", "", "");
- x->set_param_by_index(x->param_count() - index++, value, 0/*offset*/);
+ x->set_param_by_index(Index, value, 0/*offset*/);
+
+ if (c_attrib != c_arg) {
+ // has attributes
+ size_t here = cmd.cursor();
+ cmd.reset(c_attrib);
+ parse_attributes(cmd, x->param_id_tag(Index));
+ assert(cmd.cursor() == c_arg);
+ cmd.reset(here);
+ }else{
+ // no attributes
+ }
}catch (Exception_Too_Many& e) {untested();
- cmd.warn(bDANGER, here, e.message());
+ cmd.warn(bDANGER, c_arg, e.message());
}
+ c_attrib = cmd.cursor();
+ skip_attributes(cmd);
+ c_arg = cmd.cursor();
}
}
cmd >> ')';
@@ -153,7 +214,7 @@ static void parse_args_instance(CS& cmd, CARD* x)
}
}
/*--------------------------------------------------------------------------*/
-static void parse_label(CS& cmd, CARD* x)
+void LANG_VERILOG::parse_label(CS& cmd, CARD* x)
{
assert(x);
std::string my_name;
@@ -165,70 +226,112 @@ static void parse_label(CS& cmd, CARD* x)
}
}
/*--------------------------------------------------------------------------*/
-static void parse_ports(CS& cmd, COMPONENT* x, bool all_new)
+void LANG_VERILOG::parse_ports(CS& cmd, COMPONENT* x, bool all_new)
{
assert(x);
if (cmd >> '(') {
- if (cmd.is_alnum()) {
- // by order
- int index = 0;
- while (cmd.is_alnum()) {
- size_t here = cmd.cursor();
+ size_t c_attrib = cmd.cursor();
+ skip_attributes(cmd);
+ size_t c_arg = cmd.cursor();
+
+ if (cmd.match1('.')) {
+ // by name
+ while (cmd >> '.') {
try{
- std::string value;
- cmd >> value;
- x->set_port_by_index(index, value);
- if (all_new) {
- if (x->node_is_grounded(index)) {
- cmd.warn(bDANGER, here, "node 0 not allowed here");
- }else if (x->subckt() && x->subckt()->nodes()->how_many() != index+1) {
- cmd.warn(bDANGER, here, "duplicate port name, skipping");
- }else{
- ++index;
- }
+ std::string Name = cmd.ctos("(", "", "");
+ std::string value = cmd.ctos(",)", "(", ")");
+ cmd >> ',';
+ int Index = x->set_port_by_name(Name, value);
+
+ if (c_attrib != c_arg) {
+ // has attributes
+ size_t here = cmd.cursor();
+ cmd.reset(c_attrib);
+ parse_attributes(cmd, x->port_id_tag(Index));
+ assert(cmd.cursor() == c_arg);
+ cmd.reset(here);
}else{
- ++index;
+ // no attributes
}
- }catch (Exception_Too_Many& e) {
- cmd.warn(bDANGER, here, e.message());
+ }catch (Exception_No_Match&) {untested();
+ cmd.warn(bDANGER, c_arg, "mismatch, ignored");
}
+ c_attrib = cmd.cursor();
+ skip_attributes(cmd);
+ c_arg = cmd.cursor();
}
- if (index < x->min_nodes()) {
- cmd.warn(bDANGER, "need " + to_string(x->min_nodes()-index) +" more nodes, grounding");
- for (int iii = index; iii < x->min_nodes(); ++iii) {
- x->set_port_to_ground(iii);
+ for (int Index = 0; Index < x->min_nodes(); ++Index) {
+ //BUG// This may be a bad idea.
+ //BUG// It's definitely wrong with all_new.
+ //BUG// What should we do with unconnected ports?
+ if (!(x->node_is_connected(Index))) {untested();
+ cmd.warn(bDANGER, x->port_name(Index) + ": port unconnected, grounding");
+ x->set_port_to_ground(Index);
+ }else{
}
- }else{
}
}else{
- // by name
- while (cmd >> '.') {
- size_t here = cmd.cursor();
+ // by order
+ int Index;
+ for (Index = 0; cmd.is_alnum(); ++Index) {
try{
- std::string name, value;
- cmd >> name >> '(' >> value >> ')' >> ',';
- x->set_port_by_name(name, value);
- }catch (Exception_No_Match&) {untested();
- cmd.warn(bDANGER, here, "mismatch, ignored");
+ std::string value = cmd.ctos(",)", "", "");
+ x->set_port_by_index(Index, value);
+
+ if (c_attrib != c_arg) {
+ // has attributes
+ size_t here = cmd.cursor();
+ cmd.reset(c_attrib);
+ parse_attributes(cmd, x->port_id_tag(Index));
+ assert(cmd.cursor() == c_arg);
+ cmd.reset(here);
+ }else{
+ // no attributes
+ }
+ if (all_new) {
+ if (x->node_is_grounded(Index)) {
+ cmd.warn(bDANGER, c_arg, "node 0 not allowed here");
+ --Index;
+ }else if (x->subckt() && x->subckt()->nodes()->how_many() != Index+1) {
+ cmd.warn(bDANGER, c_arg, "duplicate port name, skipping");
+ --Index;
+ }else{
+ }
+ }else{
+ }
+ }catch (Exception_Too_Many& e) {
+ cmd.warn(bDANGER, c_arg, e.message());
}
+ c_attrib = cmd.cursor();
+ skip_attributes(cmd);
+ c_arg = cmd.cursor();
}
- for (int iii = 0; iii < x->min_nodes(); ++iii) {
- if (!(x->node_is_connected(iii))) {untested();
- cmd.warn(bDANGER, x->port_name(iii) + ": port unconnected, grounding");
- x->set_port_to_ground(iii);
+ if (Index < x->min_nodes()) {
+ //BUG// This may be a bad idea.
+ //BUG// It's definitely wrong with all_new.
+ //BUG// What should we do with unconnected ports?
+ if (all_new) {untested();
}else{
}
+ cmd.warn(bDANGER, "need " + to_string(x->min_nodes()-Index) +" more nodes, grounding");
+ for ( ; Index < x->min_nodes(); ++Index) {
+ x->set_port_to_ground(Index);
+ }
+ }else{
}
}
cmd >> ')';
}else{
cmd.warn(bDANGER, "'(' required (parse ports) (grounding)");
- for (int iii = 0; iii < x->min_nodes(); ++iii) {
- if (!(x->node_is_connected(iii))) {
- cmd.warn(bDANGER, x->port_name(iii) + ": port unconnected, grounding");
- x->set_port_to_ground(iii);
- }else{
+ for (int Index = 0; Index < x->min_nodes(); ++Index) {
+ if (!(x->node_is_connected(Index))) {
+ if (all_new) {untested();
+ }else{
+ }
+ cmd.warn(bDANGER, x->port_name(Index) + ": port unconnected, grounding");
+ x->set_port_to_ground(Index);
+ }else{untested();
unreachable();
}
}
@@ -248,8 +351,8 @@ DEV_DOT* LANG_VERILOG::parse_command(CS& cmd, DEV_DOT* x)
assert(x);
x->set(cmd.fullstring());
CARD_LIST* scope = (x->owner()) ? x->owner()->subckt() : &CARD_LIST::card_list;
-
cmd.reset();
+ parse_attributes(cmd, x->id_tag());
CMD::cmdproc(cmd, scope);
delete x;
return NULL;
@@ -266,6 +369,7 @@ MODEL_CARD* LANG_VERILOG::parse_paramset(CS& cmd, MODEL_CARD* x)
{
assert(x);
cmd.reset();
+ parse_attributes(cmd, x->id_tag());
cmd >> "paramset ";
parse_label(cmd, x);
parse_type(cmd, x);
@@ -298,6 +402,7 @@ BASE_SUBCKT* LANG_VERILOG::parse_module(CS& cmd, BASE_SUBCKT* x)
// header
cmd.reset();
+ parse_attributes(cmd, x->id_tag());
(cmd >> "module |macromodule ");
parse_label(cmd, x);
parse_ports(cmd, x, true/*all new*/);
@@ -320,6 +425,7 @@ COMPONENT* LANG_VERILOG::parse_instance(CS& cmd, COMPONENT* x)
{
assert(x);
cmd.reset();
+ parse_attributes(cmd, x->id_tag());
parse_type(cmd, x);
parse_args_instance(cmd, x);
parse_label(cmd, x);
@@ -331,15 +437,16 @@ COMPONENT* LANG_VERILOG::parse_instance(CS& cmd, COMPONENT* x)
/*--------------------------------------------------------------------------*/
std::string LANG_VERILOG::find_type_in_string(CS& cmd)
{
+ skip_attributes(cmd);
size_t here = cmd.cursor();
std::string type;
if ((cmd >> "//")) {
- assert(here == 0);
+ //assert(here == 0);
type = "dev_comment";
}else{
cmd >> type;
}
- cmd.reset(here);
+ cmd.reset(here); // where the type is.
return type;
}
/*--------------------------------------------------------------------------*/
@@ -350,6 +457,15 @@ void LANG_VERILOG::parse_top_item(CS& cmd, CARD_LIST* Scope)
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
+void LANG_VERILOG::print_attributes(OMSTREAM& o, const void* x)
+{
+ assert(x);
+ if (attributes(x)) {
+ o << "(* " << attributes(x).string(NULL) << " *) ";
+ }else{
+ }
+}
+/*--------------------------------------------------------------------------*/
void LANG_VERILOG::print_args(OMSTREAM& o, const MODEL_CARD* x)
{
assert(x);
@@ -358,7 +474,7 @@ void LANG_VERILOG::print_args(OMSTREAM& o, const MODEL_CARD* x)
}else{
for (int ii = x->param_count() - 1; ii >= 0; --ii) {
if (x->param_is_printable(ii)) {
- std::string arg = " ." + x->param_name(ii) + "=" + x->param_value(ii) + ";";
+ std::string arg = " ." + x->param_name(ii) + '=' + x->param_value(ii) + ';';
o << arg;
}else{
}
@@ -375,11 +491,13 @@ void LANG_VERILOG::print_args(OMSTREAM& o, const COMPONENT* x)
x->print_args_obsolete_callback(o, this); //BUG//callback//
arg_count = INACTIVE;
}else{
- std::string sep = ".";
+ std::string sep = "";
for (int ii = x->param_count() - 1; ii >= 0; --ii) {
if (x->param_is_printable(ii)) {
- o << sep << x->param_name(ii) << "(" << x->param_value(ii) << ")";
- sep = ",.";
+ o << sep;
+ print_attributes(o, x->param_id_tag(ii));
+ o << '.' << x->param_name(ii) << '(' << x->param_value(ii) << ')';
+ sep = ',';
}else{
}
}
@@ -387,37 +505,41 @@ void LANG_VERILOG::print_args(OMSTREAM& o, const COMPONENT* x)
o << ") ";
}
/*--------------------------------------------------------------------------*/
-static void print_type(OMSTREAM& o, const COMPONENT* x)
+void LANG_VERILOG::print_type(OMSTREAM& o, const COMPONENT* x)
{
assert(x);
o << x->dev_type();
}
/*--------------------------------------------------------------------------*/
-static void print_label(OMSTREAM& o, const COMPONENT* x)
+void LANG_VERILOG::print_label(OMSTREAM& o, const COMPONENT* x)
{
assert(x);
o << x->short_label();
}
/*--------------------------------------------------------------------------*/
-static void print_ports_long(OMSTREAM& o, const COMPONENT* x)
+void LANG_VERILOG::print_ports_long(OMSTREAM& o, const COMPONENT* x)
{
// print in long form ... .name(value)
assert(x);
o << " (";
- std::string sep = ".";
+ std::string sep = "";
for (int ii = 0; x->port_exists(ii); ++ii) {
- o << sep << x->port_name(ii) << '(' << x->port_value(ii) << ')';
- sep = ",.";
+ o << sep;
+ print_attributes(o, x->port_id_tag(ii));
+ o << '.' << x->port_name(ii) << '(' << x->port_value(ii) << ')';
+ sep = ',';
}
for (int ii = 0; x->current_port_exists(ii); ++ii) {untested();
- o << sep << x->current_port_name(ii) << '(' << x->current_port_value(ii) << ')';
- sep = ",.";
+ o << sep;
+ //////print_attributes(o, x->param_id_tag(ii));
+ o << '.' << x->current_port_name(ii) << '(' << x->current_port_value(ii) << ')';
+ sep = ',';
}
- o << ")";
+ o << ')';
}
/*--------------------------------------------------------------------------*/
-static void print_ports_short(OMSTREAM& o, const COMPONENT* x)
+void LANG_VERILOG::print_ports_short(OMSTREAM& o, const COMPONENT* x)
{
// print in short form ... value only
assert(x);
@@ -425,12 +547,16 @@ static void print_ports_short(OMSTREAM& o, const COMPONENT* x)
o << " (";
std::string sep = "";
for (int ii = 0; x->port_exists(ii); ++ii) {
- o << sep << x->port_value(ii);
- sep = ",";
+ o << sep;
+ print_attributes(o, x->port_id_tag(ii));
+ o << x->port_value(ii);
+ sep = ',';
}
for (int ii = 0; x->current_port_exists(ii); ++ii) {untested();
- o << sep << x->current_port_value(ii);
- sep = ",";
+ o << sep;
+ //////print_attributes(o, tag-(ii+1+x->net_nodes()));
+ o << x->current_port_value(ii);
+ sep = ',';
}
o << ")";
}
@@ -440,10 +566,11 @@ void LANG_VERILOG::print_paramset(OMSTREAM& o, const MODEL_CARD* x)
{
assert(x);
_mode = mPARAMSET;
- o << "paramset " << x->short_label() << ' ' << x->dev_type() << ";\\\n";
+ print_attributes(o, x->id_tag());
+ o << "paramset " << x->short_label() << ' ' << x->dev_type() << ";\n";
print_args(o, x);
- o << "\\\n"
- "endparmset\n\n";
+ o << "\n"
+ "endparamset\n\n";
_mode = mDEFAULT;
}
/*--------------------------------------------------------------------------*/
@@ -452,12 +579,12 @@ void LANG_VERILOG::print_module(OMSTREAM& o, const BASE_SUBCKT* x)
assert(x);
assert(x->subckt());
+ print_attributes(o, x->id_tag());
o << "module " << x->short_label();
print_ports_short(o, x);
o << ";\n";
- for (CARD_LIST::const_iterator
- ci = x->subckt()->begin(); ci != x->subckt()->end(); ++ci) {
+ for (CARD_LIST::const_iterator ci = x->subckt()->begin(); ci != x->subckt()->end(); ++ci) {
print_item(o, *ci);
}
@@ -466,6 +593,7 @@ void LANG_VERILOG::print_module(OMSTREAM& o, const BASE_SUBCKT* x)
/*--------------------------------------------------------------------------*/
void LANG_VERILOG::print_instance(OMSTREAM& o, const COMPONENT* x)
{
+ print_attributes(o, x->id_tag());
print_type(o, x);
print_args(o, x);
print_label(o, x);
@@ -476,7 +604,7 @@ void LANG_VERILOG::print_instance(OMSTREAM& o, const COMPONENT* x)
void LANG_VERILOG::print_comment(OMSTREAM& o, const DEV_COMMENT* x)
{
assert(x);
- if ((x->comment().compare(0, 2, "//")) != 0) {untested();
+ if ((x->comment().compare(0, 2, "//")) != 0) {
o << "//";
}else{
}
@@ -492,8 +620,7 @@ void LANG_VERILOG::print_command(OMSTREAM& o, const DEV_DOT* x)
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class CMD_PARAMSET : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
// already got "paramset"
std::string my_name, base_name;
cmd >> my_name;
@@ -521,8 +648,7 @@ class CMD_PARAMSET : public CMD {
DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "paramset", &p1);
/*--------------------------------------------------------------------------*/
class CMD_MODULE : public CMD {
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
BASE_SUBCKT* new_module = dynamic_cast<BASE_SUBCKT*>(device_dispatcher.clone("subckt"));
assert(new_module);
assert(!new_module->owner());
@@ -537,8 +663,7 @@ DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "module|macromodule", &p2);
/*--------------------------------------------------------------------------*/
class CMD_VERILOG : public CMD {
public:
- void do_it(CS&, CARD_LIST* Scope)
- {
+ void do_it(CS&, CARD_LIST* Scope)override {
command("options lang=verilog", Scope);
}
} p8;
diff --git a/apps/measure_at.cc b/apps/measure_at.cc
index bacc60bc..d5a16ceb 100644
--- a/apps/measure_at.cc
+++ b/apps/measure_at.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
std::string probe_name;
PARAMETER<double> x;
bool derivative = false;
diff --git a/apps/measure_average.cc b/apps/measure_average.cc
index a3bec94f..0bf4be09 100644
--- a/apps/measure_average.cc
+++ b/apps/measure_average.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override{
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/measure_cross.cc b/apps/measure_cross.cc
index 8191502c..d1da4ff8 100644
--- a/apps/measure_cross.cc
+++ b/apps/measure_cross.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override{
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/measure_eval.cc b/apps/measure_eval.cc
index b08fd7c2..8ce48858 100644
--- a/apps/measure_eval.cc
+++ b/apps/measure_eval.cc
@@ -28,8 +28,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
PARAMETER<double> arg;
Cmd >> arg;
arg.e_val(BIGBIG, Scope);
diff --git a/apps/measure_integral.cc b/apps/measure_integral.cc
index d1e17da6..2ff8894b 100644
--- a/apps/measure_integral.cc
+++ b/apps/measure_integral.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/measure_max.cc b/apps/measure_max.cc
index d7d4c808..4cffaccb 100644
--- a/apps/measure_max.cc
+++ b/apps/measure_max.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/measure_min.cc b/apps/measure_min.cc
index 6955f686..0421e14b 100644
--- a/apps/measure_min.cc
+++ b/apps/measure_min.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/measure_rms.cc b/apps/measure_rms.cc
index 64cd0da6..f31a16f7 100644
--- a/apps/measure_rms.cc
+++ b/apps/measure_rms.cc
@@ -29,8 +29,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/measure_slewrate.cc b/apps/measure_slewrate.cc
index cd0a2613..d37b3693 100644
--- a/apps/measure_slewrate.cc
+++ b/apps/measure_slewrate.cc
@@ -30,8 +30,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class MEASURE : public FUNCTION {
public:
- std::string eval(CS& Cmd, const CARD_LIST* Scope)const
- {
+ std::string eval(CS& Cmd, const CARD_LIST* Scope)const override {
std::string probe_name;
PARAMETER<double> before(BIGBIG);
PARAMETER<double> after(-BIGBIG);
diff --git a/apps/s__init.cc b/apps/s__init.cc
index 6f99c557..245d1226 100644
--- a/apps/s__init.cc
+++ b/apps/s__init.cc
@@ -30,14 +30,18 @@
void SIM::command_base(CS& cmd)
{
assert(_sim);
+ assert(_scope);
+ if (_scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
reset_timers();
_sim->reset_iteration_counter(_sim->_mode);
_sim->reset_iteration_counter(iPRINTSTEP);
try {
setup(cmd);
- _sim->init();
- CARD_LIST::card_list.precalc_last();
+ _sim->init(_scope);
+ _scope->precalc_last();
_sim->alloc_vectors();
_sim->_aa.reallocate();
diff --git a/apps/s__solve.cc b/apps/s__solve.cc
index 0a5104c1..6e49c8b1 100644
--- a/apps/s__solve.cc
+++ b/apps/s__solve.cc
@@ -24,7 +24,7 @@
//testing=script 2006.07.14
#include "e_cardlist.h"
#include "u_status.h"
-#include "e_node.h"
+#include "e_logicnode.h"
#include "s__.h"
/*--------------------------------------------------------------------------*/
// bool SIM::solve(int,int);
@@ -103,7 +103,7 @@ bool SIM::solve_with_homotopy(OPT::ITL itl, TRACE trace)
double save_gmin = OPT::gmin;
OPT::gmin = 1;
while (_sim->_iter[iPRINTSTEP] < OPT::itl[OPT::SSTEP] && OPT::gmin > save_gmin) {
- //CARD_LIST::card_list.precalc();
+ //_scope->precalc();
_sim->set_inc_mode_no();
solve(itl, trace);
if (!converged) {
@@ -116,7 +116,7 @@ bool SIM::solve_with_homotopy(OPT::ITL itl, TRACE trace)
}
OPT::itermin = save_itermin;
OPT::gmin = save_gmin;
- //CARD_LIST::card_list.precalc();
+ //_scope->precalc();
solve(itl, trace);
if (!converged) {
trace2("final fail", _sim->_iter[iSTEP], OPT::gmin);
@@ -140,26 +140,34 @@ bool SIM::solve_with_homotopy(OPT::ITL itl, TRACE trace)
void SIM::finish_building_evalq(void)
{
::status.queue.start();
- CARD_LIST::card_list.tr_queue_eval();
+ assert(_scope);
+ if (_scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+ _scope->tr_queue_eval();
::status.queue.stop();
}
/*--------------------------------------------------------------------------*/
void SIM::advance_time(void)
{
+ assert(_scope);
+ if (_scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
::status.advance.start();
static double last_iter_time;
if (_sim->_time0 > 0) {
if (_sim->_time0 > last_iter_time) { /* moving forward */
notstd::copy_n(_sim->_v0, _sim->_total_nodes+1, _sim->_vt1);
- CARD_LIST::card_list.tr_advance();
+ _scope->tr_advance();
}else{ /* moving backward */
/* don't save voltages. They're wrong! */
/* instead, restore a clean start for iteration */
notstd::copy_n(_sim->_vt1, _sim->_total_nodes+1, _sim->_v0);
- CARD_LIST::card_list.tr_regress();
+ _scope->tr_regress();
}
}else{
- CARD_LIST::card_list.dc_advance();
+ _scope->dc_advance();
}
last_iter_time = _sim->_time0;
::status.advance.stop();
@@ -201,11 +209,15 @@ void SIM::clear_arrays(void)
std::fill_n(_sim->_i, _sim->_aa.size()+1, 0);
}else{
}
- assert(_sim->_loadq.empty());
+ // assert(_sim->_loadq.empty()); // queued load in *_advance.
}
/*--------------------------------------------------------------------------*/
void SIM::evaluate_models()
{
+ assert(_scope);
+ if (_scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
::status.evaluate.start();
if (OPT::bypass) {
converged = true;
@@ -216,7 +228,7 @@ void SIM::evaluate_models()
}
}else{
_sim->_evalq_uc->clear();
- converged = CARD_LIST::card_list.do_tr();
+ converged = _scope->do_tr();
}
while (!_sim->_late_evalq.empty()) { //BUG// encapsulation violation
converged &= _sim->_late_evalq.front()->do_tr_last();
@@ -249,7 +261,11 @@ void SIM::load_matrix()
}
}else{
_sim->_loadq.clear();
- CARD_LIST::card_list.tr_load();
+ assert(_scope);
+ if (_scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+ _scope->tr_load();
}
assert(_sim->_loadq.empty());
::status.load.stop();
diff --git a/apps/s_ac.cc b/apps/s_ac.cc
index 6d6d0c50..4fb0ca67 100644
--- a/apps/s_ac.cc
+++ b/apps/s_ac.cc
@@ -33,7 +33,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class AC : public SIM {
public:
- void do_it(CS&, CARD_LIST*);
+ void do_it(CS&, CARD_LIST*)override;
explicit AC():
SIM(),
@@ -49,12 +49,12 @@ public:
~AC() {}
private:
explicit AC(const AC&):SIM() {unreachable(); incomplete();}
- void sweep();
+ void sweep()override;
void first();
bool next();
void solve();
void clear();
- void setup(CS&);
+ void setup(CS&)override;
private:
PARAMETER<double> _start; // sweep start frequency
PARAMETER<double> _stop; // sweep stop frequency
@@ -68,6 +68,10 @@ private:
/*--------------------------------------------------------------------------*/
void AC::do_it(CS& Cmd, CARD_LIST* Scope)
{
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
_scope = Scope;
_sim->set_command_ac();
reset_timers();
@@ -75,8 +79,8 @@ void AC::do_it(CS& Cmd, CARD_LIST* Scope)
try {
setup(Cmd);
- _sim->init();
- CARD_LIST::card_list.precalc_last();
+ _sim->init(Scope);
+ _scope->precalc_last();
_sim->alloc_vectors();
_sim->_acx.reallocate();
@@ -96,7 +100,6 @@ void AC::do_it(CS& Cmd, CARD_LIST* Scope)
_sim->_acx.unallocate();
_sim->unalloc_vectors();
- _sim->_has_op = s_AC;
_scope = NULL;
::status.ac.stop();
@@ -182,10 +185,10 @@ void AC::setup(CS& Cmd)
needslinfix = true; // and I am too lazy to do it
_linswp = true; // right.
break;
- case TIMES:untested();
+ case TIMES:itested();
if (_step == 0. && _start != 0.) {untested();
_step = _stop / _start;
- }else{untested();
+ }else{itested();
}
needslinfix = false;
_linswp = false;
@@ -233,8 +236,8 @@ void AC::solve()
::status.load.start();
_sim->count_iterations(iTOTAL);
- CARD_LIST::card_list.do_ac();
- CARD_LIST::card_list.ac_load();
+ _scope->do_ac();
+ _scope->ac_load();
::status.load.stop();
::status.lud.start();
@@ -250,11 +253,12 @@ void AC::sweep()
{
head(_start, _stop, "Freq");
first();
- CARD_LIST::card_list.ac_begin();
+ _scope->ac_begin();
do {
_sim->_jomega = COMPLEX(0., _sim->_freq * M_TWO_PI);
solve();
outdata(_sim->_freq, ofPRINT | ofSTORE);
+ _sim->_has_op = s_AC;
} while (next());
}
/*--------------------------------------------------------------------------*/
diff --git a/apps/s_dc.cc b/apps/s_dc.cc
index 9a9d8f72..de0193a8 100644
--- a/apps/s_dc.cc
+++ b/apps/s_dc.cc
@@ -21,7 +21,6 @@
*------------------------------------------------------------------
* dc analysis top
*/
-//testing=script 2016.03.25
#include "globals.h"
#include "u_status.h"
#include "u_prblst.h"
@@ -31,19 +30,84 @@
/*--------------------------------------------------------------------------*/
namespace {
/*--------------------------------------------------------------------------*/
+class SWEEPVAL : public COMMON_COMPONENT {
+public:
+ explicit SWEEPVAL(int c=0)
+ :COMMON_COMPONENT(c) {}
+ explicit SWEEPVAL(const SWEEPVAL& p)
+ :COMMON_COMPONENT(p) {}
+ ~SWEEPVAL() { trace1("~SWEEPVAL", this);}
+ COMMON_COMPONENT* clone()const override{
+ return new SWEEPVAL(*this);
+ }
+
+private:
+ std::string name()const override{untested(); return "sweepval";}
+
+private: // override virtual
+ bool operator==(const COMMON_COMPONENT& p) const override {
+ return dynamic_cast<SWEEPVAL const*>(&p);
+ }
+ bool has_tr_eval()const override {return true;}
+ bool has_ac_eval()const override {untested(); return true;}
+ bool use_obsolete_callback_parse()const override {untested(); return false;}
+ bool use_obsolete_callback_print()const override {untested(); return false;}
+ bool has_parse_params_obsolete_callback()const override {untested(); return false;}
+
+private:
+ void tr_eval(ELEMENT* d)const override {
+ d->_y[0] = FPOLY1(CPOLY1(d->_y[0].x, 0., _value));
+ }
+ void ac_eval(ELEMENT* d)const override { untested();
+ tr_eval(d);
+ d->_ev = d->_y[0].f1;
+ }
+};
+/*--------------------------------------------------------------------------*/
+static SWEEPVAL p1(CC_STATIC);
+static DISPATCHER<COMMON_COMPONENT>::INSTALL d1(&bm_dispatcher,
+ "sweepval", &p1);
+/*--------------------------------------------------------------------------*/
+}
+namespace {
+/*--------------------------------------------------------------------------*/
class DCOP : public SIM {
public:
- void finish();
+ void finish()override;
protected:
void fix_args(int);
void options(CS&, int);
private:
- void sweep();
+ void sweep()override;
+ void precalc();
void sweep_recursive(int);
void first(int);
bool next(int);
explicit DCOP(const DCOP&): SIM() {unreachable(); incomplete();}
protected:
+ void set_sweepval(int i, double d){
+ ::status.set_up.start();
+ assert(_sweepval[i]);
+ std::string n = _param_name[i];
+ if(n!=""){
+ PARAM_LIST* pl = _scope->params();
+ assert(pl);
+ pl->set(n, d);
+ }else if(_zap[i]){
+ assert(_ctrl[i]);
+ auto c=prechecked_cast<SWEEPVAL*>(_ctrl[i]);
+ assert(c);
+ c->set_value(d);
+ }else{
+ }
+ *_sweepval[i] = d;
+ ::status.set_up.stop();
+ }
+ double get_sweepval(int i) const{
+ assert(_sweepval[i]);
+ return *_sweepval[i];
+ }
+protected:
explicit DCOP();
~DCOP() {}
@@ -57,6 +121,10 @@ protected:
bool _linswp[DCNEST];
double* _sweepval[DCNEST]; /* pointer to thing to sweep, dc command */
ELEMENT* _zap[DCNEST]; /* to branch to zap, for re-expand */
+ COMMON_COMPONENT* _ctrl[DCNEST]; /* take control */
+ std::string _param_name[DCNEST];
+ double _param[DCNEST]; // sweep this value:
+ PARAMETER<double> _param_zap[DCNEST]; // keep a backup
CARDSTASH _stash[DCNEST]; /* store std values of elements being swept */
bool _loop[DCNEST]; /* flag: do it again backwards */
bool _reverse_in[DCNEST]; /* flag: sweep backwards, input */
@@ -64,15 +132,16 @@ protected:
bool _cont; /* flag: continue from previous run */
TRACE _trace; /* enum: show extended diagnostics */
enum {ONE_PT, LIN_STEP, LIN_PTS, TIMES, OCTAVE, DECADE} _stepmode[DCNEST];
+ bool _have_param; /* sweep a param */
};
/*--------------------------------------------------------------------------*/
class DC : public DCOP {
public:
explicit DC(): DCOP() {}
~DC() {}
- void do_it(CS&, CARD_LIST*);
+ void do_it(CS&, CARD_LIST*)override;
private:
- void setup(CS&);
+ void setup(CS&)override;
explicit DC(const DC&): DCOP() {unreachable(); incomplete();}
};
/*--------------------------------------------------------------------------*/
@@ -80,35 +149,41 @@ class OP : public DCOP {
public:
explicit OP(): DCOP() {}
~OP() {}
- void do_it(CS&, CARD_LIST*);
+ void do_it(CS&, CARD_LIST*)override;
private:
- void setup(CS&);
+ void setup(CS&)override;
explicit OP(const OP&): DCOP() {unreachable(); incomplete();}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
void DC::do_it(CS& Cmd, CARD_LIST* Scope)
{
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
_scope = Scope;
_sim->_time0 = 0.;
_sim->set_command_dc();
_sim->_phase = p_INIT_DC;
::status.dc.reset().start();
command_base(Cmd);
- _sim->_has_op = s_DC;
_scope = NULL;
::status.dc.stop();
}
/*--------------------------------------------------------------------------*/
void OP::do_it(CS& Cmd, CARD_LIST* Scope)
{
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
_scope = Scope;
_sim->_time0 = 0.;
_sim->set_command_op();
_sim->_phase = p_INIT_DC;
::status.op.reset().start();
command_base(Cmd);
- _sim->_has_op = s_OP;
_scope = NULL;
::status.op.stop();
}
@@ -127,8 +202,10 @@ DCOP::DCOP()
_step[ii]=0.;
_linswp[ii]=true;
_sweepval[ii]=&_sim->_genout;
- _zap[ii]=NULL;
+ _zap[ii] = NULL;
+ _ctrl[ii] = NULL;
_stepmode[ii] = ONE_PT;
+ _param[ii] = NOT_VALID;
}
//BUG// in SIM. should be initialized there.
@@ -140,14 +217,21 @@ DCOP::DCOP()
void DCOP::finish(void)
{
for (int ii = 0; ii < _n_sweeps; ++ii) {
- if (_zap[ii]) { // component
+ std::string n = _param_name[ii];
+ if (_zap[ii]) {
_stash[ii].restore();
- _zap[ii]->dec_probes();
_zap[ii]->precalc_first();
_zap[ii]->precalc_last();
_zap[ii] = NULL;
- }else{
+ _ctrl[ii] = NULL;
+ }else if (n != "") {
+ PARAM_LIST* pl = _scope->params();
+ assert(pl);
+ std::string previous_value = _param_zap[ii].string();
+ CS cmd(CS::_STRING, n + "=" + previous_value);
+ pl->set(n, previous_value);
}
+ assert(!_ctrl[ii]);
}
}
/*--------------------------------------------------------------------------*/
@@ -162,6 +246,7 @@ void OP::setup(CS& Cmd)
_zap[0] = NULL;
_sweepval[0] = &(_sim->_temp_c);
+ _have_param = true; // temp requires precalc
if (Cmd.match1("'\"({") || Cmd.is_float()) {
Cmd >> _start[0];
@@ -197,19 +282,36 @@ void DC::setup(CS& Cmd)
_out = IO::mstdout;
_out.reset(); //BUG// don't know why this is needed */
bool ploton = IO::plotset && plotlist().size() > 0;
+ _have_param = false;
if (Cmd.more()) {
for (_n_sweeps = 0; Cmd.more() && _n_sweeps < DCNEST; ++_n_sweeps) {
- CARD_LIST::fat_iterator ci = findbranch(Cmd, &CARD_LIST::card_list);
+ CARD_LIST::fat_iterator ci = findbranch(Cmd, _scope);
if (!ci.is_end()) { // sweep a component
if (ELEMENT* c = dynamic_cast<ELEMENT*>(*ci)) {
_zap[_n_sweeps] = c;
+ _param_name[_n_sweeps] = ""; // not used.
+ trace2("_zap", c->value(), c->value().string());
}else{untested();
throw Exception("dc/op: can't sweep " + (**ci).long_label() + '\n');
}
}else if (Cmd.is_float()) { // sweep the generator
_zap[_n_sweeps] = NULL;
- }else{
+ }else if (Cmd.is_alpha()) {
+ std::string pname;
+
+ size_t here = Cmd.cursor();
+ Cmd >> pname;
+ PARAMETER<double> zap = _scope->params()->deep_lookup(pname);
+ if(zap.has_hard_value()){
+ _param_zap[_n_sweeps] = zap;
+ _param_name[_n_sweeps] = pname;
+ _have_param = true;
+ }else{
+ // possibly not a parameter. go on
+ Cmd.reset(here);
+ }
+ }else{ itested();
// leave as it was .. repeat Cmd with no args
}
@@ -225,7 +327,7 @@ void DC::setup(CS& Cmd)
_sim->_genout = 0.;
options(Cmd,_n_sweeps);
}
- }else{
+ }else{
}
Cmd.check(bWARNING, "what's this?");
@@ -239,10 +341,13 @@ void DC::setup(CS& Cmd)
if (_zap[ii]) { // component
_stash[ii] = _zap[ii]; // stash the std value
- _zap[ii]->inc_probes(); // we need to keep track of it
- _zap[ii]->set_value(_zap[ii]->value(),0); // zap out extensions
- _zap[ii]->set_constant(false); // so it will be updated
- _sweepval[ii] = _zap[ii]->set__value(); // point to value to patch
+ assert(!_ctrl[ii]);
+ _ctrl[ii] = bm_dispatcher.clone("sweepval");
+ assert(_ctrl[ii]);
+ _zap[ii]->attach_common(_ctrl[ii]); // take control
+ _sweepval[ii] = &_param[ii];
+ }else if (_param_name[ii] != "") {
+ _sweepval[ii] = &_param[ii];
}else{ // generator
_sweepval[ii] = &_sim->_genout; // point to value to patch
}
@@ -344,14 +449,32 @@ void DCOP::sweep()
_sim->set_inc_mode_bad();
if (_cont) {untested();
_sim->restore_voltages();
- CARD_LIST::card_list.tr_restore();
+ _scope->tr_restore();
}else{
_sim->clear_limit();
- CARD_LIST::card_list.tr_begin();
+ _scope->tr_begin();
}
sweep_recursive(_n_sweeps);
}
/*--------------------------------------------------------------------------*/
+void DCOP::precalc()
+{
+ ::status.set_up.start();
+ if(_have_param){
+ // do them all.
+ _scope->precalc_last();
+ }else{
+ for (int ii = 0; ii < _n_sweeps; ++ii) {
+ if (_zap[ii]) {
+ // only sweep elements
+ _zap[ii]->precalc_last();
+ }else{
+ }
+ }
+ }
+ ::status.set_up.stop();
+}
+/*--------------------------------------------------------------------------*/
void DCOP::sweep_recursive(int Nest)
{
--Nest;
@@ -363,18 +486,15 @@ void DCOP::sweep_recursive(int Nest)
first(Nest);
do {
if (Nest == 0) {
- if (_sim->command_is_op()) {
- CARD_LIST::card_list.precalc_last();
- }else{
- }
+ precalc();
int converged = solve_with_homotopy(itl,_trace);
- if (!converged) {untested();
+ if (!converged) {
error(bWARNING, "did not converge\n");
}else{
}
::status.accept.start();
_sim->set_limit();
- CARD_LIST::card_list.tr_accept();
+ _scope->tr_accept();
::status.accept.stop();
_sim->_has_op = _sim->_mode;
outdata(*_sweepval[Nest], ofPRINT | ofSTORE | ofKEEP);
@@ -393,15 +513,7 @@ void DCOP::first(int Nest)
assert(_sweepval);
assert(_sweepval[Nest]);
- if (ELEMENT* c = dynamic_cast<ELEMENT*>(_zap[Nest])) {
- c->set_constant(false);
- // because of extra precalc_last could set constant to true
- // will be obsolete, once pointer hack is fixed
- }else{
- // not needed if not sweeping an element
- }
-
- *_sweepval[Nest] = _start[Nest];
+ set_sweepval(Nest, _start[Nest]);
_reverse[Nest] = false;
if (_reverse_in[Nest]) {untested();
while (next(Nest)) {untested();
@@ -461,7 +573,7 @@ bool DCOP::next(int Nest)
assert(sweepval == NOT_VALID);
}else{
if (!_reverse[Nest]) {
- sweepval = *(_sweepval[Nest]) * _step[Nest];
+ sweepval = get_sweepval(Nest) * _step[Nest];
ok = in_order(_start[Nest]/fudge, sweepval, _stop[Nest]*fudge);
if (!ok && _loop[Nest]) {untested();
// turn around
@@ -477,7 +589,7 @@ bool DCOP::next(int Nest)
if (_reverse[Nest]) {untested();
assert(!ok);
assert(sweepval == NOT_VALID);
- sweepval = *(_sweepval[Nest]) / _step[Nest];
+ sweepval = get_sweepval(Nest) / _step[Nest];
ok = in_order(_start[Nest]/fudge, sweepval, _stop[Nest]*fudge);
}else{
// not sure of status
@@ -487,7 +599,7 @@ bool DCOP::next(int Nest)
_sim->_phase = p_DC_SWEEP;
if (ok) {
assert(sweepval != NOT_VALID);
- *(_sweepval[Nest]) = sweepval;
+ set_sweepval(Nest, sweepval);
return true;
}else{
//assert(sweepval == NOT_VALID);
diff --git a/apps/s_fo.cc b/apps/s_fo.cc
index 839f2c95..3ec99225 100644
--- a/apps/s_fo.cc
+++ b/apps/s_fo.cc
@@ -36,7 +36,7 @@ namespace {
/*--------------------------------------------------------------------------*/
class FOURIER : public TRANSIENT {
public:
- void do_it(CS&, CARD_LIST*);
+ void do_it(CS&, CARD_LIST*)override;
explicit FOURIER():
TRANSIENT(),
_fstart(0.),
@@ -48,14 +48,14 @@ public:
~FOURIER() {}
private:
explicit FOURIER(const FOURIER&): TRANSIENT() {unreachable(); incomplete();}
- std::string status()const {untested();return "";}
- void setup(CS&); /* s_fo_set.cc */
+ std::string status()const override {untested();return "";}
+ void setup(CS&)override; /* s_fo_set.cc */
void fftallocate();
void fftunallocate();
void foout(); /* s_fo_out.cc */
void fohead(const PROBE&);
void foprint(COMPLEX*);
- void store_results(double); // override virtual
+ void store_results(double)override; // override virtual
private:
PARAMETER<double> _fstart; /* user start frequency */
PARAMETER<double> _fstop; /* user stop frequency */
@@ -71,6 +71,10 @@ static double db(COMPLEX);
/*--------------------------------------------------------------------------*/
void FOURIER::do_it(CS& Cmd, CARD_LIST* Scope)
{
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
_scope = Scope;
_sim->set_command_fourier();
reset_timers();
@@ -78,8 +82,8 @@ void FOURIER::do_it(CS& Cmd, CARD_LIST* Scope)
try {
setup(Cmd);
- _sim->init();
- CARD_LIST::card_list.precalc_last();
+ _sim->init(Scope);
+ _scope->precalc_last();
_sim->alloc_vectors();
_sim->_aa.reallocate();
diff --git a/apps/s_tr.cc b/apps/s_tr.cc
index c5c98f5f..fad3eb5e 100644
--- a/apps/s_tr.cc
+++ b/apps/s_tr.cc
@@ -38,11 +38,14 @@ int TRANSIENT::steps_total_;
/*--------------------------------------------------------------------------*/
void TRANSIENT::do_it(CS& Cmd, CARD_LIST* Scope)
{
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
_scope = Scope;
_sim->set_command_tran();
::status.tran.reset().start();
command_base(Cmd);
- _sim->_has_op = s_TRAN;
_scope = NULL;
::status.tran.stop();
}
diff --git a/apps/s_tr_set.cc b/apps/s_tr_set.cc
index 97088072..782b0ed5 100644
--- a/apps/s_tr_set.cc
+++ b/apps/s_tr_set.cc
@@ -69,7 +69,7 @@ void TRANSIENT::setup(CS& Cmd)
_tstart = arg1; /* _tstart _tstop _tstrobe */
_tstop = arg2;
_tstrobe = arg3;
- }else if (arg1 > arg3) {untested(); /* eca (logical) order: */
+ }else if (arg1 > arg3) { itested(); /* eca (logical) order: */
_tstart = arg1; /* _tstart _tstop _tstrobe */
_tstop = arg2;
_tstrobe = arg3;
@@ -108,7 +108,7 @@ void TRANSIENT::setup(CS& Cmd)
_tstart = 0.;
_tstop = oldrange;
/* _tstrobe unchanged */
- }else{untested(); /* 1 arg: _tstrobe */
+ }else{itested(); /* 1 arg: _tstrobe */
assert(arg1 <= _sim->_last_time);
assert(arg1 > 0.);
double oldrange = _tstop - _tstart;
diff --git a/apps/s_tr_swp.cc b/apps/s_tr_swp.cc
index 601dbbe9..c6a36536 100644
--- a/apps/s_tr_swp.cc
+++ b/apps/s_tr_swp.cc
@@ -61,10 +61,10 @@ void TRANSIENT::sweep()
if (_cont) { // use the data from last time
_sim->_phase = p_RESTORE;
_sim->restore_voltages();
- CARD_LIST::card_list.tr_restore();
+ _scope->tr_restore();
}else{
_sim->clear_limit();
- CARD_LIST::card_list.tr_begin();
+ _scope->tr_begin();
}
first();
@@ -73,7 +73,7 @@ void TRANSIENT::sweep()
if (_sim->uic_now()) {
advance_time();
_sim->zero_voltages();
- CARD_LIST::card_list.do_tr(); //evaluate_models
+ _scope->do_tr(); //evaluate_models
while (!_sim->_late_evalq.empty()) {untested(); //BUG// encapsulation violation
_sim->_late_evalq.front()->do_tr_last();
_sim->_late_evalq.pop_front();
@@ -527,7 +527,7 @@ bool TRANSIENT::review()
::status.review.start();
_sim->count_iterations(iTOTAL);
- TIME_PAIR time_by = CARD_LIST::card_list.tr_review();
+ TIME_PAIR time_by = _scope->tr_review();
_time_by_error_estimate = time_by._error_estimate;
// limit minimum time step
@@ -543,7 +543,7 @@ bool TRANSIENT::review()
}else{
}
- if (time_by._error_estimate < _time1 + 2*_sim->_dtmin) {itested();
+ if (time_by._error_estimate < _time1 + 2*_sim->_dtmin) {
_time_by_error_estimate = _time1 + 2*_sim->_dtmin;
}else{
_time_by_error_estimate = time_by._error_estimate;
@@ -584,9 +584,10 @@ void TRANSIENT::accept()
}
}else{untested();
_sim->_acceptq.clear();
- CARD_LIST::card_list.tr_accept();
+ _scope->tr_accept();
}
++steps_accepted_;
+ _sim->_has_op = s_TRAN;
::status.accept.stop();
}
/*--------------------------------------------------------------------------*/
diff --git a/conf/Make1 b/conf/Make1
new file mode 100644
index 00000000..172cbf23
--- /dev/null
+++ b/conf/Make1
@@ -0,0 +1,72 @@
+#$Id: conf/Make1 $ -*- Makefile -*-
+# Copyright (C) 2001 Albert Davis
+# Author: Albert Davis <[email protected]>
+#
+# This file is part of "Gnucap", the Gnu Circuit Analysis Package
+#
+# This program 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, or (at your option)
+# any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#------------------------------------------------------------------------
+INSTALL_FILES = gnucap-conf
+INSTALL_DIR = $(PREFIX)/bin
+#------------------------------------------------------------------------
+INSTALL_FILES_1 = gnucap.conf
+INSTALL_DIR_1 = $(PREFIX)/etc
+#------------------------------------------------------------------------
+# suspended. intent: remove it entirely.
+# INSTALL_FILES_2 = config.h
+# INSTALL_DIR_2 = $(PREFIX)/include
+#------------------------------------------------------------------------
+LIBS =
+INCLUDE = -I. -I../include -I../../include
+#------------------------------------------------------------------------
+DELETED =
+#------------------------------------------------------------------------
+RAW_SRCS = gnucap-conf.in gnucap.conf.in config.h.in
+#------------------------------------------------------------------------
+RAW_OTHER = Make1 configure
+#------------------------------------------------------------------------
+RAW = $(RAW_HDRS) $(RAW_SRCS) $(RAW_OTHER)
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+IMPORTED_SRCS =
+IMPORTED_HDRS =
+IMPORTED_OTHER =
+IMPORTED = $(IMPORTED_SRCS) $(IMPORTED_HDRS) $(IMPORTED_OTHER)
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+GENERATED_SRCS =
+GENERATED_HDRS =
+GENERATED_OTHER = Make.aux
+GENERATED = $(GENERATED_HDRS) $(GENERATED_SRCS) $(GENERATED_OTHER)
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+GENERATED_DIST = Make.depend
+IMPORTED_DIST = $(IMPORTED)
+DIST_FILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+SRCS = $(RAW_SRCS) $(GENERATED_SRCS) $(IMPORTED_SRCS)
+HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
+OBJS = ${SRCS:.cc=.o}
+TARGET_DEPENDS = $(OBJS) $(RAW)
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+MOSTLYCLEANFILES = $(OBJS) $(GENERATED)
+CLEANFILES = $(MOSTLYCLEANFILES)
+DISTCLEANFILES = $(CLEANFILES)
+MAINTAINERCLEANFILES = $(DISTCLEANFILES)
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
diff --git a/main/config.h.in b/conf/config.h.in
index f407d03a..b7aa490d 100644
--- a/main/config.h.in
+++ b/conf/config.h.in
@@ -33,7 +33,8 @@
#define SYSTEMSTARTFILE "gnucap.rc"
#endif
#if !defined(SYSTEMSTARTPATH)
- #define SYSTEMSTARTPATH OS::getenv("PATH")
+ #define SYSTEMSTARTPATH ".:.gnucap:@sysconfdir_expanded@" \
+ ":@sysconfdir_expanded@/gnucap"
#endif
#if !defined(USERSTARTFILE)
#define USERSTARTFILE ".gnucaprc"
diff --git a/conf/configure b/conf/configure
new file mode 100755
index 00000000..851541fc
--- /dev/null
+++ b/conf/configure
@@ -0,0 +1,61 @@
+#!/bin/sh
+# conf/configure
+# configure for config
+
+#------------- Stuff added to enable --prefix --------------
+if test "x$1" != "x"; then
+ # echo Found input parameter -- $1
+ # Now see if the parameter is --prefix=
+ if test "x${1#--prefix=}" != "x$1"; then
+ # echo "Found --prefix in input args. Setting prefix directory."
+ prefix=${1#--prefix=}
+ else
+ # echo "Found unrecognized parameter in input args."
+ # Just use the default prefix dir.
+ prefix=/usr/local
+ fi
+
+else
+ # echo "No input parameter found."
+ # Just use the default prefix dir
+ prefix=/usr/local
+fi
+
+sed -e "s#/usr/local#$prefix#" ../Makefile.template > Makefile
+#----------------------------------------------------------------
+pkglibdir='${prefix}/lib/gnucap'
+pkglibdir_expanded="${prefix}/lib/gnucap"
+sysconfdir_expanded="${prefix}/etc"
+
+# bug. this is not implemented consistently.
+CXX=${CXX-c++}
+
+fill_template() {
+sed -e "s#@prefix@#$prefix#" \
+ -e "s#@exec_prefix@#$prefix#" \
+ -e "s#@libdir@#$prefix/lib#" \
+ -e "s#@includedir@#$\{prefix\}/include#" \
+ -e "s#@datarootdir@#$\{prefix\}/share/gnucap#" \
+ -e "s#@docdir@#$\{prefix\}/share/doc/gnucap#" \
+ -e "s#@sysconfdir@#$\{prefix\}/etc#" \
+ -e "s#@sysconfdir_expanded@#${sysconfdir_expanded}#" \
+ -e "s#@pkglibdir@#$pkglibdir#" \
+ -e "s#@pkglibdir_expanded@#$pkglibdir_expanded#" \
+ -e "s#@CXXFLAGS@#$CCFLAGS#" \
+ -e "s#@GNUCAP_LIBS@#-lgnucap#" \
+ -e "s#@CXX@#$CXX#" < $1.in > $1
+}
+
+fill_template config.h
+fill_template gnucap-conf
+fill_template gnucap.conf
+
+chmod +x gnucap-conf
+
+echo \# created by $PWD/$0. do not edit >Make2
+echo \#------------------------------------------------------------------------ >>Make2
+echo "PREFIX = " $prefix >>Make2
+echo "CXX = c++" >>Make2
+cat Make1 Make2 ../include/Make3 >Makefile
+
+exit 0
diff --git a/main/gnucap-conf.in b/conf/gnucap-conf.in
index b21ef199..b21ef199 100644
--- a/main/gnucap-conf.in
+++ b/conf/gnucap-conf.in
diff --git a/main/gnucap.conf.in b/conf/gnucap.conf.in
index 7845dd10..7845dd10 100644
--- a/main/gnucap.conf.in
+++ b/conf/gnucap.conf.in
diff --git a/configure b/configure
index 062ae38e..6376c66c 100755
--- a/configure
+++ b/configure
@@ -27,6 +27,8 @@ args="--prefix=$prefix"
echo "Configuring gnucap using $args"
#---------------------------------------------------
+echo conf
+(cd conf; ./configure $args)
echo include
(cd include; ./configure $args)
echo lib
diff --git a/include/Make1 b/include/Make1
index 93524421..3c9a4592 100644
--- a/include/Make1
+++ b/include/Make1
@@ -1,4 +1,4 @@
-#$Id: Make1 2016/09/17 $ -*- Makefile -*-
+#$Id: include/Make1 $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <[email protected]>
#
@@ -19,12 +19,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#------------------------------------------------------------------------
-TARGET =
-#------------------------------------------------------------------------
-INSTALL_FILES = $(RAW_SRCS) $(RAW_HDRS)
-#------------------------------------------------------------------------
+INSTALL_FILES = $(RAW_SRCS) $(RAW_HDRS) $(RAW_OTHER_INSTALL)
INSTALL_DIR = $(PREFIX)/include/gnucap
#------------------------------------------------------------------------
+LIBS =
+INCLUDE = -I. -I../include -I../../include
+#------------------------------------------------------------------------
DELETED =
#------------------------------------------------------------------------
RAW_SRCS = \
@@ -33,19 +33,22 @@ spice-wrapper.cc
RAW_HDRS = \
ap.h bm.h c_comand.h constant.h d_coment.h d_dot.h d_logic.h \
declare.h e_aux.h e_base.h e_card.h e_cardlist.h e_ccsrc.h e_compon.h \
+e_logicmod.h e_logicnode.h e_logicval.h \
e_elemnt.h e_model.h e_node.h e_paramlist.h e_storag.h e_subckt.h \
-globals.h io_.h io_error.h io_trace.h l_compar.h l_denoise.h \
-l_dispatcher.h l_lib.h l_stlextra.h l_timer.h m_base.h m_cpoly.h \
+globals.h io_.h io_error.h io_dir.h io_trace.h l_compar.h l_denoise.h \
+l_dispatcher.h l_indirect.h l_lib.h l_stlextra.h l_timer.h m_base.h m_cpoly.h \
m_divdiff.h m_expression.h m_interp.h m_matrix.h m_phase.h m_spline.h \
m_wave.h md.h mode.h patchlev.h s__.h s_tr.h trace_off.h trace_on.h \
u_cardst.h u_function.h u_lang.h u_limit.h u_nodemap.h u_opt.h \
u_parameter.h u_prblst.h u_probe.h u_sdp.h u_sim_data.h u_status.h \
-u_time_pair.h u_xprobe.h
+u_time_pair.h u_xprobe.h u_attrib.h
#------------------------------------------------------------------------
-RAW_OTHER = \
-configure Make1
+RAW_OTHER_INSTALL = Make2.g++ Make2.Debug Make3
+RAW_OTHER_NO_INSTALL = Make1 configure config.h
+# -- config.h is installed by conf
+# symlink here to mimic post-install during pre-install build
#------------------------------------------------------------------------
-RAW = $(RAW_HDRS) $(RAW_SRCS) $(MODELS) $(RAW_OTHER)
+RAW = $(RAW_HDRS) $(RAW_SRCS) $(RAW_OTHER)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
IMPORTED_SRCS =
@@ -54,8 +57,8 @@ IMPORTED_OTHER =
IMPORTED = $(IMPORTED_SRCS) $(IMPORTED_HDRS) $(IMPORTED_OTHER)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
-GENERATED_SRCS = ${MODELS:.model=.cc}
-GENERATED_HDRS = ${MODELS:.model=.h}
+GENERATED_SRCS =
+GENERATED_HDRS =
GENERATED_OTHER = Make.aux
GENERATED = $(GENERATED_HDRS) $(GENERATED_SRCS) $(GENERATED_OTHER)
#------------------------------------------------------------------------
@@ -65,10 +68,10 @@ IMPORTED_DIST = $(IMPORTED)
DIST_FILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
-SRCS = $(IMPORTED_SRCS) $(GENERATED_SRCS) $(RAW_SRCS)
+SRCS = $(RAW_SRCS) $(GENERATED_SRCS) $(IMPORTED_SRCS)
HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
OBJS = ${SRCS:.cc=.o}
-TARGET_DEPENDS = $(OBJS) $(RAW) $(MODELS)
+TARGET_DEPENDS = $(OBJS) $(RAW)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
MOSTLYCLEANFILES = $(OBJS) $(GENERATED)
diff --git a/modelgen/Make2.Debug b/include/Make2.Debug
index e531639f..07e46fb7 100644
--- a/modelgen/Make2.Debug
+++ b/include/Make2.Debug
@@ -20,35 +20,32 @@
# 02110-1301, USA.
#------------------------------------------------------------------------
VPATH = .:..
+PREFIX = /usr/local
# Standard base for g++, debugging, no optimization
# Running the program will give a spew of line markers for debugging.
-CCC = g++
+CXX = g++
CCFLAGS = \
--DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \
+-fPIC \
+-DHAVE_LIBREADLINE \
+-std=c++11 -DUNIX -g -O0 $(INCLUDE) -DTRACE_UNTESTED \
-Wall -Wextra \
-Wswitch-enum -Wundef -Wpointer-arith -Woverloaded-virtual \
-Wcast-qual -Wcast-align -Wpacked -Wshadow -Wconversion \
-Winit-self -Wmissing-include-dirs -Winvalid-pch \
-Wvolatile-register-var -Wstack-protector \
--Wvla -Woverlength-strings -Wno-sign-conversion -Wno-unused-const-variable
+-Wvla -Woverlength-strings -Wno-sign-conversion
#last line not in 4.1
-LIBS = \
--lgnucap \
-
-LDFLAGS = -rdynamic \
--L../../lib/O-DEBUG
-
-%.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
+.SUFFIXES:
+.SUFFIXES: .so .o .cc
+.cc.o:; $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(CCFLAGS) -c $<
+.cc.so:; $(MAKE_LIB) $<
#------------------------------------------------------------------------
-$(TARGET): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
+MAKE_EXE = $(CXX) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
+MAKE_LIB = $(CXX) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -shared -o $@
#------------------------------------------------------------
# warnings turned off, because they warn of nothing wrong
# 4.3
diff --git a/lib/Make2.g++ b/include/Make2.g++
index 7dd15988..5471b343 100644
--- a/lib/Make2.g++
+++ b/include/Make2.g++
@@ -20,30 +20,25 @@
# 02110-1301, USA.
#------------------------------------------------------------------------
VPATH = .:..
+PREFIX = /usr/local
# Standard base for g++.
-CCC = g++
-TARGET_EXT = .so
+CXX = g++
CCFLAGS = \
-fPIC \
-DHAVE_LIBREADLINE \
--DUNIX -O3 -DNDEBUG -I. -I../include -I../../include -W
+-std=c++11 -DUNIX -O3 -DNDEBUG $(INCLUDE) -W
-LIBS = \
--lreadline -ltermcap \
--ldl
-
-LDFLAGS = -shared
.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
+.SUFFIXES: .so .o .cc
+.cc.o:; $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(CCFLAGS) -c $<
+.cc.so:; $(MAKE_LIB) $<
#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
+MAKE_EXE = $(CXX) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
+MAKE_LIB = $(CXX) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -shared -o $@
#------------------------------------------------------------
# If you are porting and using g++, you should use this file as a start,
# for a "release" version, optimized with run-time tracing removed.
diff --git a/Make3 b/include/Make3
index f9d42037..0dcd6ea7 100644
--- a/Make3
+++ b/include/Make3
@@ -21,6 +21,8 @@
#------------------------------------------------------------------------
# Part 3 of a Makefile
#------------------------------------------------------------------------
+all: $(TARGET) ${TARGET_LIB:%=%${TARGET_LIB_EXT}} ${TARGET_EXE:%=%${TARGET_EXE_EXT}}
+#------------------------------------------------------------------------
tags: $(HDRS) $(SRCS)
etags --c++ $(HDRS) $(SRCS)
#------------------------------------------------------------------------
@@ -29,23 +31,18 @@ checkout:
#------------------------------------------------------------------------
install-debug : install
-install : $(INSTALL_FILES) $(DATA_FILES)
- echo ==================
- mkdir -p $(DESTDIR)$(INSTALL_DIR)
- cp $(INSTALL_FILES) $(DESTDIR)$(INSTALL_DIR)
-
- [ -z "$(INSTALL_DATA_DIR)" ] || \
- mkdir -p $(DESTDIR)$(INSTALL_DATA_DIR)
- [ -z "$(INSTALL_DATA_FILES)" ] || \
- cp $(INSTALL_DATA_FILES) $(DESTDIR)$(INSTALL_DATA_DIR)
-
- [ -z "$(INSTALL_SYSCONF_DIR)" ] || \
- mkdir -p $(DESTDIR)$(INSTALL_SYSCONF_DIR)
- [ -z "$(INSTALL_SYSCONF_FILES)" ] || \
- cp $(INSTALL_SYSCONF_FILES) $(DESTDIR)$(INSTALL_SYSCONF_DIR)
+install : $(INSTALL_FILES) $(INSTALL_FILES_1) $(INSTALL_FILES_2)
+ [ -z "$(INSTALL_DIR)" ] || mkdir -p $(DESTDIR)$(INSTALL_DIR)
+ [ -z "$(INSTALL_DIR_1)" ] || mkdir -p $(DESTDIR)$(INSTALL_DIR_1)
+ [ -z "$(INSTALL_DIR_2)" ] || mkdir -p $(DESTDIR)$(INSTALL_DIR_2)
+ [ -z "$(INSTALL_FILES)" ] || cp $(INSTALL_FILES) $(DESTDIR)$(INSTALL_DIR)
+ [ -z "$(INSTALL_FILES_1)" ] || cp $(INSTALL_FILES_1) $(DESTDIR)$(INSTALL_DIR_1)
+ [ -z "$(INSTALL_FILES_2)" ] || cp $(INSTALL_FILES_2) $(DESTDIR)$(INSTALL_DIR_2)
#------------------------------------------------------------------------
uninstall :
- (cd $(DESTDIR)$(INSTALL_DIR) ; rm $(INSTALL_FILES))
+ (cd $(DESTDIR)$(INSTALL_DIR) ; rm -f $(INSTALL_FILES))
+ (cd $(DESTDIR)$(INSTALL_DIR_1) ; rm -f $(INSTALL_FILES_1))
+ (cd $(DESTDIR)$(INSTALL_DIR_2) ; rm -f $(INSTALL_FILES_2))
#------------------------------------------------------------------------
#unclean:
# rm $(ALL)
@@ -56,14 +53,14 @@ backup:
#------------------------------------------------------------------------
depend: Make.depend
Make.depend: $(SRCS) $(HDRS)
- $(CCC) -MM $(CCFLAGS) $(SRCS) > Make.depend
+ $(CXX) -MM $(CCFLAGS) $(SRCS) > Make.depend
#-----------------------------------------------------------------------------
date:
date "+#define PATCHLEVEL \"`git branch | awk '/\*/ { print $$2; }'` %Y.%m.%d\"" \
>patchlev.h
#-----------------------------------------------------------------------------
header-check:
- -$(CCC) -I../include -o /dev/null $(RAW_HDRS)
+ -$(CXX) -I../include -o /dev/null $(RAW_HDRS)
#-----------------------------------------------------------------------------
manifest: MANIFEST
MANIFEST: $(DIST_FILES)
@@ -89,3 +86,13 @@ maintainer-clean:
rm -f *~ \#*\#
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
+$(TARGET_EXE)$(TARGET_EXE_EXT): $(TARGET_DEPENDS)
+ rm -f $@
+ $(MAKE_EXE) -o $@
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+$(TARGET_LIB)$(TARGET_LIB_EXT): $(TARGET_DEPENDS)
+ rm -f $@
+ $(MAKE_LIB) -o $@
+#------------------------------------------------------------------------
+#------------------------------------------------------------------------
diff --git a/include/ap.h b/include/ap.h
index e53507a6..8eeedb07 100644
--- a/include/ap.h
+++ b/include/ap.h
@@ -90,6 +90,7 @@ public:
// control
CS& reset(size_t c=0) {_cnt=c; _ok=true; return *this;}
+ CS& reset_fail(size_t c=0) {_cnt=c; _ok=false; return *this;}
// exception handling (ap_error.cc) non-consuming
CS& check(int, const std::string&);
@@ -157,6 +158,7 @@ public:
CS& skipcom() {return skip1b(",");}
CS& operator>>(const char& x) {return skip1b(x);}
CS& operator>>(const char* x) {return umatch(x);}
+ CS& operator>>(const std::string& x) {itested();return umatch(x);}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/bm.h b/include/bm.h
index 734c0a4a..97ded791 100644
--- a/include/bm.h
+++ b/include/bm.h
@@ -37,12 +37,13 @@ protected:
:COMMON_COMPONENT(p) {}
~EVAL_BM_BASE() {}
protected: // override virtual
- bool operator==(const COMMON_COMPONENT&)const{/*incomplete();*/return false;}
- bool has_tr_eval()const {return true;}
- bool has_ac_eval()const {return true;}
- bool use_obsolete_callback_parse()const {return true;}
- bool use_obsolete_callback_print()const {return true;}
- bool has_parse_params_obsolete_callback()const {return true;}
+ bool operator==(const COMMON_COMPONENT&)const override
+ {/*incomplete();*/return false;}
+ bool has_tr_eval()const override {return true;}
+ bool has_ac_eval()const override {return true;}
+ bool use_obsolete_callback_parse()const override {return true;}
+ bool use_obsolete_callback_print()const override {return true;}
+ bool has_parse_params_obsolete_callback()const override {return true;}
};
/*--------------------------------------------------------------------------*/
class INTERFACE EVAL_BM_ACTION_BASE : public EVAL_BM_BASE {
@@ -68,15 +69,15 @@ protected:
double uic(double x)const {return (_sim->uic_now()) ? _ic : x;}
double ioffset(double x)const {return uic(x) + _ioffset;}
public: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
//COMPONENT_COMMON* clone()const; //COMPONENT_COMMON=0
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_last(const CARD_LIST*);
- void ac_eval(ELEMENT*)const;
+ void precalc_last(const CARD_LIST*)override;
+ void ac_eval(ELEMENT*)const override;
virtual bool ac_too()const = 0;
protected: // override virtual
- bool parse_params_obsolete_callback(CS&);
+ bool parse_params_obsolete_callback(CS&)override;
public:
bool has_ext_args()const;
static COMMON_COMPONENT* parse_func_type(CS&);
@@ -90,17 +91,17 @@ public:
explicit EVAL_BM_VALUE(int c=0) :EVAL_BM_ACTION_BASE(c) {}
~EVAL_BM_VALUE() {}
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_VALUE(*this);}
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
- bool is_trivial()const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_VALUE(*this);}
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
+ bool is_trivial()const override;
- void precalc_first(const CARD_LIST*);
- void tr_eval(ELEMENT*)const;
- std::string name()const {itested();return "VALUE";}
- bool ac_too()const {return false;}
- bool parse_numlist(CS&);
- bool parse_params_obsolete_callback(CS&);
+ void precalc_first(const CARD_LIST*)override;
+ void tr_eval(ELEMENT*)const override;
+ std::string name()const override {itested();return "VALUE";}
+ bool ac_too()const override {return false;}
+ bool parse_numlist(CS&) override;
+ bool parse_params_obsolete_callback(CS&) override;
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/config.h b/include/config.h
new file mode 120000
index 00000000..7ee71990
--- /dev/null
+++ b/include/config.h
@@ -0,0 +1 @@
+../conf/config.h \ No newline at end of file
diff --git a/include/configure b/include/configure
index 912b8ab7..be2d8560 100755
--- a/include/configure
+++ b/include/configure
@@ -1,4 +1,5 @@
#!/bin/sh
+# include/configure
# configure for stuff that just needs to be installed
#------------- Stuff added to enable --prefix --------------
@@ -22,10 +23,8 @@ fi
#----------------------------------------------------------------
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------ >>Make2
-echo "CCC = c++" >>Make2
echo "PREFIX = " $prefix >>Make2
-echo "" >>Make2
-
-cat Make1 Make2 ../Make3 >Makefile
+echo "CXX = c++" >>Make2
+cat Make1 Make2 ../include/Make3 >Makefile
exit 0
diff --git a/include/d_coment.h b/include/d_coment.h
index c06bc915..5eeb9a1d 100644
--- a/include/d_coment.h
+++ b/include/d_coment.h
@@ -33,10 +33,10 @@ private:
public:
explicit DEV_COMMENT() :CARD() {set_constant(true);}
private: // override virtual
- char id_letter()const {untested(); return '\0';}
- std::string dev_type()const {untested(); return "comment";}
- CARD* clone()const {return new DEV_COMMENT(*this);}
- std::string value_name()const {return "";}
+ char id_letter()const override {untested(); return '\0';}
+ std::string dev_type()const override {itested(); return "comment";}
+ CARD* clone()const override {return new DEV_COMMENT(*this);}
+ std::string value_name()const override {return "";}
public:
void set(const std::string& s) {_s = s;}
std::string comment()const {return _s;}
diff --git a/include/d_dot.h b/include/d_dot.h
index 1827ab68..95c8b49c 100644
--- a/include/d_dot.h
+++ b/include/d_dot.h
@@ -32,13 +32,13 @@ private:
public:
explicit DEV_DOT() :CARD() {set_constant(true);}
private: // override virtual
- std::string value_name()const {untested();return "";}
- char id_letter()const {untested();return '\0';}
- std::string dev_type()const {untested();return "dotcard";}
- CARD* clone()const {return new DEV_DOT(*this);}
+ std::string value_name()const override {untested();return "";}
+ char id_letter()const override {untested();return '\0';}
+ std::string dev_type()const override {untested();return "dotcard";}
+ CARD* clone()const override {return new DEV_DOT(*this);}
public:
void set(const std::string& S) {_s = S;}
- const std::string& s()const {untested();return _s;}
+ const std::string& s()const {itested();return _s;}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/d_logic.h b/include/d_logic.h
index e1cd659c..811c6b24 100644
--- a/include/d_logic.h
+++ b/include/d_logic.h
@@ -21,266 +21,8 @@
*------------------------------------------------------------------
* data structures and defaults for logic model.
*/
-//testing=script,sparse 2006.07.17
+//testing=script,sparse 2023.11.22
#ifndef D_LOGIC_H
#define D_LOGIC_H
-#include "e_model.h"
-#include "e_elemnt.h"
-/*--------------------------------------------------------------------------*/
-enum {PORTS_PER_GATE = 10};
-/*--------------------------------------------------------------------------*/
-class DEV_LOGIC : public ELEMENT {
-public:
- enum {OUTNODE=0,GND_NODE=1,PWR_NODE=2,ENABLE=3,BEGIN_IN=4}; //node labels
-private:
- int _lastchangenode;
- int _quality;
- std::string _failuremode;
- smode_t _oldgatemode;
- smode_t _gatemode;
- static int _count;
- node_t nodes[PORTS_PER_GATE]; /* PORTS_PER_GATE <= PORTSPERSUBCKT */
-public:
- explicit DEV_LOGIC();
- explicit DEV_LOGIC(const DEV_LOGIC& p);
- ~DEV_LOGIC() {--_count;}
-private: // override virtuals
- char id_letter()const {return 'U';}
- std::string value_name()const {return "#";}
- bool print_type_in_spice()const {return true;}
- std::string dev_type()const {assert(has_common());
- return (common()->modelname() + " " + common()->name()).c_str();}
- int tail_size()const {return 2;}
- int max_nodes()const {return PORTS_PER_GATE;}
- int min_nodes()const {return BEGIN_IN+1;}
- int matrix_nodes()const {return 2;}
- int net_nodes()const {return _net_nodes;}
- CARD* clone()const {return new DEV_LOGIC(*this);}
- void precalc_first() {ELEMENT::precalc_first(); if (subckt()) {subckt()->precalc_first();}}
- void expand();
- void precalc_last() {ELEMENT::precalc_last(); if (subckt()) {subckt()->precalc_last();}}
- //void map_nodes();
-
- void tr_iwant_matrix();
- void tr_begin();
- void tr_restore();
- void dc_advance();
- void tr_advance();
- void tr_regress();
- bool tr_needs_eval()const;
- void tr_queue_eval();
- bool do_tr();
- void tr_load();
- TIME_PAIR tr_review();
- void tr_accept();
- void tr_unload();
- double tr_involts()const {unreachable(); return 0;}
- //double tr_input()const //ELEMENT
- double tr_involts_limited()const {unreachable(); return 0;}
- //double tr_input_limited()const //ELEMENT
- //double tr_amps()const //ELEMENT
- double tr_probe_num(const std::string&)const;
-
- void ac_iwant_matrix();
- void ac_begin();
- void do_ac() {untested(); assert(subckt()); subckt()->do_ac();}
- void ac_load() {untested(); assert(subckt()); subckt()->ac_load();}
- COMPLEX ac_involts()const {unreachable(); return 0.;}
- COMPLEX ac_amps()const {unreachable(); return 0.;}
- XPROBE ac_probe_ext(const std::string&)const;
-
- std::string port_name(int)const {untested();
- incomplete();
- return "";
- }
-public:
- static int count() {return _count;}
-private:
- bool tr_eval_digital();
- bool want_analog()const;
- bool want_digital()const;
-};
-/*--------------------------------------------------------------------------*/
-class MODEL_LOGIC : public MODEL_CARD {
-private:
- explicit MODEL_LOGIC(const MODEL_LOGIC& p);
-public:
- explicit MODEL_LOGIC(const DEV_LOGIC*);
- ~MODEL_LOGIC() {--_count;}
-private: // override virtuals
- std::string dev_type()const {return "logic";}
- CARD* clone()const {return new MODEL_LOGIC(*this);}
- void precalc_first();
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (13 + MODEL_CARD::param_count());}
-public:
- static int count() {return _count;}
-public:
- /* ----- digital mode ----- */
- PARAMETER<double> delay; /* propagation delay */
- /* -- conversion parameters both ways -- */
- PARAMETER<double> vmax; /* nominal volts for logic 1 */
- PARAMETER<double> vmin; /* nominal volts for logic 0 */
- PARAMETER<double> unknown; /* nominal volts for unknown (bogus) */
- /* ---- D to A conversion ---- */
- PARAMETER<double> rise; /* rise time (time in slope) */
- PARAMETER<double> fall; /* fall time (time in slope) */
- PARAMETER<double> rs; /* series resistance -- strong */
- PARAMETER<double> rw; /* series resistance -- weak */
- /* ---- A to D conversion ---- */
- PARAMETER<double> th1; /* threshold for 1 as fraction of range */
- PARAMETER<double> th0; /* threshold for 0 as fraction of range */
- /* ---- quality judgement parameters ---- */
- PARAMETER<double> mr; /* margin rise - how much worse rise can be */
- PARAMETER<double> mf; /* margin fall - how much worse fall can be */
- PARAMETER<double> over; /* overshoot limit - as fraction of range */
-public: // calculated parameters
- double range; /* vmax - vmin */
-private:
- static int _count;
-};
-/*--------------------------------------------------------------------------*/
-class INTERFACE COMMON_LOGIC : public COMMON_COMPONENT {
-protected:
- explicit COMMON_LOGIC(int c=0)
- :COMMON_COMPONENT(c), incount(0) {++_count;}
- explicit COMMON_LOGIC(const COMMON_LOGIC& p)
- :COMMON_COMPONENT(p), incount(p.incount) {++_count;}
-public:
- ~COMMON_LOGIC() {--_count;}
- bool operator==(const COMMON_COMPONENT&)const;
- static int count() {return _count;}
- virtual LOGICVAL logic_eval(const node_t*)const = 0;
-public:
- int incount;
-protected:
- static int _count;
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_AND : public COMMON_LOGIC {
-private:
- explicit LOGIC_AND(const LOGIC_AND& p) :COMMON_LOGIC(p){untested();++_count;}
- COMMON_COMPONENT* clone()const {untested(); return new LOGIC_AND(*this);}
-public:
- explicit LOGIC_AND(int c=0) :COMMON_LOGIC(c) {untested();}
- LOGICVAL logic_eval(const node_t* n)const {untested();
- LOGICVAL out(n[0]->lv());
- for (int ii=1; ii<incount; ++ii) {untested();
- out &= n[ii]->lv();
- }
- return out;
- }
- virtual std::string name()const {itested();return "and";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_NAND : public COMMON_LOGIC {
-private:
- explicit LOGIC_NAND(const LOGIC_NAND&p):COMMON_LOGIC(p){++_count;}
- COMMON_COMPONENT* clone()const {return new LOGIC_NAND(*this);}
-public:
- explicit LOGIC_NAND(int c=0) :COMMON_LOGIC(c) {}
- LOGICVAL logic_eval(const node_t* n)const {untested();
- LOGICVAL out(n[0]->lv());
- for (int ii=1; ii<incount; ++ii) {untested();
- out &= n[ii]->lv();
- }
- return ~out;
- }
- virtual std::string name()const {itested();return "nand";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_OR : public COMMON_LOGIC {
-private:
- explicit LOGIC_OR(const LOGIC_OR& p) :COMMON_LOGIC(p){untested();++_count;}
- COMMON_COMPONENT* clone()const {untested(); return new LOGIC_OR(*this);}
-public:
- explicit LOGIC_OR(int c=0) :COMMON_LOGIC(c) {untested();}
- LOGICVAL logic_eval(const node_t* n)const {untested();
- LOGICVAL out(n[0]->lv());
- for (int ii=1; ii<incount; ++ii) {untested();
- out |= n[ii]->lv();
- }
- return out;
- }
- virtual std::string name()const {itested();return "or";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_NOR : public COMMON_LOGIC {
-private:
- explicit LOGIC_NOR(const LOGIC_NOR& p) :COMMON_LOGIC(p) {++_count;}
- COMMON_COMPONENT* clone()const {return new LOGIC_NOR(*this);}
-public:
- explicit LOGIC_NOR(int c=0) :COMMON_LOGIC(c) {}
- LOGICVAL logic_eval(const node_t* n)const {
- LOGICVAL out(n[0]->lv());
- for (int ii=1; ii<incount; ++ii) {
- out |= n[ii]->lv();
- }
- return ~out;
- }
- virtual std::string name()const {return "nor";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_XOR : public COMMON_LOGIC {
-private:
- explicit LOGIC_XOR(const LOGIC_XOR& p) :COMMON_LOGIC(p){untested();++_count;}
- COMMON_COMPONENT* clone()const {untested(); return new LOGIC_XOR(*this);}
-public:
- explicit LOGIC_XOR(int c=0) :COMMON_LOGIC(c) {untested();}
- LOGICVAL logic_eval(const node_t* n)const {untested();
- LOGICVAL out(n[0]->lv());
- for (int ii=1; ii<incount; ++ii) {untested();
- out ^= n[ii]->lv();
- }
- return out;
- }
- virtual std::string name()const {itested();return "xor";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_XNOR : public COMMON_LOGIC {
-private:
- explicit LOGIC_XNOR(const LOGIC_XNOR&p):COMMON_LOGIC(p){untested();++_count;}
- COMMON_COMPONENT* clone()const {untested(); return new LOGIC_XNOR(*this);}
-public:
- explicit LOGIC_XNOR(int c=0) :COMMON_LOGIC(c) {untested();}
- LOGICVAL logic_eval(const node_t* n)const {untested();
- LOGICVAL out(n[0]->lv());
- for (int ii=1; ii<incount; ++ii) {untested();
- out ^= n[ii]->lv();
- }
- return ~out;
- }
- virtual std::string name()const {itested();return "xnor";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_INV : public COMMON_LOGIC {
-private:
- explicit LOGIC_INV(const LOGIC_INV& p) :COMMON_LOGIC(p){++_count;}
- COMMON_COMPONENT* clone()const {return new LOGIC_INV(*this);}
-public:
- explicit LOGIC_INV(int c=0) :COMMON_LOGIC(c) {}
- LOGICVAL logic_eval(const node_t* n)const {
- return ~n[0]->lv();
- }
- virtual std::string name()const {return "inv";}
-};
-/*--------------------------------------------------------------------------*/
-class LOGIC_NONE : public COMMON_LOGIC {
-private:
- explicit LOGIC_NONE(const LOGIC_NONE&p):COMMON_LOGIC(p){itested();++_count;}
- COMMON_COMPONENT* clone()const {itested(); return new LOGIC_NONE(*this);}
-public:
- explicit LOGIC_NONE(int c=0) :COMMON_LOGIC(c) {}
- LOGICVAL logic_eval(const node_t*)const {untested();
- return lvUNKNOWN;
- }
- virtual std::string name()const {untested();return "error";}
-};
-/*--------------------------------------------------------------------------*/
-/*--------------------------------------------------------------------------*/
#endif
// vim:ts=8:sw=2:noet:
diff --git a/include/e_base.h b/include/e_base.h
index cf63726e..7fb68005 100644
--- a/include/e_base.h
+++ b/include/e_base.h
@@ -24,7 +24,8 @@
//testing=script 2014.07.04
#ifndef E_BASE_H
#define E_BASE_H
-#include "md.h"
+#include "u_attrib.h"
+#include "l_indirect.h"
/*--------------------------------------------------------------------------*/
// external
class XPROBE;
@@ -40,12 +41,18 @@ private:
public:
static SIM_DATA* _sim;
static PROBE_LISTS* _probe_lists;
+//protected: // TODO
+ static INDIRECT<ATTRIB_LIST_p>* _attribs;
+public:
+ ATTRIB_LIST_p& attributes(const void* x) { assert(_attribs); return (*_attribs)[x];}
+ const ATTRIB_LIST_p& attributes(const void* x)const { assert(_attribs); return _attribs->at(x);}
//--------------------------------------------------------------------
protected: // create and destroy
explicit CKT_BASE() :_probes(0), _label() {}
explicit CKT_BASE(const std::string& s) :_probes(0), _label(s) {}
explicit CKT_BASE(const CKT_BASE& p) :_probes(0), _label(p._label) {}
virtual ~CKT_BASE();
+ virtual void purge() {}
//--------------------------------------------------------------------
public: // user stuff
virtual std::string help_text()const {return "";}
@@ -64,7 +71,7 @@ public: // probes
static WAVE* find_wave(const std::string& probe_name);
//--------------------------------------------------------------------
public: // label
- bool operator!=(const std::string& n)const {return strcasecmp(_label.c_str(),n.c_str())!=0;}
+ bool operator!=(const std::string& n)const;
virtual const std::string long_label()const;
const std::string& short_label()const {return _label;}
void set_label(const std::string& s) {_label = s;}
diff --git a/include/e_card.h b/include/e_card.h
index e51dac34..a17c22bd 100644
--- a/include/e_card.h
+++ b/include/e_card.h
@@ -58,6 +58,7 @@ protected: // create and destroy.
explicit CARD(const CARD&);
public:
virtual ~CARD();
+ void purge() override;
virtual CARD* clone()const = 0;
virtual CARD* clone_instance()const {return clone();}
//--------------------------------------------------------------------
@@ -68,6 +69,7 @@ public: // "elaborate"
virtual void expand_last() {}
virtual void precalc_last() {}
virtual void map_nodes() {}
+ virtual CARD* deflate() {itested(); return this;}
//--------------------------------------------------------------------
public: // dc-tran
virtual void tr_iwant_matrix() {}
@@ -93,7 +95,7 @@ public: // ac
//--------------------------------------------------------------------
public: // state, aux data
virtual char id_letter()const {unreachable(); return '\0';}
- virtual int net_nodes()const {untested();return 0;}
+ virtual int net_nodes()const {return 0;}
virtual bool is_device()const {return false;}
virtual void set_slave() {untested(); assert(!subckt());}
bool evaluated()const;
@@ -108,14 +110,14 @@ public: // owner, scope
CARD* owner() {return _owner;}
const CARD* owner()const {return _owner;}
- void set_owner(CARD* o) {assert(!_owner||_owner==o); _owner=o;}
+ void set_owner(CARD* o) {assert(!o||!_owner||_owner==o); _owner=o;}
//--------------------------------------------------------------------
public: // subckt
CARD_LIST* subckt() {return _subckt;}
const CARD_LIST* subckt()const {return _subckt;}
void new_subckt();
- void new_subckt(const CARD* model, PARAM_LIST* p);
- void renew_subckt(const CARD* model, PARAM_LIST* p);
+ void new_subckt(const CARD* model, PARAM_LIST const* p);
+ void renew_subckt(const CARD* model, PARAM_LIST const* p);
//void new_subckt(const CARD* model, CARD* owner, const CARD_LIST* scope, PARAM_LIST* p);
//void renew_subckt(const CARD* model, CARD* owner, const CARD_LIST* scope, PARAM_LIST* p);
//--------------------------------------------------------------------
@@ -126,19 +128,24 @@ public: // type
public: // label -- in CKT_BASE
// non-virtual void set_label(const std::string& s) //BASE
// non-virtual const std::string& short_label()const //BASE
- /*virtual*/ const std::string long_label()const; // no further override
+ /*virtual*/ const std::string long_label()const final;
+ //--------------------------------------------------------------------
+public: // tags -- an identifier
+ const void* id_tag()const {return static_cast<const void*>(this);}
+ virtual const void* port_id_tag(int i)const {return(reinterpret_cast<const bool*>(this)-(i+1));}
+ virtual const void* param_id_tag(int i)const{return(reinterpret_cast<const bool*>(this)+(i+1));}
//--------------------------------------------------------------------
public: // ports -- mostly defer to COMPONENT
node_t& n_(int i)const;
int connects_to(const node_t& node)const;
//--------------------------------------------------------------------
public: // parameters
- virtual void set_param_by_name(std::string, std::string);
+ virtual int set_param_by_name(std::string, std::string);
virtual void set_param_by_index(int i, std::string&, int offset)
{untested(); throw Exception_Too_Many(i, 0, offset);}
virtual int param_count_dont_print()const {return 0;}
virtual int param_count()const {return 0;}
- virtual bool param_is_printable(int)const {untested(); return false;}
+ virtual bool param_is_printable(int)const {return false;}
virtual std::string param_name(int)const {return "";}
virtual std::string param_name(int i,int j)const {return (j==0) ? param_name(i) : "";}
virtual std::string param_value(int)const {untested(); return "";}
diff --git a/include/e_cardlist.h b/include/e_cardlist.h
index 83e4fa41..6afa1444 100644
--- a/include/e_cardlist.h
+++ b/include/e_cardlist.h
@@ -75,6 +75,7 @@ public:
// status queries
bool is_empty()const {return _cl.empty();}
+ size_t size()const {return _cl.size();}
const CARD_LIST* parent()const {return _parent;}
// return an iterator
@@ -132,12 +133,12 @@ public:
PARAM_LIST* params()const;
// more complex stuff
- void attach_params(PARAM_LIST* p, const CARD_LIST* scope);
+ void attach_params(PARAM_LIST const* p, const CARD_LIST* scope);
void shallow_copy(const CARD_LIST*);
void map_subckt_nodes(const CARD* model, const CARD* owner);
explicit CARD_LIST();
- explicit CARD_LIST(const CARD* model, CARD* owner, const CARD_LIST* scope, PARAM_LIST* p);
+ explicit CARD_LIST(const CARD* model, CARD* owner, const CARD_LIST* scope, PARAM_LIST const* p);
~CARD_LIST();
private:
explicit CARD_LIST(const CARD_LIST&) {unreachable(); incomplete();}
diff --git a/include/e_ccsrc.h b/include/e_ccsrc.h
index 48b2a9e3..1f269ea0 100644
--- a/include/e_ccsrc.h
+++ b/include/e_ccsrc.h
@@ -35,26 +35,26 @@ protected:
:ELEMENT(p), _input_label(p._input_label), _input(p._input) {}
~CCSRC_BASE() {}
protected: // override virtual
- int max_nodes()const {return 3;}
- int ext_nodes()const {return 4;}
- int min_nodes()const {return 3;}
- int matrix_nodes()const {return 4;}
- int net_nodes()const {return 2;}
- int num_current_ports()const {return 1;}
- const std::string current_port_value(int)const {return _input_label;};
+ int max_nodes()const override {return 3;}
+ int ext_nodes()const override {return 4;}
+ int min_nodes()const override {return 3;}
+ int matrix_nodes()const override {return 4;}
+ int net_nodes()const override {return 2;}
+ int num_current_ports()const override {return 1;}
+ const std::string current_port_value(int)const override {return _input_label;};
//void precalc_first(); //ELEMENT
- void expand_last();
+ void expand_last() override;
//void precalc_last(); //ELEMENT
- bool tr_needs_eval()const {assert(!is_q_for_eval()); return true;}
+ bool tr_needs_eval()const override{assert(!is_q_for_eval()); return true;}
//void tr_queue_eval() //ELEMENT
- void tr_unload() {untested(); tr_unload_active();}
- double tr_involts()const {untested();return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
- double tr_input()const {untested(); return _input->tr_amps();}
- double tr_involts_limited()const {return volts_limited(_n[IN1],_n[IN2]);}
- double tr_input_limited()const {return _input->tr_amps();}
- COMPLEX ac_involts()const {untested();return _n[IN1]->vac()-_n[IN2]->vac();}
- void set_port_by_index(int index, std::string& value);
- bool node_is_connected(int i)const;
+ void tr_unload()override {untested(); tr_unload_active();}
+ double tr_involts()const override {untested();return dn_diff(_n[IN1].v0(), _n[IN2].v0());}
+ double tr_input()const override {untested(); return _input->tr_amps();}
+ double tr_involts_limited()const override{return volts_limited(_n[IN1],_n[IN2]);}
+ double tr_input_limited()const override{return _input->tr_amps();}
+ COMPLEX ac_involts()const override {untested();return _n[IN1]->vac()-_n[IN2]->vac();}
+ void set_port_by_index(int index, std::string& value) override;
+ bool node_is_connected(int i)const override;
public:
void set_parameters_cc(const std::string& Label, CARD* Parent,
COMMON_COMPONENT* Common, double Value,
diff --git a/include/e_compon.h b/include/e_compon.h
index 33c82617..4ad02d2e 100644
--- a/include/e_compon.h
+++ b/include/e_compon.h
@@ -62,8 +62,8 @@ protected:
PARAMETER<double> _temp_c; // actual temperature of device
PARAMETER<double> _mfactor; // number of devices in parallel
PARAMETER<double> _value;
-private:
std::string _modelname;
+private:
mutable const MODEL_CARD* _model;
int _attach_count;
public:
@@ -97,8 +97,8 @@ public:
virtual std::string param_name(int)const;
virtual std::string param_name(int,int)const;
virtual std::string param_value(int)const;
- virtual void set_param_by_name(std::string, std::string);
- void Set_param_by_name(std::string, std::string); //BUG// see implementation
+ virtual int set_param_by_name(std::string, std::string);
+ int Set_param_by_name(std::string, std::string); //BUG// see implementation
virtual void set_param_by_index(int, std::string&, int);
virtual int param_count()const {return 4;}
public:
@@ -126,6 +126,7 @@ public:
const MODEL_CARD* model()const {assert(_model); return _model;}
bool has_model()const {return _model;}
const PARAMETER<double>& mfactor()const {return _mfactor;}
+ void set_value(double v) {_value = v;}
const PARAMETER<double>& value()const {return _value;}
private:
bool parse_param_list(CS&);
@@ -150,7 +151,6 @@ class INTERFACE COMPONENT : public CARD {
private:
COMMON_COMPONENT* _common;
protected:
- PARAMETER<double> _value; // value, for simple parts
PARAMETER<double> _mfactor; // number of devices in parallel
private:
double _mfactor_fixed; // composite, including subckt mfactor
@@ -160,29 +160,30 @@ public:
TIME_PAIR _time_by;
//--------------------------------------------------------------------
protected: // create and destroy.
- explicit COMPONENT();
+ explicit COMPONENT(COMMON_COMPONENT* c=NULL);
explicit COMPONENT(const COMPONENT& p);
~COMPONENT();
//--------------------------------------------------------------------
public: // "elaborate"
- void precalc_first();
- void expand();
- void precalc_last();
+ void precalc_first() override;
+ void expand() override;
+ void precalc_last() override;
+ virtual bool is_valid()const {return true;}
//--------------------------------------------------------------------
public: // dc-tran
- void tr_iwant_matrix();
- void tr_queue_eval();
- TIME_PAIR tr_review();
- void tr_accept();
- double tr_probe_num(const std::string&)const;
+ void tr_iwant_matrix() override;
+ void tr_queue_eval() override;
+ TIME_PAIR tr_review() override;
+ void tr_accept() override;
+ double tr_probe_num(const std::string&)const override;
//--------------------------------------------------------------------
public: // ac
- void ac_iwant_matrix();
+ void ac_iwant_matrix() override;
//--------------------------------------------------------------------
public: // state, aux data
- bool is_device()const {return true;}
- void set_slave();
- void map_nodes();
+ bool is_device()const override {return true;}
+ void set_slave()override;
+ void map_nodes()override;
virtual const std::string current_probe_name()const {untested(); return "";}
static double volts_limited(const node_t& n1, const node_t& n2);
bool converged()const {return _converged;}
@@ -223,11 +224,11 @@ public: // state, aux data
void deflate_common();
//--------------------------------------------------------------------
public: // type
- void set_dev_type(const std::string& new_type);
+ void set_dev_type(const std::string& new_type) override;
//--------------------------------------------------------------------
public: // ports
virtual std::string port_name(int)const = 0;
- virtual void set_port_by_name(std::string& name, std::string& value);
+ virtual int set_port_by_name(std::string& name, std::string& value);
virtual void set_port_by_index(int index, std::string& value);
bool port_exists(int i)const {return i < net_nodes();}
const std::string port_value(int i)const;
@@ -243,7 +244,7 @@ public: // ports
virtual int num_current_ports()const {return 0;}
virtual int tail_size()const {return 0;}
- virtual int net_nodes()const {untested();return 0;} //override
+ int net_nodes()const override {itested();return 0;} //override
virtual int ext_nodes()const {return max_nodes();}
virtual int int_nodes()const {return 0;}
virtual int matrix_nodes()const {return 0;}
@@ -257,31 +258,26 @@ public: // ports
virtual bool node_is_connected(int i)const;
//--------------------------------------------------------------------
public: // parameters
- void set_param_by_name(std::string, std::string);
- void set_param_by_index(int, std::string&, int);
- int param_count()const
+ int set_param_by_name(std::string, std::string) override;
+ void set_param_by_index(int, std::string&, int) override;
+ int param_count()const override
{return ((has_common()) ? (common()->param_count()) : (2 + CARD::param_count()));}
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
virtual void set_parameters(const std::string& Label, CARD* Parent,
COMMON_COMPONENT* Common, double Value,
int state_count, double state[],
int node_count, const node_t nodes[]);
- void set_value(const PARAMETER<double>& v) {_value = v;}
- void set_value(double v) {_value = v;}
- void set_value(const std::string& v) {untested(); _value = v;}
- void set_value(double v, COMMON_COMPONENT* c);
- const PARAMETER<double>& value()const {return _value;}
//--------------------------------------------------------------------
public: // obsolete -- do not use in new code
virtual bool print_type_in_spice()const = 0;
- bool use_obsolete_callback_parse()const;
- bool use_obsolete_callback_print()const;
- void print_args_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
- void obsolete_move_parameters_from_common(const COMMON_COMPONENT*);
+ bool use_obsolete_callback_parse()const override;
+ bool use_obsolete_callback_print()const override;
+ void print_args_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
+ virtual void obsolete_set_value(double) {}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/e_elemnt.h b/include/e_elemnt.h
index 98246246..cbccb735 100644
--- a/include/e_elemnt.h
+++ b/include/e_elemnt.h
@@ -24,32 +24,41 @@
//testing=script 2006.07.12
#ifndef E_ELEMNT_H
#define E_ELEMNT_H
-#include "e_node.h"
+#include "e_logicnode.h"
#include "m_cpoly.h"
#include "l_denoise.h"
#include "e_compon.h"
/*--------------------------------------------------------------------------*/
class INTERFACE ELEMENT : public COMPONENT {
protected:
- explicit ELEMENT();
+ explicit ELEMENT(COMMON_COMPONENT* c=NULL);
explicit ELEMENT(const ELEMENT& p);
~ELEMENT() {}
void store_values() {assert(_y[0]==_y[0]); _y1=_y[0];}
//void reject_values() { _y0 = _y1;}
public:
- double* set__value() {return _value.pointer_hack();}
+ void set_value(const PARAMETER<double>& v) {_value = v;}
+ void set_value(double v) {_value = v;}
+ void set_value(const std::string& v) {itested(); _value = v;}
+ void set_value(double v, COMMON_COMPONENT* c);
+ const PARAMETER<double>& value()const {return _value;}
bool skip_dev_type(CS&);
+public: // obsolete -- do not use in new code
+ void obsolete_move_parameters_from_common(const COMMON_COMPONENT*);
+private: // obsolete -- do not use in new code
+ void obsolete_set_value(double v) final override{set_value(v);}
public: // override virtual
- bool print_type_in_spice()const {return false;}
- void precalc_last();
- void tr_begin();
- void tr_restore();
- void dc_advance();
- void tr_advance();
- void tr_regress();
- bool tr_needs_eval()const {/*assert(!is_q_for_eval());*/ return !is_constant();}
+ bool print_type_in_spice()const override {return false;}
+ void precalc_last() override;
+ void ac_begin() override;
+ void tr_begin() override;
+ void tr_restore() override;
+ void dc_advance() override;
+ void tr_advance() override;
+ void tr_regress() override;
+ bool tr_needs_eval()const override {/*assert(!is_q_for_eval());*/ return !is_constant();}
#if 0
void tr_queue_eval() {
if(tr_needs_eval()) {
@@ -58,13 +67,13 @@ public: // override virtual
}
}
#endif
- TIME_PAIR tr_review();
+ TIME_PAIR tr_review() override;
//void map_nodes();
- void tr_iwant_matrix() = 0;
- void ac_iwant_matrix() = 0;
- double tr_probe_num(const std::string&)const;
- XPROBE ac_probe_ext(const std::string&)const;
+ void tr_iwant_matrix() override = 0;
+ void ac_iwant_matrix() override = 0;
+ double tr_probe_num(const std::string&)const override;
+ XPROBE ac_probe_ext(const std::string&)const override;
protected: // inline, below
double dampdiff(double*, const double&);
@@ -145,8 +154,16 @@ public:
virtual int order()const {return OPT::trsteporder;}
virtual double error_factor()const {return OPT::trstepcoef[OPT::trsteporder];}
- int param_count()const {return (0 + COMPONENT::param_count());}
protected:
+ int param_count()const override {return (1 + COMPONENT::param_count());}
+ int set_param_by_name(std::string, std::string)override;
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+protected:
+ PARAMETER<double> _value; // value, for simple parts
int _loaditer; // load iteration number
private:
node_t _nodes[NODES_PER_BRANCH]; // nodes (0,1:out, 2,3:in)
@@ -217,7 +234,7 @@ inline void ELEMENT::tr_load_shunt()
}
/*--------------------------------------------------------------------------*/
inline void ELEMENT::tr_unload_shunt()
-{untested();
+{itested();
_loss0 = 0.;
_sim->mark_inc_mode_bad();
tr_load_shunt();
@@ -251,7 +268,7 @@ inline void ELEMENT::tr_load_source()
}
/*--------------------------------------------------------------------------*/
inline void ELEMENT::tr_unload_source()
-{untested();
+{
_m0.c0 = _m0.c1 = 0.;
_sim->mark_inc_mode_bad();
tr_load_source();
@@ -444,6 +461,7 @@ inline void ELEMENT::tr_eval()
common()->tr_eval(this);
}else{
// can get here if a simple device has probes
+ // ( or in value sweeps? )
_y[0].f1 = value();
_y[0].f0 = _y[0].x * _y[0].f1;
}
diff --git a/include/e_logicmod.h b/include/e_logicmod.h
new file mode 100644
index 00000000..f64ea7b9
--- /dev/null
+++ b/include/e_logicmod.h
@@ -0,0 +1,74 @@
+/*$Id: e_logicmod.h $ -*- C++ -*-
+ * Copyright (C) 2001 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * data structures and defaults for logic model.
+ */
+//testing=script,sparse 2023.11.22
+#ifndef D_LOGICMOD_H
+#define D_LOGICMOD_H
+#include "e_model.h"
+/*--------------------------------------------------------------------------*/
+class MODEL_LOGIC : public MODEL_CARD {
+private:
+ explicit MODEL_LOGIC(const MODEL_LOGIC& p);
+public:
+ explicit MODEL_LOGIC(const COMPONENT*);
+ ~MODEL_LOGIC() {--_count;}
+private: // override virtuals
+ std::string dev_type()const override{return "logic";}
+ CARD* clone()const override {return new MODEL_LOGIC(*this);}
+ void precalc_first()override;
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (13 + MODEL_CARD::param_count());}
+public:
+ static int count() {untested();return _count;}
+public:
+ /* ----- digital mode ----- */
+ PARAMETER<double> delay; /* propagation delay */
+ /* -- conversion parameters both ways -- */
+ PARAMETER<double> vmax; /* nominal volts for logic 1 */
+ PARAMETER<double> vmin; /* nominal volts for logic 0 */
+ PARAMETER<double> unknown; /* nominal volts for unknown (bogus) */
+ /* ---- D to A conversion ---- */
+ PARAMETER<double> rise; /* rise time (time in slope) */
+ PARAMETER<double> fall; /* fall time (time in slope) */
+ PARAMETER<double> rs; /* series resistance -- strong */
+ PARAMETER<double> rw; /* series resistance -- weak */
+ /* ---- A to D conversion ---- */
+ PARAMETER<double> th1; /* threshold for 1 as fraction of range */
+ PARAMETER<double> th0; /* threshold for 0 as fraction of range */
+ /* ---- quality judgement parameters ---- */
+ PARAMETER<double> mr; /* margin rise - how much worse rise can be */
+ PARAMETER<double> mf; /* margin fall - how much worse fall can be */
+ PARAMETER<double> over; /* overshoot limit - as fraction of range */
+public: // calculated parameters
+ double range; /* vmax - vmin */
+private:
+ static int _count;
+};
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+#endif
+// vim:ts=8:sw=2:noet:
diff --git a/include/e_logicnode.h b/include/e_logicnode.h
new file mode 100644
index 00000000..6cbc347c
--- /dev/null
+++ b/include/e_logicnode.h
@@ -0,0 +1,132 @@
+/*$Id: e_logicnode.h $ -*- C++ -*-
+ * Copyright (C) 2001 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * circuit node class
+ */
+//testing=script,sparse 2006.07.11
+#ifndef E_LOGICNODE_H
+#define E_LOGICNODE_H
+#include "e_logicval.h"
+#include "e_node.h"
+/*--------------------------------------------------------------------------*/
+class MODEL_LOGIC;
+#define qBAD (0)
+#define qGOOD (OPT::transits)
+/*--------------------------------------------------------------------------*/
+class INTERFACE LOGIC_NODE : public NODE {
+private:
+ const MODEL_LOGIC *_family; /* logic family */
+ int _d_iter; /* iteration of last update - digital */
+ int _a_iter; /* iteration of last update - analog */
+ double _final_time; /* time logic transition attains final state */
+ double _lastchange; /* time of last change */
+ double _old_lastchange; /* in case it rejects a step */
+ smode_t _mode; /* simulation mode (analog or digital)*/
+ LOGICVAL _lv; /* "logic value" (real type is LOGICVAL) */
+ LOGICVAL _old_lv; /* in case it rejects a step */
+ int _quality; /* quality of digital mode */
+ std::string _failure_mode;
+
+ // so it is not pure virtual
+ //const std::string long_label()const;
+public: // virtuals
+ double tr_probe_num(const std::string&)const override;
+ //XPROBE ac_probe_ext(const std::string&)const;
+
+public: // raw data access (rvalues)
+ LOGICVAL lv()const {return _lv;}
+ int quality()const {return _quality;}
+ const std::string& failure_mode()const {return _failure_mode;}
+ int d_iter()const {return _d_iter;}
+ int a_iter()const {return _a_iter;}
+ double final_time()const {return _final_time;}
+ double last_change_time()const {return _lastchange;}
+private:
+ const MODEL_LOGIC* process()const {return _family;}
+ double old_last_change_time()const {return _old_lastchange;}
+ const LOGICVAL old_lv()const {return _old_lv;}
+
+public: // simple calculated data access (rvalues)
+ bool lv_future()const {return lv().lv_future();}
+ bool is_unknown()const {return lv().is_unknown();}
+ bool in_transit()const {return final_time() < NEVER;}
+private:
+ bool is_digital()const {return _mode == moDIGITAL;}
+ bool is_analog()const {return _mode == moANALOG;}
+ double annotated_logic_value()const;
+
+private: // calculated data access (rvalues)
+ bool just_reached_stable()const;
+
+private: // raw data access (lvalues)
+ void set_quality(int q) {_quality = q;}
+ void set_failure_mode(const std::string& f) {_failure_mode = f;}
+ void set_final_time(double t) {_final_time = t;}
+
+ void set_d_iter() {_d_iter = _sim->iteration_tag();}
+ void set_last_change_time() {_lastchange = _sim->_time0;}
+ void set_last_change_time(double t) {_lastchange = t;}
+ void set_lv(LOGICVAL v) {_lv = v;}
+ void set_process(const MODEL_LOGIC* f) {_family = f;}
+public:
+ void store_old_last_change_time() {_old_lastchange = last_change_time();}
+ void store_old_lv() {_old_lv = lv();}
+ void set_mode(smode_t m) {_mode = m;}
+
+private: // other internal
+ void set_bad_quality(const std::string& f) {
+ set_quality(qBAD);
+ set_failure_mode(f);
+ }
+ void set_good_quality(const std::string& f = "ok") {
+ set_quality(qGOOD);
+ set_failure_mode(f);
+ }
+ void dont_set_quality(const std::string& f = "don't know") {
+ set_failure_mode(f);
+ }
+ void improve_quality() {
+ if (quality() < qGOOD) {
+ ++_quality;
+ }
+ }
+
+public: // action, used by logic
+ void set_event(double delay, LOGICVAL v);
+ void force_initial_value(LOGICVAL v);
+ void propagate();
+ void unpropagate();
+ double to_analog(const MODEL_LOGIC*f);
+ void to_logic(const MODEL_LOGIC*f);
+
+private: // inhibited
+ explicit LOGIC_NODE(const LOGIC_NODE&):NODE(){incomplete();unreachable();}
+public: // general use
+ explicit LOGIC_NODE();
+ ~LOGIC_NODE() {}
+
+public: // used by matrix
+ LOGIC_NODE& set_a_iter() {_a_iter = _sim->iteration_tag(); return *this;}
+};
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+#endif
+// vim:ts=8:sw=2:noet:
diff --git a/include/e_logicval.h b/include/e_logicval.h
new file mode 100644
index 00000000..a384f182
--- /dev/null
+++ b/include/e_logicval.h
@@ -0,0 +1,78 @@
+/*$Id: e_logicval.h $ -*- C++ -*-
+ * Copyright (C) 2001 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * circuit node class
+ */
+//testing=none
+#ifndef E_LOGICVAL_H
+#define E_LOGICVAL_H
+#include "md.h"
+/*--------------------------------------------------------------------------*/
+enum _LOGICVAL {lvSTABLE0,lvRISING,lvFALLING,lvSTABLE1,lvUNKNOWN};
+enum {lvNUM_STATES = lvUNKNOWN+1};
+/*--------------------------------------------------------------------------*/
+class INTERFACE LOGICVAL {
+private:
+ _LOGICVAL _lv;
+ static const _LOGICVAL or_truth[lvNUM_STATES][lvNUM_STATES];
+ static const _LOGICVAL xor_truth[lvNUM_STATES][lvNUM_STATES];
+ static const _LOGICVAL and_truth[lvNUM_STATES][lvNUM_STATES];
+ static const _LOGICVAL not_truth[lvNUM_STATES];
+ static const _LOGICVAL prop_truth[lvNUM_STATES][lvNUM_STATES];
+public:
+ LOGICVAL() :_lv(lvUNKNOWN) {}
+ LOGICVAL(const LOGICVAL& p) :_lv(p._lv) {}
+ LOGICVAL(_LOGICVAL p) :_lv(p) {}
+ ~LOGICVAL() {}
+
+ operator _LOGICVAL()const {return static_cast<_LOGICVAL>(_lv);}
+
+ LOGICVAL& operator=(_LOGICVAL p) {_lv=p; return *this;}
+ LOGICVAL& operator=(const LOGICVAL& p) {_lv=p._lv; return *this;}
+
+ LOGICVAL& operator&=(LOGICVAL p)
+ {itested(); _lv = and_truth[_lv][p._lv]; return *this;}
+ LOGICVAL& operator|=(LOGICVAL p)
+ {_lv = or_truth[_lv][p._lv]; return *this;}
+ LOGICVAL operator^=(LOGICVAL p)
+ {untested(); _lv = xor_truth[_lv][p._lv]; return *this;}
+ LOGICVAL operator~()const {return not_truth[_lv];}
+
+ bool is_unknown()const {return _lv == lvUNKNOWN;}
+ bool lv_future()const {assert(_lv!=lvUNKNOWN); return _lv & 1;}
+ bool lv_old()const {assert(_lv!=lvUNKNOWN); return _lv & 2;}
+
+ bool is_rising() const {return _lv == lvRISING;}
+ bool is_falling()const {return _lv == lvFALLING;}
+
+ LOGICVAL& set_in_transition(LOGICVAL newval);
+};
+/*--------------------------------------------------------------------------*/
+inline LOGICVAL& LOGICVAL::set_in_transition(LOGICVAL newval)
+{
+ _lv = prop_truth[_lv][newval];
+ assert(_lv != lvUNKNOWN);
+ return *this;
+}
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+#endif
+// vim:ts=8:sw=2:noet:
diff --git a/include/e_model.h b/include/e_model.h
index a93a336e..4209df6f 100644
--- a/include/e_model.h
+++ b/include/e_model.h
@@ -51,16 +51,16 @@ public:
~MODEL_CARD();
public: // override virtuals
- char id_letter()const {untested();return '\0';}
- CARD* clone_instance()const {return (_component_proto) ? _component_proto->clone() : NULL;}
- void precalc_first();
- void set_param_by_index(int, std::string&, int);
- bool param_is_printable(int)const;
- std::string value_name()const {untested();return "";}
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const {return (1 + CARD::param_count());}
+ char id_letter()const override {untested();return '\0';}
+ CARD* clone_instance()const override {return (_component_proto) ? _component_proto->clone() : NULL;}
+ void precalc_first()override;
+ void set_param_by_index(int, std::string&, int)override;
+ bool param_is_printable(int)const override;
+ std::string value_name()const override {untested();return "";}
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override {return (1 + CARD::param_count());}
public:
virtual void tr_eval(COMPONENT*)const{unreachable();}
virtual void ac_eval(COMPONENT*)const{unreachable();}
diff --git a/include/e_node.h b/include/e_node.h
index 6be78563..39eaae60 100644
--- a/include/e_node.h
+++ b/include/e_node.h
@@ -27,8 +27,6 @@
#include "u_sim_data.h"
#include "e_base.h"
/*--------------------------------------------------------------------------*/
-class MODEL_LOGIC;
-/*--------------------------------------------------------------------------*/
enum {
OUT1 = 0,
OUT2 = 1,
@@ -37,47 +35,6 @@ enum {
NODES_PER_BRANCH = 4,
INVALID_NODE = -1
};
-#define qBAD (0)
-#define qGOOD (OPT::transits)
-/*--------------------------------------------------------------------------*/
-enum _LOGICVAL {lvSTABLE0,lvRISING,lvFALLING,lvSTABLE1,lvUNKNOWN};
-enum {lvNUM_STATES = lvUNKNOWN+1};
-/*--------------------------------------------------------------------------*/
-class INTERFACE LOGICVAL {
-private:
- _LOGICVAL _lv;
- static const _LOGICVAL or_truth[lvNUM_STATES][lvNUM_STATES];
- static const _LOGICVAL xor_truth[lvNUM_STATES][lvNUM_STATES];
- static const _LOGICVAL and_truth[lvNUM_STATES][lvNUM_STATES];
- static const _LOGICVAL not_truth[lvNUM_STATES];
-public:
- LOGICVAL() :_lv(lvUNKNOWN) {}
- LOGICVAL(const LOGICVAL& p) :_lv(p._lv) {}
- LOGICVAL(_LOGICVAL p) :_lv(p) {}
- ~LOGICVAL() {}
-
- operator _LOGICVAL()const {return static_cast<_LOGICVAL>(_lv);}
-
- LOGICVAL& operator=(_LOGICVAL p) {_lv=p; return *this;}
- LOGICVAL& operator=(const LOGICVAL& p) {_lv=p._lv; return *this;}
-
- LOGICVAL& operator&=(LOGICVAL p)
- {untested(); _lv = and_truth[_lv][p._lv]; return *this;}
- LOGICVAL& operator|=(LOGICVAL p)
- {_lv = or_truth[_lv][p._lv]; return *this;}
- LOGICVAL operator^=(LOGICVAL p)
- {untested(); _lv = xor_truth[_lv][p._lv]; return *this;}
- LOGICVAL operator~()const {return not_truth[_lv];}
-
- bool is_unknown()const {return _lv == lvUNKNOWN;}
- bool lv_future()const {assert(_lv!=lvUNKNOWN); return _lv & 1;}
- bool lv_old()const {assert(_lv!=lvUNKNOWN); return _lv & 2;}
-
- bool is_rising() const {return _lv == lvRISING;}
- bool is_falling()const {return _lv == lvFALLING;}
-
- LOGICVAL& set_in_transition(LOGICVAL newval);
-};
/*--------------------------------------------------------------------------*/
class NODE : public CKT_BASE {
private:
@@ -104,8 +61,8 @@ public: // maniputation
//NODE& set_flat_number(int n) {itested();_flat_number = n; return *this;}
//NODE& set_matrix_number(int n){untested();_matrix_number = n;return *this;}
public: // virtuals
- double tr_probe_num(const std::string&)const;
- XPROBE ac_probe_ext(const std::string&)const;
+ double tr_probe_num(const std::string&)const override;
+ XPROBE ac_probe_ext(const std::string&)const override;
double v0()const {
assert(m_() >= 0);
@@ -133,100 +90,6 @@ public: // virtuals
};
extern NODE ground_node;
/*--------------------------------------------------------------------------*/
-class INTERFACE LOGIC_NODE : public NODE {
-private:
- const MODEL_LOGIC *_family; /* logic family */
- int _d_iter; /* iteration of last update - digital */
- int _a_iter; /* iteration of last update - analog */
- double _final_time; /* time logic transition attains final state */
- double _lastchange; /* time of last change */
- double _old_lastchange; /* in case it rejects a step */
- smode_t _mode; /* simulation mode (analog or digital)*/
- LOGICVAL _lv; /* "logic value" (real type is LOGICVAL) */
- LOGICVAL _old_lv; /* in case it rejects a step */
- int _quality; /* quality of digital mode */
- std::string _failure_mode;
-
- // so it is not pure virtual
- //const std::string long_label()const;
-public: // virtuals
- double tr_probe_num(const std::string&)const;
- //XPROBE ac_probe_ext(const std::string&)const;
-
-public: // raw data access (rvalues)
- LOGICVAL lv()const {return _lv;}
- int quality()const {return _quality;}
- const std::string& failure_mode()const {return _failure_mode;}
- int d_iter()const {return _d_iter;}
- int a_iter()const {return _a_iter;}
- double final_time()const {return _final_time;}
- double last_change_time()const {return _lastchange;}
- const MODEL_LOGIC* process()const {return _family;}
- double old_last_change_time()const {return _old_lastchange;}
- const LOGICVAL old_lv()const {return _old_lv;}
-
-public: // simple calculated data access (rvalues)
- bool lv_future()const {return lv().lv_future();}
- bool is_unknown()const {return lv().is_unknown();}
- bool in_transit()const {return final_time() < NEVER;}
- bool is_digital()const {return _mode == moDIGITAL;}
- bool is_analog()const {return _mode == moANALOG;}
- double annotated_logic_value()const;
-
-public: // calculated data access (rvalues)
- bool just_reached_stable()const;
-
-public: // raw data access (lvalues)
- void set_quality(int q) {_quality = q;}
- void set_failure_mode(const std::string& f) {_failure_mode = f;}
- void set_final_time(double t) {_final_time = t;}
-
- void set_d_iter() {_d_iter = _sim->iteration_tag();}
- void set_last_change_time() {_lastchange = _sim->_time0;}
- void set_last_change_time(double t) {_lastchange = t;}
- void set_lv(LOGICVAL v) {_lv = v;}
- void set_process(const MODEL_LOGIC* f) {_family = f;}
-
- void store_old_last_change_time() {_old_lastchange = last_change_time();}
- void store_old_lv() {_old_lv = lv();}
- void set_mode(smode_t m) {_mode = m;}
-
-public: // other internal
- void set_bad_quality(const std::string& f) {
- set_quality(qBAD);
- set_failure_mode(f);
- }
- void set_good_quality(const std::string& f = "ok") {
- set_quality(qGOOD);
- set_failure_mode(f);
- }
- void dont_set_quality(const std::string& f = "don't know") {
- set_failure_mode(f);
- }
- void improve_quality() {
- if (quality() < qGOOD) {
- ++_quality;
- }
- }
-
-public: // action, used by logic
- void set_event(double delay, LOGICVAL v);
- void force_initial_value(LOGICVAL v);
- void propagate();
- void unpropagate();
- double to_analog(const MODEL_LOGIC*f);
- void to_logic(const MODEL_LOGIC*f);
-
-private: // inhibited
- explicit LOGIC_NODE(const LOGIC_NODE&):NODE(){incomplete();unreachable();}
-public: // general use
- explicit LOGIC_NODE();
- ~LOGIC_NODE() {}
-
-public: // matrix
- LOGIC_NODE& set_a_iter() {_a_iter = _sim->iteration_tag(); return *this;}
-};
-/*--------------------------------------------------------------------------*/
class INTERFACE node_t {
private:
static bool node_is_valid(int i) {
@@ -337,8 +200,6 @@ public:
#endif
};
/*--------------------------------------------------------------------------*/
-INTERFACE double volts_limited(const node_t& n1, const node_t& n2);
-/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
#endif
// vim:ts=8:sw=2:noet:
diff --git a/include/e_paramlist.h b/include/e_paramlist.h
index eb0e5f30..743d19d8 100644
--- a/include/e_paramlist.h
+++ b/include/e_paramlist.h
@@ -34,21 +34,21 @@ private:
public:
explicit COMMON_PARAMLIST(int c=0) :COMMON_COMPONENT(c) {++_count;}
~COMMON_PARAMLIST() {--_count;}
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new COMMON_PARAMLIST(*this);}
- std::string name()const {untested();return "";}
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override{return new COMMON_PARAMLIST(*this);}
+ std::string name()const override {untested();return "";}
static int count() {untested();return _count;}
- void set_param_by_name(std::string Name, std::string Value) {_params.set(Name, Value);}
- bool param_is_printable(int)const;
- std::string param_name(int)const;
- std::string param_name(int,int)const;
- std::string param_value(int)const;
- int param_count()const
+ int set_param_by_name(std::string Name, std::string Value) override {_params.set(Name, Value); return 0;}
+ bool param_is_printable(int)const override;
+ std::string param_name(int)const override;
+ std::string param_name(int,int)const override;
+ std::string param_value(int)const override;
+ int param_count()const override
{return (static_cast<int>(_params.size()) + COMMON_COMPONENT::param_count());}
- void precalc_first(const CARD_LIST*);
- void precalc_last(const CARD_LIST*);
+ void precalc_first(const CARD_LIST*) override;
+ void precalc_last(const CARD_LIST*) override;
private:
static int _count;
public:
diff --git a/include/e_storag.h b/include/e_storag.h
index 9dc9c233..032fb70b 100644
--- a/include/e_storag.h
+++ b/include/e_storag.h
@@ -34,34 +34,34 @@ INTERFACE FPOLY1 differentiate(const FPOLY1* q, const FPOLY1* i, double* time,
class INTERFACE STORAGE : public ELEMENT {
private:
protected:
- explicit STORAGE()
- :ELEMENT(), _method_u(meUNKNOWN), _method_a(mTRAPGEAR) {}
+ explicit STORAGE(COMMON_COMPONENT* c=NULL)
+ :ELEMENT(c), _method_u(meUNKNOWN), _method_a(mTRAPGEAR) {}
explicit STORAGE(const STORAGE& p)
:ELEMENT(p), _method_u(p._method_u), _method_a(p._method_a) {}
~STORAGE() {}
public: // override virtual
//void precalc_first(); //ELEMENT
//void expand(); //COMPONENT
- void precalc_last();
- void tr_begin();
- void tr_restore();
- void dc_advance();
- void tr_advance();
+ void precalc_last() override;
+ void tr_begin() override;
+ void tr_restore() override;
+ void dc_advance() override;
+ void tr_advance() override;
//void tr_regress(); //ELEMENT
- bool tr_needs_eval()const;
+ bool tr_needs_eval()const override;
//void tr_queue_eval() //ELEMENT
- TIME_PAIR tr_review();
- double tr_probe_num(const std::string&)const;
+ TIME_PAIR tr_review() override;
+ double tr_probe_num(const std::string&)const override;
public:
double tr_c_to_g(double c, double g)const;
private:
- int order()const {
+ int order()const override {
const int o[] = {1, 1, 2, 1, 1};
int ord = o[_method_a];
assert(ord < OPT::_keep_time_steps);
return ord;
}
- double error_factor()const {
+ double error_factor()const override {
const double f[]={1./2., 1./2., 1./12., 1./6., 1./2.};
return f[_method_a];
}
diff --git a/include/e_subckt.h b/include/e_subckt.h
index 9541bdf8..8d7bc0bd 100644
--- a/include/e_subckt.h
+++ b/include/e_subckt.h
@@ -28,42 +28,42 @@
/*--------------------------------------------------------------------------*/
class BASE_SUBCKT : public COMPONENT {
protected:
- explicit BASE_SUBCKT()
- :COMPONENT() {}
+ explicit BASE_SUBCKT(COMMON_COMPONENT* c=NULL)
+ :COMPONENT(c) {}
explicit BASE_SUBCKT(const BASE_SUBCKT& p)
:COMPONENT(p) {}
~BASE_SUBCKT() {}
protected: // override virtual
//char id_letter()const //CARD/null
- std::string dev_type()const {assert(common()); return common()->modelname();}
- int tail_size()const {return 1;}
+ std::string dev_type()const override{assert(common()); return common()->modelname();}
+ int tail_size()const override {return 1;}
//int max_nodes()const //COMPONENT/null
//int num_nodes()const //COMPONENT/null
//int min_nodes()const //COMPONENT/null
- int matrix_nodes()const {return 0;}
- int net_nodes()const {return _net_nodes;}
+ int matrix_nodes()const override {return 0;}
+ int net_nodes()const override {return _net_nodes;}
//CARD* clone()const //CARD/null
//void precalc_first() {assert(subckt()); subckt()->precalc();}
//void expand() //COMPONENT
//void precalc_last() {assert(subckt()); subckt()->precalc();}
//void map_nodes();
- void tr_begin() {assert(subckt()); subckt()->tr_begin();}
- void tr_restore() {assert(subckt()); subckt()->tr_restore();}
- void dc_advance() {assert(subckt()); subckt()->dc_advance();}
- void tr_advance() {assert(subckt()); subckt()->tr_advance();}
- void tr_regress() {assert(subckt()); subckt()->tr_regress();}
- bool tr_needs_eval()const
+ void tr_begin()override {assert(subckt()); subckt()->tr_begin();}
+ void tr_restore()override {assert(subckt()); subckt()->tr_restore();}
+ void dc_advance()override {assert(subckt()); subckt()->dc_advance();}
+ void tr_advance()override {assert(subckt()); subckt()->tr_advance();}
+ void tr_regress()override {assert(subckt()); subckt()->tr_regress();}
+ bool tr_needs_eval()const override
{assert(subckt()); return subckt()->tr_needs_eval();}
- void tr_queue_eval() {assert(subckt()); subckt()->tr_queue_eval();}
- bool do_tr()
+ void tr_queue_eval()override {assert(subckt()); subckt()->tr_queue_eval();}
+ bool do_tr()override
{assert(subckt());set_converged(subckt()->do_tr());return converged();}
- void tr_load() {assert(subckt()); subckt()->tr_load();}
- TIME_PAIR tr_review() {assert(subckt()); return _time_by = subckt()->tr_review();}
- void tr_accept() {assert(subckt()); subckt()->tr_accept();}
- void tr_unload() {assert(subckt()); subckt()->tr_unload();}
- void ac_begin() {assert(subckt()); subckt()->ac_begin();}
- void do_ac() {assert(subckt()); subckt()->do_ac();}
- void ac_load() {assert(subckt()); subckt()->ac_load();}
+ void tr_load()override {assert(subckt()); subckt()->tr_load();}
+ TIME_PAIR tr_review()override {assert(subckt()); return _time_by = subckt()->tr_review();}
+ void tr_accept()override {assert(subckt()); subckt()->tr_accept();}
+ void tr_unload()override {assert(subckt()); subckt()->tr_unload();}
+ void ac_begin()override {assert(subckt()); subckt()->ac_begin();}
+ void do_ac()override {assert(subckt()); subckt()->do_ac();}
+ void ac_load()override {assert(subckt()); subckt()->ac_load();}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/io_dir.h b/include/io_dir.h
new file mode 100644
index 00000000..3c4a3a66
--- /dev/null
+++ b/include/io_dir.h
@@ -0,0 +1,80 @@
+/* -*- C++ -*-
+ * Copyright (C) 2023 Felix Salfelder
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ */
+//testing=script 2023.12.02
+#ifndef IO_DIR_H
+#define IO_DIR_H
+#include "l_lib.h"
+/*--------------------------------------------------------------------------*/
+class DIRECTORY {
+private:
+ ::DIR* _d;
+
+public:
+ class const_iterator {
+ ::DIR* _d;
+ ::dirent* _de;
+ friend class DIRECTORY;
+ private:
+ const_iterator(const_iterator const& o) : _d(o._d), _de(o._de) {untested();}
+ const_iterator(::DIR* d) : _d(d) {
+ if(d) {
+ _de = ::readdir(d);
+ }else{
+ _de = NULL;
+ }
+ }
+ public:
+ explicit const_iterator() : _d(NULL), _de(NULL) {}
+ ~const_iterator() {}
+ public:
+ ::dirent const* operator->() {return _de;}
+ const_iterator& operator++() {assert(_d); _de = ::readdir(_d); return *this;}
+ bool operator==(const_iterator const& o)const {return _de == o._de;}
+ bool operator!=(const_iterator const& o)const {return !operator==(o);}
+ const_iterator& operator=(const_iterator const& o) {
+ _d = o._d;
+ _de = o._de;
+ return *this;
+ }
+ };
+
+public:
+ DIRECTORY() = delete;
+ DIRECTORY(const DIRECTORY&) = delete;
+ explicit DIRECTORY(const std::string& s) : _d(::opendir(s.c_str())) {}
+ ~DIRECTORY() {
+ if(_d) {
+ ::closedir(_d);
+ //delete(_d); // done by closedir?
+ _d = NULL;
+ }else{
+ }
+ }
+ void rewinddir()const {::rewinddir(_d);}
+ bool exists()const {return _d;}
+ const_iterator begin()const {rewinddir(); return const_iterator(_d);}
+ const_iterator end()const {return const_iterator(NULL);}
+};
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+#endif
+// vim:ts=8:sw=2:noet:
diff --git a/include/io_error.h b/include/io_error.h
index a2a78d61..b0bc75e7 100644
--- a/include/io_error.h
+++ b/include/io_error.h
@@ -52,7 +52,7 @@ class CS;
struct INTERFACE Exception_CS :public Exception {
std::string _cmd;
size_t _cursor;
- const std::string message()const;
+ const std::string message() const override;
//Exception_CS(const std::string& Message, const CS& cmd, size_t cursor);
Exception_CS(const std::string& Message, const CS& cmd);
};
diff --git a/include/l_dispatcher.h b/include/l_dispatcher.h
index 48833c46..2d5190bc 100644
--- a/include/l_dispatcher.h
+++ b/include/l_dispatcher.h
@@ -44,6 +44,9 @@ public:
const_iterator begin()const {assert(_map); return _map->begin();}
const_iterator end()const {assert(_map); return _map->end();}
+ bool empty()const {
+ return !_map || _map->empty();
+ }
public:
CKT_BASE* operator[](std::string s);
private:
diff --git a/include/l_indirect.h b/include/l_indirect.h
new file mode 100644
index 00000000..30607d34
--- /dev/null
+++ b/include/l_indirect.h
@@ -0,0 +1,73 @@
+/*$Id: l_indirect.h $ -*- C++ -*-
+ * Copyright (C) 2023 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * indirect storage of data
+ */
+//testing=script 2023.10.25
+#ifndef L_INDIRECT_H
+#define L_INDIRECT_H
+#include "md.h"
+/*--------------------------------------------------------------------------*/
+template <class T>
+class INDIRECT {
+ private:
+ std::map<const void*, T> _map;
+ INDIRECT(const INDIRECT&) = delete;
+ public:
+ INDIRECT() : _map() {_map[NULL];}
+ ~INDIRECT() {}
+
+ size_t count(const void* x)const {return _map.count(x);}
+
+ T& operator[](const void* x) {
+ if (!x) {untested();
+ // null tag, not allowed here
+ }else if (_map.count(x) == 0) {
+ // first use of this tag
+ }else{
+ // repeat, adding or replacing
+ // possible collision
+ }
+ assert(x);
+ return _map[x];
+ }
+ const T& at(const void* x)const {
+ if (!x) {untested();
+ return _map.at(NULL);
+ }else if (_map.count(x) == 0) {
+ return _map.at(NULL);
+ }else{
+ return _map.at(x);
+ }
+ }
+ size_t erase(void* b, void* e) {
+ size_t c=0;
+ assert(b <= e);
+ for (void* i=b; i<=e; i=reinterpret_cast<bool*>(i)+1) {
+ c += _map.erase(i);
+ }
+ return c;
+ }
+};
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+#endif
+// vim:ts=8:sw=2:noet:
diff --git a/include/l_lib.h b/include/l_lib.h
index 041b268f..2a8cd39f 100644
--- a/include/l_lib.h
+++ b/include/l_lib.h
@@ -40,7 +40,7 @@ enum { /* formatting bit-fields */
ftos_FILL = 4 /* fill in trailing zeros */
};
/*--------------------------------------------------------------------------*/
-// wrappers for old standard C lpbrary
+// wrappers for old standard C library
namespace OS {
inline void system(const std::string& s) {itested();
::system(s.c_str());
diff --git a/include/m_base.h b/include/m_base.h
index c1dc3a7f..f3774f05 100644
--- a/include/m_base.h
+++ b/include/m_base.h
@@ -84,12 +84,18 @@ public:
virtual Base* r_divide(const Base*)const {untested(); return NULL;}
virtual Base* r_divide(const Float*)const {untested(); return NULL;}
virtual Base* r_divide(const String*)const {untested(); return NULL;}
+ virtual Base* modulo(const Base*)const {untested(); return NULL;}
+ virtual Base* modulo(const Float*)const {untested(); return NULL;}
+ virtual Base* modulo(const String*)const {untested(); return NULL;}
+ virtual Base* r_modulo(const Base*)const {untested(); return NULL;}
+ virtual Base* r_modulo(const Float*)const {untested(); return NULL;}
+ virtual Base* r_modulo(const String*)const {untested(); return NULL;}
Base* logic_not()const;
Base* logic_or(const Base* X)const;
Base* logic_and(const Base* X)const;
};
-inline CS& operator>>(CS& f, Base& b) {untested();b.parse(f); return f;}
+inline CS& operator>>(CS& f, Base& b) {itested();b.parse(f); return f;}
inline std::ostream& operator<<(std::ostream& out, const Base& d)
{d.dump(out); return out;}
/*--------------------------------------------------------------------------*/
@@ -100,9 +106,9 @@ class List_Base
private:
std::list<T*> _list;
public:
- virtual void parse(CS& f) = 0;
+ virtual void parse(CS& f) override = 0;
protected:
- virtual void dump(std::ostream& o)const;
+ virtual void dump(std::ostream& o)const override;
virtual ~List_Base();
explicit List_Base() {}
explicit List_Base(const List_Base& p) : Base(), _list(p._list) {untested();}
@@ -117,6 +123,10 @@ public:
T* back() {assert(!is_empty()); return _list.back();}
void push_back(T* x) {assert(x); _list.push_back(x);}
void pop_back() {assert(!is_empty()); _list.pop_back();}
+ const_iterator erase(const_iterator i) { itested();
+ delete *i;
+ return _list.erase(i);
+ }
};
/*--------------------------------------------------------------------------*/
template <class T>
@@ -126,7 +136,7 @@ class List
protected:
explicit List() {untested();}
public:
- void parse(CS& f);
+ void parse(CS& f) override;
};
/*--------------------------------------------------------------------------*/
#if 0
@@ -146,7 +156,7 @@ class Float
{
private:
double _data;
- void dump(std::ostream& o)const {itested();
+ void dump(std::ostream& o)const override {itested();
if (_data==NOT_INPUT) {untested();
o<<"NA";
}else{itested();
@@ -154,57 +164,63 @@ private:
}
}
public:
- /*implicit*/ Float(const Float& p) :Base(), _data(p._data) {untested();}
+ /*implicit*/ Float(const Float& p) :Base(), _data(p._data) {}
explicit Float(CS& file) {untested();parse(file);}
explicit Float(const std::string& s) {CS cs(CS::_STRING, s); parse(cs);}
Float(double x=NOT_INPUT) :_data(x) {}
- void parse(CS&);
+ void parse(CS&) override;
double value()const {return _data;}
operator double()const {untested();return _data;}
- std::string val_string()const {return ftos(_data, 0, 15, ftos_EXP);}
- bool to_bool()const {return (_data != 0);}
+ std::string val_string()const override{return ftos(_data, 0, 15, ftos_EXP);}
+ bool to_bool()const override {return (_data != 0.);}
- Base* minus()const {return new Float(-_data);}
- Base* plus()const {return new Float(_data);}
+ Base* minus()const override {return new Float(-_data);}
+ Base* plus()const override {return new Float(_data);}
- Base* less(const Float* X)const {assert(X); return new Float((_data < X->_data)?1.:0.);}
- Base* greater(const Float* X)const {assert(X); return new Float((_data > X->_data)?1.:0.);}
- Base* leq(const Float* X)const {assert(X); return new Float((_data <= X->_data)?1.:0.);}
- Base* geq(const Float* X)const {assert(X); return new Float((_data >= X->_data)?1.:0.);}
- Base* not_equal(const Float* X)const {assert(X); return new Float((_data != X->_data)?1.:0.);}
- Base* equal(const Float* X)const {assert(X); return new Float((_data == X->_data)?1.:0.);}
- Base* add(const Float* X)const {assert(X); return new Float(_data + X->_data);}
- Base* multiply(const Float* X)const {assert(X); return new Float(_data * X->_data);}
- Base* subtract(const Float* X)const {untested();assert(X); return new Float(_data - X->_data);}
- Base* r_subtract(const Float* X)const {assert(X); return new Float(X->_data - _data);}
- Base* divide(const Float* X)const {untested();assert(X); return new Float(_data / X->_data);}
- Base* r_divide(const Float* X)const {assert(X); return new Float(X->_data / _data);}
+ Base* less(const Float* X)const override {assert(X); return new Float((_data < X->_data)?1.:0.);}
+ Base* greater(const Float* X)const override {assert(X); return new Float((_data > X->_data)?1.:0.);}
+ Base* leq(const Float* X)const override {assert(X); return new Float((_data <= X->_data)?1.:0.);}
+ Base* geq(const Float* X)const override {assert(X); return new Float((_data >= X->_data)?1.:0.);}
+ Base* not_equal(const Float* X)const override {assert(X); return new Float((_data != X->_data)?1.:0.);}
+ Base* equal(const Float* X)const override {assert(X); return new Float((_data == X->_data)?1.:0.);}
+ Base* add(const Float* X)const override {assert(X); return new Float(_data + X->_data);}
+ Base* multiply(const Float* X)const override {assert(X); return new Float(_data * X->_data);}
+ Base* subtract(const Float* X)const override {untested();assert(X); return new Float(_data - X->_data);}
+ Base* r_subtract(const Float* X)const override{assert(X); return new Float(X->_data - _data);}
+ Base* divide(const Float* X)const override {untested();assert(X); return new Float(_data / X->_data);}
+ Base* r_divide(const Float* X)const override {assert(X); return new Float(X->_data / _data);}
+ Base* modulo(const Float* X)const override {untested();assert(X); return new Float(fmod(_data, X->_data));}
+ Base* r_modulo(const Float* X)const override { assert(X); return new Float(fmod(X->_data, _data));}
- Base* less(const Base* X)const {return ((X) ? (X->greater(this)) : (NULL));}
- Base* greater(const Base* X)const {return ((X) ? (X->less(this)) : (NULL));}
- Base* leq(const Base* X)const {return ((X) ? (X->geq(this)) : (NULL));}
- Base* geq(const Base* X)const {return ((X) ? (X->leq(this)) : (NULL));}
- Base* not_equal(const Base* X)const {return ((X) ? (X->not_equal(this)) : (NULL));}
- Base* equal(const Base* X)const {return ((X) ? (X->equal(this)) : (NULL));}
- Base* add(const Base* X)const {return ((X) ? (X->add(this)) : (NULL));}
- Base* multiply(const Base* X)const {return ((X) ? (X->multiply(this)) : (NULL));}
- Base* subtract(const Base* X)const {return ((X) ? (X->r_subtract(this)): (NULL));}
- Base* r_subtract(const Base* X)const {untested();return ((X) ? (X->subtract(this)) : (NULL));}
- Base* divide(const Base* X)const {return ((X) ? (X->r_divide(this)) : (NULL));}
- Base* r_divide(const Base* X)const {untested();return ((X) ? (X->divide(this)) : (NULL));}
+ Base* less(const Base* X)const override {return ((X) ? (X->greater(this)) : (NULL));}
+ Base* greater(const Base* X)const override {return ((X) ? (X->less(this)) : (NULL));}
+ Base* leq(const Base* X)const override {return ((X) ? (X->geq(this)) : (NULL));}
+ Base* geq(const Base* X)const override {return ((X) ? (X->leq(this)) : (NULL));}
+ Base* not_equal(const Base* X)const override {return ((X) ? (X->not_equal(this)) : (NULL));}
+ Base* equal(const Base* X)const override {return ((X) ? (X->equal(this)) : (NULL));}
+ Base* add(const Base* X)const override {return ((X) ? (X->add(this)) : (NULL));}
+ Base* multiply(const Base* X)const override {return ((X) ? (X->multiply(this)) : (NULL));}
+ Base* subtract(const Base* X)const override {return ((X) ? (X->r_subtract(this)): (NULL));}
+ Base* r_subtract(const Base* X)const override {untested();return ((X) ? (X->subtract(this)) : (NULL));}
+ Base* divide(const Base* X)const override {return ((X) ? (X->r_divide(this)) : (NULL));}
+ Base* r_divide(const Base* X)const override {untested();return ((X) ? (X->divide(this)) : (NULL));}
+ Base* modulo(const Base* X)const override {return ((X) ? (X->r_modulo(this)) : (NULL));}
+ Base* r_modulo(const Base* X)const override {untested();return ((X) ? (X->modulo(this)) : (NULL));}
- Base* less(const String*)const {untested();return NULL;}
- Base* greater(const String*)const {untested();return NULL;}
- Base* leq(const String*)const {untested();return NULL;}
- Base* geq(const String*)const {untested();return NULL;}
- Base* not_equal(const String*)const {untested();return NULL;}
- Base* equal(const String*)const {untested();return NULL;}
- Base* add(const String*)const { return NULL;}
- Base* multiply(const String*)const {untested();return NULL;}
- Base* subtract(const String*)const {untested();return NULL;}
- Base* r_subtract(const String*)const {untested();return NULL;}
- Base* divide(const String*)const {untested();return NULL;}
- Base* r_divide(const String*)const { return NULL;}
+ Base* less(const String*)const override {untested();return NULL;}
+ Base* greater(const String*)const override {untested();return NULL;}
+ Base* leq(const String*)const override {untested();return NULL;}
+ Base* geq(const String*)const override {untested();return NULL;}
+ Base* not_equal(const String*)const override {return NULL;}
+ Base* equal(const String*)const override {return NULL;}
+ Base* add(const String*)const override { return NULL;}
+ Base* multiply(const String*)const override {untested();return NULL;}
+ Base* subtract(const String*)const override {untested();return NULL;}
+ Base* r_subtract(const String*)const override { return NULL;}
+ Base* divide(const String*)const override {untested();return NULL;}
+ Base* r_divide(const String*)const override { return NULL;}
+ Base* modulo(const String*)const override {untested();return NULL;}
+ Base* r_modulo(const String*)const override {untested();return NULL;}
bool is_NA()const {untested();return _data == NOT_INPUT;}
};
@@ -215,85 +231,102 @@ class String
protected:
std::string _data;
public:
- void parse(CS&) {unreachable(); incomplete();}
+ void parse(CS&) override {unreachable(); incomplete();}
private:
- void dump(std::ostream& o)const {untested();o << _data;}
+ void dump(std::ostream& o)const override {o << _data;}
public:
explicit String(CS& file) {untested();parse(file);}
explicit String() {}
explicit String(const std::string& s) :_data(s) {}
+ explicit String(const String& s) : Base(), _data(s._data) {}
operator const std::string&()const {return _data;}
- std::string val_string()const {untested();return _data;}
- bool to_bool()const {untested();return (_data != "");}
+ std::string val_string()const override {return _data;}
+ bool to_bool()const override {untested();return (_data != "");}
- Base* minus()const {untested(); return NULL;}
- Base* plus()const {untested(); return NULL;}
+ Base* minus()const override {untested(); return NULL;}
+ Base* plus()const override {untested(); return NULL;}
- Base* less(const String* X)const {untested();assert(X); return new Float((_data < X->_data)?1.:0.);}
- Base* greater(const String* X)const {untested();assert(X); return new Float((_data > X->_data)?1.:0.);}
- Base* leq(const String* X)const {untested();assert(X); return new Float((_data <= X->_data)?1.:0.);}
- Base* geq(const String* X)const {untested();assert(X); return new Float((_data >= X->_data)?1.:0.);}
- Base* not_equal(const String* X)const {untested();assert(X); return new Float((_data != X->_data)?1.:0.);}
- Base* equal(const String* X)const {untested();assert(X); return new Float((_data == X->_data)?1.:0.);}
- Base* add(const String*)const { return NULL;}
- Base* multiply(const String*)const {untested(); return NULL;}
- Base* subtract(const String*)const {untested(); return NULL;}
- Base* r_subtract(const String*)const {untested(); return NULL;}
- Base* divide(const String*)const {untested(); return NULL;}
- Base* r_divide(const String*)const {untested(); return NULL;}
+ Base* less(const String* X)const override {untested();assert(X); return new Float((_data < X->_data)?1.:0.);}
+ Base* greater(const String* X)const override {untested();assert(X); return new Float((_data > X->_data)?1.:0.);}
+ Base* leq(const String* X)const override {untested();assert(X); return new Float((_data <= X->_data)?1.:0.);}
+ Base* geq(const String* X)const override {untested();assert(X); return new Float((_data >= X->_data)?1.:0.);}
+ Base* not_equal(const String* X)const override{untested();assert(X); return new Float((_data != X->_data)?1.:0.);}
+ Base* equal(const String* X)const override {assert(X); return new Float((_data == X->_data)?1.:0.);}
+ Base* add(const String*)const override { return NULL;}
+ Base* multiply(const String*)const override { return NULL;}
+ Base* subtract(const String*)const override {untested(); return NULL;}
+ Base* r_subtract(const String*)const override {itested(); return NULL;}
+ Base* divide(const String*)const override {untested(); return NULL;}
+ Base* r_divide(const String*)const override {itested(); return NULL;}
+ Base* modulo(const String*)const override {untested(); return NULL;}
+ Base* r_modulo(const String*)const override {untested(); return NULL;}
- Base* less(const Base* X)const {untested();return ((X) ? (X->greater(this)) : (NULL));}
- Base* greater(const Base* X)const {untested();return ((X) ? (X->less(this)) : (NULL));}
- Base* leq(const Base* X)const {untested();return ((X) ? (X->geq(this)) : (NULL));}
- Base* geq(const Base* X)const {untested();return ((X) ? (X->leq(this)) : (NULL));}
- Base* not_equal(const Base* X)const {untested();return ((X) ? (X->not_equal(this)) : (NULL));}
- Base* equal(const Base* X)const {untested();return ((X) ? (X->equal(this)) : (NULL));}
- Base* add(const Base* X)const { return ((X) ? (X->add(this)) : (NULL));}
- Base* multiply(const Base* X)const {untested();return ((X) ? (X->multiply(this)) : (NULL));}
- Base* subtract(const Base* X)const {untested();return ((X) ? (X->r_subtract(this)): (NULL));}
- Base* r_subtract(const Base* X)const {untested();return ((X) ? (X->subtract(this)) : (NULL));}
- Base* divide(const Base* X)const { return ((X) ? (X->r_divide(this)) : (NULL));}
- Base* r_divide(const Base* X)const {untested();return ((X) ? (X->divide(this)) : (NULL));}
+ Base* less(const Base* X)const override {untested();return ((X) ? (X->greater(this)) : (NULL));}
+ Base* greater(const Base* X)const override {untested();return ((X) ? (X->less(this)) : (NULL));}
+ Base* leq(const Base* X)const override {untested();return ((X) ? (X->geq(this)) : (NULL));}
+ Base* geq(const Base* X)const override {untested();return ((X) ? (X->leq(this)) : (NULL));}
+ Base* not_equal(const Base* X)const override { return ((X) ? (X->not_equal(this)) : (NULL));}
+ Base* equal(const Base* X)const override { return ((X) ? (X->equal(this)) : (NULL));}
+ Base* add(const Base* X)const override { return ((X) ? (X->add(this)) : (NULL));}
+ Base* multiply(const Base* X)const override { return ((X) ? (X->multiply(this)) : (NULL));}
+ Base* subtract(const Base* X)const override { return ((X) ? (X->r_subtract(this)): (NULL));}
+ Base* r_subtract(const Base* X)const override {untested();return ((X) ? (X->subtract(this)) : (NULL));}
+ Base* divide(const Base* X)const override { return ((X) ? (X->r_divide(this)) : (NULL));}
+ Base* r_divide(const Base* X)const override {untested();return ((X) ? (X->divide(this)) : (NULL));}
+ Base* modulo(const Base* X)const override { return ((X) ? (X->r_modulo(this)) : (NULL));}
+ Base* r_modulo(const Base* X)const override {untested();return ((X) ? (X->modulo(this)) : (NULL));}
- Base* less(const Float*)const {untested();return NULL;}
- Base* greater(const Float*)const {untested();return NULL;}
- Base* leq(const Float*)const {untested();return NULL;}
- Base* geq(const Float*)const {untested();return NULL;}
- Base* not_equal(const Float*)const {untested();return NULL;}
- Base* equal(const Float*)const {untested();return NULL;}
- Base* add(const Float*)const { return NULL;}
- Base* multiply(const Float*)const {untested();return NULL;}
- Base* subtract(const Float*)const {untested();return NULL;}
- Base* r_subtract(const Float*)const {untested();return NULL;}
- Base* divide(const Float*)const {untested();return NULL;}
- Base* r_divide(const Float*)const {untested();return NULL;}
+ Base* less(const Float*)const override {untested();return NULL;}
+ Base* greater(const Float*)const override {untested();return NULL;}
+ Base* leq(const Float*)const override {untested();return NULL;}
+ Base* geq(const Float*)const override {untested();return NULL;}
+ Base* not_equal(const Float*)const override {untested();return NULL;}
+ Base* equal(const Float*)const override {return NULL;}
+ Base* add(const Float*)const override { return NULL;}
+ Base* multiply(const Float*)const override {untested();return NULL;}
+ Base* subtract(const Float*)const override {untested();return NULL;}
+ Base* r_subtract(const Float*)const override {untested();return NULL;}
+ Base* divide(const Float*)const override {untested();return NULL;}
+ Base* r_divide(const Float*)const override { itested();return NULL;}
+ Base* modulo(const Float*)const override {untested();return NULL;}
+ Base* r_modulo(const Float*)const override {untested();return NULL;}
};
/*--------------------------------------------------------------------------*/
class Name_String // a string that contains only alnum and _[]
:public String
{
public:
- void parse(CS&);
+ void parse(CS&) override;
public:
explicit Name_String(CS& file) {parse(file);}
explicit Name_String() {untested();}
};
/*--------------------------------------------------------------------------*/
+class Angled_String // <alphanumeric> string
+ :public String
+{
+public:
+ void parse(CS&) override;
+public:
+ explicit Angled_String(CS& file) {parse(file);}
+ explicit Angled_String() {}
+};
+/*--------------------------------------------------------------------------*/
class Quoted_String // the first non-blank character is a quote
:public String // a repeat of the same character terminates it
{
public:
- void parse(CS&);
+ void parse(CS&) override;
public:
- explicit Quoted_String(CS& file) {untested();parse(file);}
- explicit Quoted_String() {untested();}
+ explicit Quoted_String(CS& file) {parse(file);}
+ explicit Quoted_String() {}
};
/*--------------------------------------------------------------------------*/
class Tail_String // a string that is parsed to the end of a line
:public String
{
public:
- void parse(CS&);
+ void parse(CS&) override;
explicit Tail_String(CS& file) {untested();parse(file);}
explicit Tail_String() {untested();}
};
@@ -312,8 +345,8 @@ List_Base<T>::~List_Base()
/*--------------------------------------------------------------------------*/
template <class T>
void List_Base<T>::dump(std::ostream& Out)const
-{untested();
- for (const_iterator i = begin(); i != end(); ++i) {untested();
+{itested();
+ for (const_iterator i = begin(); i != end(); ++i) {itested();
assert(*i);
Out << **i;
}
@@ -330,7 +363,7 @@ void List<T>::parse(CS& File)
}else{untested();
T* x = new T(File);
if (!File.stuck(&here)) {untested();
- push(x);
+ List_Base<T>::push_back(x);
}else{untested();
delete x;
File.warn(0, "what's this? (List)");
diff --git a/include/m_expression.h b/include/m_expression.h
index 98c059a5..af3740fc 100644
--- a/include/m_expression.h
+++ b/include/m_expression.h
@@ -35,90 +35,132 @@ class Token
private:
std::string _name;
const Base* _data;
- std::string _aRgs;
public:
- void parse(CS&) {unreachable();}
+ void parse(CS&) override {unreachable();}
public:
- void dump(std::ostream&)const;
+ void dump(std::ostream&)const override;
protected:
- explicit Token(const std::string Name, const Base* Data, const std::string Args)
- : _name(Name), _data(Data), _aRgs(Args) {}
+ explicit Token(std::string Name, const Base* Data, std::string Args="")
+ : _name(Name), _data(Data) {assert(Args==""); }
explicit Token(const Token& P)
- : Base(), _name(P._name), _data(P._data), _aRgs(P._aRgs) {assert(!_data);}
+ : Base(), _name(P._name), _data(P._data) {assert(!_data);}
public:
- virtual ~Token() {if (_data) {
-delete _data;}else{
-}}
+ virtual ~Token() { delete _data; _data=NULL; }
virtual Token* clone()const = 0;
const std::string& name()const {return _name;}
const Base* data()const {return _data;}
- const std::string& aRgs()const {return _aRgs;}
- const std::string full_name()const {return name() + aRgs();}
+ const std::string& full_name()const {return name();}
virtual void stack_op(Expression*)const {unreachable();}
bool operator==(const Token& P) {return (typeid(*this)==typeid(P))
- && (data()==P.data()) && (name()==P.name()) && (aRgs()==P.aRgs());}
+ && (data()==P.data()) && (name()==P.name());}
};
/*--------------------------------------------------------------------------*/
-class Token_SYMBOL : public Token
-{
+class Token_SYMBOL : public Token {
+protected:
+ explicit Token_SYMBOL(std::string Name, Base const* Data)
+ : Token(Name, Data) {}
public:
- explicit Token_SYMBOL(const std::string Name, const std::string Args)
- : Token(Name, NULL, Args) {}
- explicit Token_SYMBOL(const Token_SYMBOL& P) : Token(P) {untested();}
- Token* clone()const {untested();return new Token_SYMBOL(*this);}
- void stack_op(Expression*)const;
+ explicit Token_SYMBOL(std::string Name, std::string Args="")
+ : Token(Name, NULL) {assert(Args=="");}
+ explicit Token_SYMBOL(const Token_SYMBOL& P) : Token(P) {}
+ Token* clone()const override{return new Token_SYMBOL(*this);}
+ void stack_op(Expression*)const override;
};
/*--------------------------------------------------------------------------*/
-class Token_BINOP : public Token
-{
+class Token_BINOP : public Token {
+protected:
+ explicit Token_BINOP(std::string Name, Base const* Data)
+ : Token(Name, Data) {}
public:
- explicit Token_BINOP(const std::string Name)
- : Token(Name, NULL, "") {}
+ explicit Token_BINOP(std::string Name)
+ : Token(Name, NULL) {}
explicit Token_BINOP(const Token_BINOP& P) : Token(P) {}
- Token* clone()const {return new Token_BINOP(*this);}
+ Token* clone()const override{return new Token_BINOP(*this);}
Token* op(const Token* t1, const Token* t2)const;
- void stack_op(Expression*)const;
+ void stack_op(Expression*)const override;
};
/*--------------------------------------------------------------------------*/
-class Token_STOP : public Token
-{
+class Token_TERNARY : public Token {
+ Expression const* _true{NULL};
+ Expression const* _false{NULL};
+protected:
+ explicit Token_TERNARY(std::string Name, Base const* Data)
+ : Token(Name, Data) {}
+public:
+ explicit Token_TERNARY(std::string Name, Expression const* t, Expression const* f)
+ : Token(Name, NULL), _true(t), _false(f) {}
+ explicit Token_TERNARY(const Token_TERNARY& P) : Token(P) {}
+ ~Token_TERNARY();
+ Token* clone()const override{return new Token_TERNARY(*this);}
+ Token* op(const Token* t1, const Token* t2, const Token* t3)const;
+ void stack_op(Expression*)const override;
+public:
+ Expression const* true_part() const{ return _true; }
+ Expression const* false_part() const{ return _false; }
+};
+/*--------------------------------------------------------------------------*/
+class Token_STOP : public Token {
+protected:
+ explicit Token_STOP(std::string Name, Base const* Data)
+ : Token(Name, Data) {untested();}
public:
- explicit Token_STOP(const std::string Name)
- : Token(Name, NULL, "") {}
+ explicit Token_STOP(std::string Name)
+ : Token(Name, NULL) {}
explicit Token_STOP(const Token_STOP& P) : Token(P) {}
- Token* clone()const {return new Token_STOP(*this);}
- void stack_op(Expression*)const;
+ Token* clone()const override{return new Token_STOP(*this);}
+ void stack_op(Expression*)const override;
};
/*--------------------------------------------------------------------------*/
-class Token_PARLIST : public Token
-{
+class Token_ARRAY : public Token {
+protected:
+ explicit Token_ARRAY(std::string Name, Base const* Data)
+ : Token(Name, Data) {untested();}
public:
- explicit Token_PARLIST(const std::string Name)
- : Token(Name, NULL, "") {}
- explicit Token_PARLIST(const Token_PARLIST& P) : Token(P) {untested();}
- Token* clone()const {untested();return new Token_PARLIST(*this);}
- void stack_op(Expression*)const;
+ explicit Token_ARRAY(std::string Name, Base* L=NULL)
+ : Token(Name, L) {}
+ explicit Token_ARRAY(const Token_ARRAY& P) : Token(P) {itested();}
+ Token* clone()const override{itested();return new Token_ARRAY(*this);}
+ void stack_op(Expression*)const override;
};
/*--------------------------------------------------------------------------*/
-class Token_UNARY : public Token
-{
+class Token_PARLIST : public Token {
+protected:
+ explicit Token_PARLIST(std::string Name, Base const* Data)
+ : Token(Name, Data) {untested();}
+public:
+ explicit Token_PARLIST(std::string Name, Base* L=NULL)
+ : Token(Name, L) {}
+ explicit Token_PARLIST(const Token_PARLIST& P) : Token(P) {itested();}
+ Token* clone()const override{itested();return new Token_PARLIST(*this);}
+ void stack_op(Expression*)const override;
+};
+/*--------------------------------------------------------------------------*/
+class Token_UNARY : public Token {
+protected:
+ explicit Token_UNARY(std::string Name, Base const* Data)
+ : Token(Name, Data) {untested();}
public:
- explicit Token_UNARY(const std::string Name)
- : Token(Name, NULL, "") {}
- explicit Token_UNARY(const Token_UNARY& P) : Token(P) {untested();}
- Token* clone()const {untested();return new Token_UNARY(*this);}
+ explicit Token_UNARY(std::string Name)
+ : Token(Name, NULL) {}
+ explicit Token_UNARY(const Token_UNARY& P) : Token(P) {itested();}
+ Token* clone()const override {itested();return new Token_UNARY(*this);}
Token* op(const Token* t1)const;
- void stack_op(Expression*)const;
+ void stack_op(Expression*)const override;
};
/*--------------------------------------------------------------------------*/
-class Token_CONSTANT : public Token
-{
+class Token_CONSTANT : public Token {
public:
- explicit Token_CONSTANT(const std::string Name, const Base* Data, const std::string Args)
- : Token(Name, Data, Args) {}
+ explicit Token_CONSTANT(std::string Name, Base const* Data, std::string Args="")
+ : Token(Name, Data) {assert(Args=="");}
explicit Token_CONSTANT(const Token_CONSTANT& P) : Token(P) {untested();}
- Token* clone()const {untested();return new Token_CONSTANT(*this);}
- void stack_op(Expression*)const;
+ Token* clone()const override {
+ if (auto s = dynamic_cast<String const*>(data())) {itested();
+ return new Token_CONSTANT(name(), new String(*s)); // BUG?
+ }else{ untested();
+ return new Token_CONSTANT(*this);
+ }
+ }
+ void stack_op(Expression*)const override;
};
/*--------------------------------------------------------------------------*/
class INTERFACE Expression
@@ -127,13 +169,15 @@ class INTERFACE Expression
public:
const CARD_LIST* _scope;
public:
- void parse(CS&);
- void dump(std::ostream&)const;
+ void parse(CS&) override;
+ void dump(std::ostream&)const override;
private: // expression-in.cc
void arglisttail(CS& File);
void arglist(CS& File);
+ CS& array(CS& File);
void leaf(CS& File);
void factor(CS& File);
+ void ternary(CS& File);
void termtail(CS& File);
void term(CS& File);
void addexptail(CS& File);
@@ -145,7 +189,7 @@ private: // expression-in.cc
void exptail(CS& File);
void expression(CS& File);
public:
- explicit Expression() : _scope(NULL) {untested();}
+ explicit Expression() : _scope(NULL) {}
explicit Expression(CS& File) : _scope(NULL) {parse(File);}
private: // expression-reduce.cc
void reduce_copy(const Expression&);
diff --git a/include/m_interp.h b/include/m_interp.h
index 49b2890f..aafd1137 100644
--- a/include/m_interp.h
+++ b/include/m_interp.h
@@ -66,16 +66,13 @@ FPOLY1 interpolate(Iterator begin, Iterator end, double x,
untested();
}
f1 = above;
- }else if ((upper == begin) && (x < (*lower).first) && (below!=NOT_INPUT)) {
+ }else if ((upper == begin) && (x < (*lower).first) && (below!=NOT_INPUT)) { itested();
// x is out of bounds, below
- untested();
- if (below != 0.) {
- untested();
- }else{
- untested();
+ if (below != 0.) { itested();
+ }else{ itested();
}
f1 = below;
- }else if ((*upper).first <= (*lower).first) {untested();
+ }else if ((*upper).first <= (*lower).first) {itested();
throw Exception("interpolate table is not sorted or has duplicate keys");
f1 = 0.;
}else{
diff --git a/include/m_matrix.h b/include/m_matrix.h
index b08895bd..de6e256b 100644
--- a/include/m_matrix.h
+++ b/include/m_matrix.h
@@ -504,7 +504,7 @@ T& BSMATRIX<T>::m(int r, int c)
*/
template <class T>
T BSMATRIX<T>::s(int row, int col)const
-{untested();
+{itested();
assert(_lownode);
assert(0 <= col);
assert(col <= size());
@@ -512,23 +512,23 @@ T BSMATRIX<T>::s(int row, int col)const
assert(row <= size());
assert(_zero == 0.);
- if (col == row) {untested();
+ if (col == row) {itested();
return d(row, col);
- }else if (col > row) {untested(); /* above the diagonal */
- if (row == 0) {untested();
+ }else if (col > row) {itested(); /* above the diagonal */
+ if (row == 0) {itested();
return _trash;
- }else if (row < _lownode[col]) {untested();
+ }else if (row < _lownode[col]) {itested();
return _zero;
- }else{untested();
+ }else{itested();
return u(row, col);
}
- }else{untested(); /* below the diagonal */
+ }else{itested(); /* below the diagonal */
assert(col < row);
- if (col == 0) {untested();
+ if (col == 0) {itested();
return _trash;
- }else if (col < _lownode[row]) {untested();
+ }else if (col < _lownode[row]) {itested();
return _zero;
- }else{untested();
+ }else{itested();
return l(row, col);
}
}
@@ -574,9 +574,9 @@ void BSMATRIX<T>::load_couple(int i, int j, T value)
}
}
/*--------------------------------------------------------------------------*/
-// load_point(i, i, value); or load_diagonal_point(i, value);
-// load_point(j, j, value); or load_diagonal_point(j, value);
-// load_point(i, j, -value);
+// load_point(i, i, value); // load_diagonal_point(i, value);
+// load_point(j, j, value); // load_diagonal_point(j, value);
+// load_point(i, j, -value); // load_couple(i, j, value);
// load_point(j, i, -value);
template <class T>
void BSMATRIX<T>::load_symmetric(int i, int j, T value)
@@ -660,7 +660,7 @@ void BSMATRIX<T>::lu_decomp(const BSMATRIX<T>& aa, bool do_partial)
}
{ /* jj == mm */
/* d(mm,mm) = aa.d(mm,mm) - dot(mm,mm,mm); then test */
- if (subtract_dot_product(mm,mm,mm,aa.d(mm,mm)) == 0.) {untested();
+ if (subtract_dot_product(mm,mm,mm,aa.d(mm,mm)) == 0.) {itested();
error(bWARNING, "open circuit: internal node %u\n", mm);
d(mm,mm) = _min_pivot;
}else{
@@ -668,7 +668,7 @@ void BSMATRIX<T>::lu_decomp(const BSMATRIX<T>& aa, bool do_partial)
}
}else{ /* bn == mm */
d(mm,mm) = aa.d(mm,mm);
- if (d(mm,mm)==0.) {untested();
+ if (d(mm,mm)==0.) {itested();
d(mm,mm) = _min_pivot;
}else{
}
diff --git a/include/md.h b/include/md.h
index afaec043..845c98b3 100644
--- a/include/md.h
+++ b/include/md.h
@@ -61,6 +61,8 @@
/* usual but non-standard (POSIX??) collection of includes */
#include <unistd.h> /* chdir, access, getcwd */
#include <fcntl.h> /* old style unix files */
+#include <dirent.h> /* opendir */
+#include <sys/types.h> /* needed for dirent.h */
/*--------------------------------------------------------------------------*/
/* constants related to memory size, word size, etc */
enum {
diff --git a/include/patchlev.h b/include/patchlev.h
index bf9f93e0..13da3e54 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "master 2021.01.07"
+#define PATCHLEVEL "release 2024.02.20"
diff --git a/include/s__.h b/include/s__.h
index d03cc16c..70b59e0b 100644
--- a/include/s__.h
+++ b/include/s__.h
@@ -57,7 +57,7 @@ protected:
public:
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
private:
- const std::string long_label()const {unreachable(); return "";}
+ const std::string long_label()const override {unreachable(); return "";}
private:
virtual void setup(CS&) = 0;
virtual void sweep() = 0;
diff --git a/include/s_tr.h b/include/s_tr.h
index cc1ed66b..1228f30e 100644
--- a/include/s_tr.h
+++ b/include/s_tr.h
@@ -64,19 +64,19 @@ public:
}
~TRANSIENT() {}
public:
- void do_it(CS&, CARD_LIST* scope);
- std::string status()const;
+ void do_it(CS&, CARD_LIST* scope)override;
+ std::string status()const override;
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
private: // s_tr_rev.cc
bool review();
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
private: // s_tr_set.cc
- void setup(CS&);
+ void setup(CS&)override;
protected:
void options(CS&);
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
protected: // s_tr_swp.cc
- void sweep();
+ void sweep()override;
private:
void set_step_cause(STEP_CAUSE);
public:
@@ -87,7 +87,7 @@ public:
void reject();
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
private:
- bool is_step_rejected()const {return (step_cause() > scREJECT);}
+ bool is_step_rejected()const override {return (step_cause() > scREJECT);}
explicit TRANSIENT(const TRANSIENT&): SIM(),_skip_in(1) {unreachable(); incomplete();}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
protected:
diff --git a/include/spice-wrapper.cc b/include/spice-wrapper.cc
index a1c1a4da..63953555 100644
--- a/include/spice-wrapper.cc
+++ b/include/spice-wrapper.cc
@@ -93,7 +93,6 @@ enum {uGROUND=1, uFLOAT=2, uDISALLOW=3};
const int MATRIX_NODES = (MAX_NET_NODES + INTERNAL_NODES);
class DEV_SPICE;
class MODEL_SPICE;
-static COMMON_PARAMLIST Default_Params(CC_STATIC);
/*--------------------------------------------------------------------------*/
/* function mapping: see devdefs.h
* DEVparam DEV_SPICE::parse_spice
@@ -167,12 +166,12 @@ public: // parameters
std::string param_name(int)const;
std::string param_name(int i, int j)const;
std::string param_value(int)const;
- void set_param_by_name(std::string Name, std::string Value);
+ int set_param_by_name(std::string Name, std::string Value);
void set_param_by_index(int, std::string&, int);
int param_count_dont_print()const {return MODEL_CARD::param_count();}
int param_count()const { return (static_cast<int>(_params.size()) + MODEL_CARD::param_count());}
- void Set_param_by_name(std::string Name, std::string Value);
+ int Set_param_by_name(std::string Name, std::string Value);
public: // not virtual
static int count() {untested(); return _count;}
@@ -207,7 +206,7 @@ public:
private:
explicit DEV_SPICE(const DEV_SPICE& p);
public:
- explicit DEV_SPICE();
+ explicit DEV_SPICE(COMMON_COMPONENT* c=NULL);
~DEV_SPICE();
protected: // override virtual
char id_letter()const {untested();return SPICE_LETTER[0];}
@@ -264,7 +263,7 @@ public: // ports
return port_names[i];
}
// const std::string& port_value(int i)const; //COMPONENT
- //void set_port_by_name(std::string& name, std::string& value);
+ //int set_port_by_name(std::string& name, std::string& value);
//void set_port_by_index(int index, std::string& value);
private: // parameters
//bool Param_exists(int i)const; // {return Param_name(i) != "";}
@@ -272,8 +271,8 @@ private: // parameters
//std::string Param_name(int)const;
//std::string Param_name(int i, int j)const {return STORAGE::Param_name(i, j);}
//std::string Param_value(int)const;
- void set_param_by_name(std::string Name, std::string Value);
- void Set_param_by_name(std::string Name, std::string Value);
+ int set_param_by_name(std::string Name, std::string Value);
+ int Set_param_by_name(std::string Name, std::string Value);
void Set_param_by_index(int, std::string&, int);
int param_count_dont_print()const {return common()->COMMON_COMPONENT::param_count();}
private:
@@ -567,7 +566,7 @@ MODEL_SPICE::~MODEL_SPICE()
--_count;
}
/*--------------------------------------------------------------------------*/
-void MODEL_SPICE::Set_param_by_name(std::string Name, std::string new_value)
+int MODEL_SPICE::Set_param_by_name(std::string Name, std::string new_value)
{
assert_model_raw();
assert(info.DEVpublic.numModelParms);
@@ -583,7 +582,7 @@ void MODEL_SPICE::Set_param_by_name(std::string Name, std::string new_value)
v = new_value;
int ok = info.DEVmodParam(Parms.id, &Value, &_spice_model._gen);
assert(ok == OK);
- return;
+ return MODEL_SPICE::param_count() - 1 - i;
}else{
}
}
@@ -591,16 +590,17 @@ void MODEL_SPICE::Set_param_by_name(std::string Name, std::string new_value)
throw Exception_No_Match(Name);
}else{
}
+ return 0; //BUG// ??
}
/*--------------------------------------------------------------------------*/
-void MODEL_SPICE::set_param_by_name(std::string Name, std::string Value)
+int MODEL_SPICE::set_param_by_name(std::string Name, std::string Value)
{
if (OPT::case_insensitive) {
notstd::to_lower(&Name);
}else{
}
_params.set(Name, Value);
- Set_param_by_name(Name, to_string(_params[Name].e_val(1,scope())));
+ return Set_param_by_name(Name, to_string(_params[Name].e_val(1,scope())));
}
/*--------------------------------------------------------------------------*/
void MODEL_SPICE::precalc_first()
@@ -696,8 +696,8 @@ void MODEL_SPICE::set_param_by_index(int, std::string&, int)
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-DEV_SPICE::DEV_SPICE()
- :STORAGE(),
+DEV_SPICE::DEV_SPICE(COMMON_COMPONENT* c)
+ :STORAGE(c),
_inst(),
_modelname(""),
_model(NULL),
@@ -712,7 +712,6 @@ DEV_SPICE::DEV_SPICE()
_num_states(0),
_maxEqNum(0)
{
- attach_common(&Default_Params);
std::fill_n(&_inst_space, sizeof(INSTANCE), '\0');
assert_instance();
@@ -814,7 +813,7 @@ void DEV_SPICE::set_dev_type(const std::string& new_type)
_modelname = new_type;
}
/*--------------------------------------------------------------------------*/
-void DEV_SPICE::Set_param_by_name(std::string Name, std::string new_value)
+int DEV_SPICE::Set_param_by_name(std::string Name, std::string new_value)
{
assert_instance();
assert(info.DEVpublic.numInstanceParms);
@@ -826,14 +825,14 @@ void DEV_SPICE::Set_param_by_name(std::string Name, std::string new_value)
IFparm Parms = info.DEVpublic.instanceParms[i];
if (Name == Parms.keyword) {
Set_param_by_index(i, new_value, 0);
- return;
+ return i;
}else{
}
}
- mutable_common()->COMMON_COMPONENT::Set_param_by_name(Name, new_value);
+ return mutable_common()->COMMON_COMPONENT::Set_param_by_name(Name, new_value);
}
/*--------------------------------------------------------------------------*/
-void DEV_SPICE::set_param_by_name(std::string Name, std::string Value)
+int DEV_SPICE::set_param_by_name(std::string Name, std::string Value)
{
if (OPT::case_insensitive) {
notstd::to_lower(&Name);
@@ -842,7 +841,7 @@ void DEV_SPICE::set_param_by_name(std::string Name, std::string Value)
COMPONENT::set_param_by_name(Name, Value);
COMMON_PARAMLIST* c = dynamic_cast<COMMON_PARAMLIST*>(mutable_common());
assert(c);
- Set_param_by_name(Name, to_string(c->_params[Name].e_val(1,scope())));
+ return Set_param_by_name(Name, to_string(c->_params[Name].e_val(1,scope())));
}
/*--------------------------------------------------------------------------*/
void DEV_SPICE::Set_param_by_index(int i, std::string& new_value, int offset)
@@ -1622,7 +1621,9 @@ extern "C" {
double Nintegrate(double, double, double, Ndata*) {incomplete(); return NOT_VALID;} //DEVnoise
#endif
void NevalSrc(double*, double*, CKTcircuit*, int, int, int, double) {incomplete();} //DEVnoise
+#ifdef NGSPICE_17
void NevalSrc2(double*, double*, CKTcircuit*, int, int, int, double, double) {incomplete();}
+#endif
//------------------------------------------------
// should be constants, but spice wants them to be variables.
double CONSTroot2(sqrt(2.));
@@ -1892,7 +1893,8 @@ static struct COMPLEX_TEST {
int MODEL_SPICE::_count = -1;
int DEV_SPICE::_count = -1;
-static DEV_SPICE p0;
+static COMMON_PARAMLIST Default_Params(CC_STATIC);
+static DEV_SPICE p0(&Default_Params);
static DISPATCHER<CARD>::INSTALL
d0(&device_dispatcher, std::string(SPICE_LETTER) + "|" + DEVICE_TYPE, &p0);
diff --git a/include/u_attrib.h b/include/u_attrib.h
new file mode 100644
index 00000000..83005aec
--- /dev/null
+++ b/include/u_attrib.h
@@ -0,0 +1,150 @@
+/* -*- C++ -*-
+ * Copyright (C) 2023 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * real base for anything to do with a circuit
+ */
+//testing=script 2023.10.25
+#ifndef U_ATTRIB_H
+#define U_ATTRIB_H
+#include "ap.h"
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+class INTERFACE ATTRIB_LIST {
+private:
+ std::string _s;
+ int _ref_count;
+ ATTRIB_LIST* _up;
+ const void* _owner;
+
+ ATTRIB_LIST(const ATTRIB_LIST&) = delete;
+ ATTRIB_LIST() = delete;
+public:
+ ATTRIB_LIST(const std::string& S, ATTRIB_LIST* UP, const void* Owner)
+ :_s(S), _ref_count(0), _up(UP), _owner(Owner) {
+ if (_up) {
+ _up->inc_ref_count();
+ }else{
+ }
+ }
+
+ ~ATTRIB_LIST() { itested();
+ if (_up) {
+ if (_up->dec_ref_count()==0) {
+ delete _up;
+ _up = NULL;
+ }else{untested();
+ }
+ }else{
+ }
+ assert(_ref_count == 0);
+ }
+
+ int inc_ref_count() {return ++_ref_count;}
+ int dec_ref_count() {assert(_ref_count>0); return --_ref_count;}
+ //int ref_count()const {untested(); return _ref_count;}
+
+ const std::string string(const void* Owner)const {
+ if (Owner == _owner || !Owner) {
+ if (_up) {
+ return _up->string(Owner) + ", " + _s;
+ }else{
+ return _s;
+ }
+ }else{untested();
+ return "";
+ }
+ }
+
+ const std::string operator[] (const std::string& Key)const {itested();
+ CS cmd(CS::_STRING, _s);
+ bool found = false;
+ std::string val("0");
+
+ while (cmd.more()) {itested();
+ if (cmd >> Key) {itested();
+ if (cmd >> "=") {itested();
+ cmd >> val;
+ }else{untested();
+ val = "1";
+ }
+ found = true;
+ // keep looking in case there is another, which will supercede
+ }else{untested();
+ cmd.skiparg();
+ if (cmd >> "=") {untested();
+ cmd.ctos();
+ }else{untested();
+ }
+ }
+ }
+
+ if (found) {itested();
+ return val;
+ }else if (_up) {untested();
+ return (*_up)[Key];
+ }else{untested();
+ return "0";
+ }
+ }
+};
+/*--------------------------------------------------------------------------*/
+class INTERFACE ATTRIB_LIST_p {
+private:
+ ATTRIB_LIST* _p;
+public:
+ ATTRIB_LIST_p() :_p(NULL) {}
+
+ ATTRIB_LIST_p(const ATTRIB_LIST_p& P) :_p(P._p) {untested();
+ if (_p) {untested();
+ _p->inc_ref_count();
+ }else{untested();
+ }
+ }
+
+ ~ATTRIB_LIST_p() {
+ if (_p) {
+ if (_p->dec_ref_count()==0) {
+ delete _p;
+ _p = NULL;
+ }else{untested();
+ }
+ }else{
+ }
+ }
+ operator bool()const {return _p;}
+ const std::string string(const void* Owner)const {return _p->string(Owner);}
+ const std::string operator[] (const std::string& Key)const {itested();return ((_p) ? (*_p)[Key] : "0");}
+
+ ATTRIB_LIST_p& add_to(const std::string& String, const void* Owner) {
+ if (_p) {
+ _p->dec_ref_count();
+ }else{
+ }
+ _p = new ATTRIB_LIST(String, _p, Owner);
+ assert(_p);
+ _p->inc_ref_count();
+ return *this;
+ }
+};
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+#endif
+// vim:ts=8:sw=2:noet:
diff --git a/include/u_cardst.h b/include/u_cardst.h
index ada14933..28abdacd 100644
--- a/include/u_cardst.h
+++ b/include/u_cardst.h
@@ -24,12 +24,12 @@
//testing=script,complete 2006.07.14
#ifndef U_CARDST_H
#define U_CARDST_H
-#include "e_compon.h"
+#include "e_elemnt.h"
/*--------------------------------------------------------------------------*/
class CARDSTASH {
private:
- COMPONENT* _brh;
- double _value;
+ ELEMENT* _brh;
+ PARAMETER<double> _value;
COMMON_COMPONENT* _c;
public:
explicit CARDSTASH() :_brh(0), _value(0.), _c(0) {}
@@ -37,7 +37,11 @@ public:
CARDSTASH(const CARDSTASH& p);
~CARDSTASH() {COMMON_COMPONENT::detach_common(&_c);}
void operator=(CARD* b);
- void restore() {assert(_brh); _brh->set_value(_value, _c);}
+ void restore() {
+ assert(_brh);
+ _brh->set_value(_value, _c);
+ _brh->set_value(_value);
+ }
#if 0
bool operator==(const CARDSTASH&)const
{incomplete();unreachable();return false;}
@@ -54,7 +58,7 @@ public:
inline void CARDSTASH::operator=(CARD* b)
{
assert(b);
- _brh = prechecked_cast<COMPONENT*>(b);
+ _brh = prechecked_cast<ELEMENT*>(b);
assert(_brh);
_value = _brh->value();
COMMON_COMPONENT::detach_common(&_c);
diff --git a/include/u_parameter.h b/include/u_parameter.h
index 01250312..3f0d3adc 100644
--- a/include/u_parameter.h
+++ b/include/u_parameter.h
@@ -45,6 +45,8 @@ public:
bool has_hard_value()const {return (_s != "");}
virtual bool has_good_value()const = 0;
+ bool is_constant()const {untested(); return (_s == "#");}
+ virtual bool is_given()const {untested(); return (_s != "");}
virtual void parse(CS& cmd) = 0;
virtual void operator=(const std::string& s) = 0;
@@ -55,18 +57,18 @@ class PARAMETER : public PARA_BASE {
private:
mutable T _v;
public:
- explicit PARAMETER() : PARA_BASE(), _v(NOT_INPUT) {}
+ explicit PARAMETER() : PARA_BASE(), _v(not_input()) {}
PARAMETER(const PARAMETER<T>& p) : PARA_BASE(p), _v(p._v) {}
explicit PARAMETER(T v) :PARA_BASE(), _v(v) {}
//explicit PARAMETER(T v, const std::string& s) :_v(v), _s(s) {untested();}
~PARAMETER() {}
- bool has_good_value()const {return (_v != NOT_INPUT);}
+ bool has_good_value()const override {return (_v != NOT_INPUT);} // BUG // T==bool?
//bool has_soft_value()const {untested(); return (has_good_value() && !has_hard_value());}
operator T()const {return _v;}
T e_val(const T& def, const CARD_LIST* scope)const;
- void parse(CS& cmd);
+ void parse(CS& cmd) override;
std::string string()const {
if (_s == "#") {
@@ -83,7 +85,7 @@ public:
void operator=(const T& v) {_v = v; _s = "#";}
//void operator=(const std::string& s) {untested();_s = s;}
- void operator=(const std::string& s) {
+ void operator=(const std::string& s)override {
if (strchr("'\"{", s[0])) {
CS cmd(CS::_STRING, s);
_s = cmd.ctos("", "'\"{", "'\"}");
@@ -97,10 +99,10 @@ public:
return (_v == p._v && _s == p._s);
}
bool operator==(const T& v)const {
- if (v != NOT_INPUT) {
+ if (v != not_input()) {
return _v == v;
}else{
- return (_v == NOT_INPUT || !has_hard_value());
+ return (_v == not_input() || !has_hard_value());
}
}
//bool operator!=(const PARAMETER& p)const {untested();
@@ -109,7 +111,8 @@ public:
//bool operator!=(const T& v)const {untested();
// return !(*this == v);
//}
- T* pointer_hack() {return &_v;}
+protected:
+ virtual T not_input() const {return T(NOT_INPUT);}
private:
T lookup_solve(const T& def, const CARD_LIST* scope)const;
};
@@ -193,17 +196,23 @@ void e_val(T* p, const T& def, const CARD_LIST*)
/*--------------------------------------------------------------------------*/
class INTERFACE PARAM_LIST {
private:
- mutable std::map<std::string, PARAMETER<double> > _pl;
- PARAM_LIST* _try_again; // if you don't find it, also look here
+ typedef std::map<std::string, PARAMETER<double> > map;
+public:
+ typedef map::const_iterator const_iterator;
+ typedef map::iterator iterator;
+private:
+ map _pl;
+ PARAM_LIST const* _try_again; // if you don't find it, also look here
+ mutable const_iterator _previous;
public:
- typedef std::map<std::string, PARAMETER<double> >::const_iterator
- const_iterator;
- typedef std::map<std::string, PARAMETER<double> >::iterator
- iterator;
explicit PARAM_LIST() :_try_again(NULL) {}
explicit PARAM_LIST(const PARAM_LIST& p) :_pl(p._pl), _try_again(p._try_again) {}
//explicit PARAM_LIST(PARAM_LIST* ta) :_try_again(ta) {untested();}
~PARAM_LIST() {}
+ PARAM_LIST& operator=(const PARAM_LIST& p) { itested();
+ _pl = p._pl;
+ return *this;
+ }
void parse(CS& cmd);
void print(OMSTREAM&, LANGUAGE*)const;
@@ -213,19 +222,19 @@ public:
std::string name(int)const;
std::string value(int)const;
- void eval_copy(PARAM_LIST&, const CARD_LIST*);
- bool operator==(const PARAM_LIST& p)const {return _pl == p._pl;}
+ void eval_copy(PARAM_LIST const&, const CARD_LIST*);
+ bool operator==(const PARAM_LIST& p)const{return _pl == p._pl;}
const PARAMETER<double>& deep_lookup(std::string)const;
const PARAMETER<double>& operator[](std::string i)const {return deep_lookup(i);}
+ void set(std::string, const double&);
void set(std::string, const std::string&);
- void set_try_again(PARAM_LIST* t) {_try_again = t;}
+ void set_try_again(PARAM_LIST const* t) {_try_again = t;}
iterator begin() {return _pl.begin();}
iterator end() {return _pl.end();}
- const_iterator begin()const {untested(); return _pl.begin();}
- const_iterator end()const {untested(); return _pl.end();}
-private:
- mutable const_iterator _previous;
+ const_iterator begin()const {itested(); return _pl.begin();}
+ const_iterator end()const {itested(); return _pl.end();}
+ const_iterator find(std::string const& k) const {itested(); return _pl.find(k); }
};
/*--------------------------------------------------------------------------*/
template <>
@@ -242,7 +251,7 @@ inline T PARAMETER<T>::lookup_solve(const T& def, const CARD_LIST* scope)const
Expression e(cmd);
Expression reduced(e, scope);
T v = T(reduced.eval());
- if (v != NOT_INPUT) {
+ if (v != not_input()) {
return v;
}else{
const PARAM_LIST* pl = scope->params();
@@ -287,11 +296,12 @@ T PARAMETER<T>::e_val(const T& def, const CARD_LIST* scope)const
_v = lookup_solve(def, scope);
if (_v == NOT_INPUT) {
error(bDANGER, "parameter " + *first_name + " value is \"NOT_INPUT\"\n");
+ //BUG// not reachable if T==bool?
//BUG// needs to show scope
//BUG// it is likely to have a numeric overflow resulting from the bad value
}else{
}
- }else{untested();
+ }else{itested();
_v = def;
error(bDANGER, "parameter " + *first_name + " recursion too deep\n");
}
diff --git a/include/u_prblst.h b/include/u_prblst.h
index 60b51395..9eb74df4 100644
--- a/include/u_prblst.h
+++ b/include/u_prblst.h
@@ -46,7 +46,7 @@ public:
void remove_list(CS&);
void remove_one(CKT_BASE*);
- void add_list(CS&);
+ void add_list(CS&, CARD_LIST* scope);
int size()const {return static_cast<int>(bag.size());}
const_iterator begin()const {return bag.begin();}
const_iterator end()const {return bag.end();}
@@ -55,8 +55,8 @@ public:
private:
void erase(iterator b, iterator e) {bag.erase(b,e);}
void push_new_probe(const std::string& param, const CKT_BASE* object);
- bool add_branches(const std::string&,const std::string&,const CARD_LIST*);
- void add_all_nodes(const std::string&);
+ bool add_branches(const std::string&, const std::string&, const CARD_LIST*);
+ void add_all_nodes(const std::string&, CARD_LIST*);
};
/*--------------------------------------------------------------------------*/
class INTERFACE PROBE_LISTS {
diff --git a/include/u_sim_data.h b/include/u_sim_data.h
index 5029169e..74f15958 100644
--- a/include/u_sim_data.h
+++ b/include/u_sim_data.h
@@ -32,6 +32,7 @@
// external
class WAVE;
class CARD;
+class CARD_LIST;
class LOGIC_NODE;
/*--------------------------------------------------------------------------*/
enum TRI_STATE {tsNO=0, tsYES=1, tsBAD=-1};
@@ -87,7 +88,7 @@ struct INTERFACE SIM_DATA {
void alloc_hold_vectors(); /* s__init.cc */
void alloc_vectors();
void unalloc_vectors();
- void init();
+ void init(CARD_LIST* scope);
void uninit();
void set_limit(); /* s__aux.cc */
void set_limit(double v);
diff --git a/lib/Make.depend b/lib/Make.depend
index c65e0936..237afe57 100644
--- a/lib/Make.depend
+++ b/lib/Make.depend
@@ -1,7 +1,8 @@
globals.o: globals.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_prblst.h ../include/u_probe.h ../include/l_compar.h \
../include/e_cardlist.h ../include/u_status.h ../include/l_timer.h \
../include/patchlev.h
@@ -14,10 +15,11 @@ m_expression_in.o: m_expression_in.cc ../include/m_expression.h \
../include/io_trace.h ../include/io_error.h ../include/ap.h \
../include/constant.h
m_expression_reduce.o: m_expression_reduce.cc ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_stlextra.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/u_function.h ../include/u_parameter.h \
+ ../include/u_function.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/constant.h \
../include/e_cardlist.h
m_base_in.o: m_base_in.cc ../include/m_base.h ../include/l_lib.h \
@@ -51,9 +53,10 @@ ap_match.o: ap_match.cc ../include/u_opt.h ../include/mode.h \
ap_skip.o: ap_skip.cc ../include/ap.h ../include/md.h \
../include/io_trace.h ../include/io_error.h
l_dispatcher.o: l_dispatcher.cc ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h
l_ftos.o: l_ftos.cc ../include/l_lib.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/constant.h
l_pmatch.o: l_pmatch.cc ../include/ap.h ../include/md.h \
@@ -83,9 +86,10 @@ io_xopen.o: io_xopen.cc ../include/u_opt.h ../include/mode.h \
../include/io_trace.h ../include/io_error.h ../include/constant.h \
../include/ap.h
u_lang.o: u_lang.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/c_comand.h ../include/e_card.h ../include/d_dot.h \
../include/d_coment.h ../include/e_subckt.h ../include/e_compon.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
@@ -97,27 +101,30 @@ u_nodemap.o: u_nodemap.cc ../include/e_node.h ../include/u_sim_data.h \
../include/io_error.h ../include/l_compar.h ../include/u_opt.h \
../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
../include/u_nodemap.h
u_opt1.o: u_opt1.cc ../include/u_opt.h ../include/mode.h ../include/io_.h \
../include/l_lib.h ../include/md.h ../include/io_trace.h \
../include/io_error.h
u_opt2.o: u_opt2.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/c_comand.h ../include/e_card.h ../include/u_lang.h \
- ../include/l_compar.h ../include/ap.h
+ ../include/l_compar.h ../include/e_cardlist.h
u_parameter.o: u_parameter.cc ../include/l_stlextra.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/u_parameter.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_expression.h ../include/m_base.h ../include/ap.h \
../include/constant.h ../include/e_cardlist.h ../include/u_lang.h \
- ../include/e_base.h
+ ../include/e_base.h ../include/u_attrib.h ../include/l_indirect.h
u_prblst.o: u_prblst.cc ../include/e_cardlist.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/e_node.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
../include/e_card.h ../include/u_nodemap.h ../include/ap.h \
../include/u_prblst.h ../include/u_probe.h
u_probe.o: u_probe.cc ../include/u_sim_data.h ../include/constant.h \
@@ -125,15 +132,17 @@ u_probe.o: u_probe.cc ../include/u_sim_data.h ../include/constant.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/u_status.h ../include/l_timer.h \
- ../include/e_base.h ../include/u_probe.h ../include/e_base.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/u_probe.h ../include/e_base.h
u_sim_data.o: u_sim_data.cc ../include/m_wave.h ../include/l_denoise.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/m_interp.h ../include/m_cpoly.h ../include/constant.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/u_nodemap.h ../include/e_cardlist.h ../include/u_status.h \
- ../include/l_timer.h
+ ../include/e_logicnode.h ../include/e_logicval.h ../include/e_node.h \
+ ../include/u_sim_data.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/l_stlextra.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/u_nodemap.h \
+ ../include/e_cardlist.h ../include/u_status.h ../include/l_timer.h
u_xprobe.o: u_xprobe.cc ../include/m_phase.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
@@ -143,56 +152,43 @@ d_subckt.o: d_subckt.cc ../include/u_nodemap.h ../include/md.h \
../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/ap.h \
- ../include/e_paramlist.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h ../include/e_subckt.h
-d_logic.o: d_logic.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_subckt.h ../include/e_compon.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/e_paramlist.h \
+ ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/u_xprobe.h ../include/d_logic.h \
- ../include/e_model.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/m_cpoly.h ../include/l_denoise.h
-d_logicmod.o: d_logicmod.cc ../include/d_logic.h ../include/e_model.h \
+ ../include/e_card.h ../include/e_subckt.h
+d_logicmod.o: d_logicmod.cc ../include/e_logicmod.h ../include/e_model.h \
../include/u_parameter.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/m_expression.h \
../include/m_base.h ../include/ap.h ../include/constant.h \
../include/e_cardlist.h ../include/e_card.h ../include/e_base.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/l_compar.h ../include/m_matrix.h ../include/l_stlextra.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h
-e_base.o: e_base.cc ../include/ap.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/u_attrib.h ../include/l_indirect.h
+e_base.o: e_base.cc ../include/u_sim_data.h ../include/constant.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
../include/l_stlextra.h ../include/m_wave.h ../include/l_denoise.h \
../include/m_interp.h ../include/m_cpoly.h ../include/u_prblst.h \
- ../include/u_probe.h ../include/e_base.h ../include/u_xprobe.h \
+ ../include/u_probe.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/u_xprobe.h \
../include/e_base.h
e_card.o: e_card.cc ../include/u_time_pair.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/e_cardlist.h ../include/e_node.h ../include/u_sim_data.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
- ../include/l_stlextra.h ../include/e_base.h ../include/e_card.h
-e_node.o: e_node.cc ../include/u_nodemap.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/d_logic.h \
- ../include/e_model.h ../include/u_parameter.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/m_expression.h ../include/m_base.h ../include/ap.h \
- ../include/constant.h ../include/e_cardlist.h ../include/e_card.h \
- ../include/e_base.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/l_stlextra.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/e_aux.h \
- ../include/u_xprobe.h
+ ../include/l_stlextra.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/e_card.h
+e_node.o: e_node.cc ../include/e_cardlist.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/e_card.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/u_nodemap.h ../include/e_aux.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/u_opt.h ../include/mode.h \
+ ../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
+ ../include/l_stlextra.h ../include/u_xprobe.h ../include/e_logicnode.h \
+ ../include/e_logicval.h
e_model.o: e_model.cc ../include/e_compon.h ../include/u_sim_data.h \
../include/constant.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/l_compar.h ../include/u_opt.h \
@@ -200,44 +196,64 @@ e_model.o: e_model.cc ../include/e_compon.h ../include/u_sim_data.h \
../include/m_matrix.h ../include/l_stlextra.h ../include/u_time_pair.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/ap.h ../include/e_cardlist.h ../include/e_card.h \
- ../include/e_base.h ../include/e_model.h
+ ../include/e_base.h ../include/u_attrib.h ../include/l_indirect.h \
+ ../include/e_model.h
e_compon.o: e_compon.cc ../include/u_lang.h ../include/e_base.h \
- ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/u_attrib.h ../include/ap.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_indirect.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/e_model.h ../include/u_parameter.h ../include/m_expression.h \
+ ../include/m_base.h ../include/constant.h ../include/e_cardlist.h \
+ ../include/e_card.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/l_stlextra.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h
+e_logicnode.o: e_logicnode.cc ../include/e_logicmod.h \
+ ../include/e_model.h ../include/u_parameter.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/m_expression.h \
../include/m_base.h ../include/ap.h ../include/constant.h \
- ../include/e_cardlist.h ../include/e_card.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/l_stlextra.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h
+ ../include/e_cardlist.h ../include/e_card.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/l_indirect.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/l_stlextra.h
+e_logicval.o: e_logicval.cc ../include/e_logicval.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h
e_elemnt.o: e_elemnt.cc ../include/m_divdiff.h ../include/u_xprobe.h \
../include/constant.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/e_aux.h ../include/e_node.h \
../include/u_sim_data.h ../include/l_compar.h ../include/u_opt.h \
../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/e_elemnt.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/ap.h \
- ../include/e_cardlist.h ../include/e_card.h
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h
e_ccsrc.o: e_ccsrc.cc ../include/e_ccsrc.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
- ../include/md.h ../include/io_trace.h ../include/io_error.h \
- ../include/l_compar.h ../include/u_opt.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
- ../include/l_stlextra.h ../include/e_base.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/ap.h ../include/e_cardlist.h ../include/e_card.h
+ ../include/e_logicnode.h ../include/e_logicval.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/e_node.h \
+ ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h
e_storag.o: e_storag.cc ../include/e_storag.h ../include/e_elemnt.h \
- ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
- ../include/md.h ../include/io_trace.h ../include/io_error.h \
- ../include/l_compar.h ../include/u_opt.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
- ../include/l_stlextra.h ../include/e_base.h ../include/m_cpoly.h \
- ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/ap.h ../include/e_cardlist.h ../include/e_card.h
+ ../include/e_logicnode.h ../include/e_logicval.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/e_node.h \
+ ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
+ ../include/u_time_pair.h ../include/u_parameter.h \
+ ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
+ ../include/e_card.h
e_paramlist.o: e_paramlist.cc ../include/e_paramlist.h \
../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
@@ -246,67 +262,77 @@ e_paramlist.o: e_paramlist.cc ../include/e_paramlist.h \
../include/l_stlextra.h ../include/u_time_pair.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/ap.h ../include/e_cardlist.h ../include/e_card.h \
- ../include/e_base.h
+ ../include/e_base.h ../include/u_attrib.h ../include/l_indirect.h
e_cardlist.o: e_cardlist.cc ../include/u_time_pair.h \
../include/constant.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/e_node.h ../include/u_sim_data.h \
../include/l_compar.h ../include/u_opt.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/m_matrix.h \
- ../include/l_stlextra.h ../include/e_base.h ../include/u_nodemap.h \
+ ../include/l_stlextra.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/u_nodemap.h \
../include/e_model.h ../include/u_parameter.h ../include/m_expression.h \
- ../include/m_base.h ../include/ap.h ../include/e_cardlist.h \
- ../include/e_card.h
+ ../include/m_base.h ../include/e_cardlist.h ../include/e_card.h
bm_cond.o: bm_cond.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/e_elemnt.h ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
- ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
- ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h ../include/bm.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/e_elemnt.h ../include/e_logicnode.h ../include/e_logicval.h \
+ ../include/e_node.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/m_cpoly.h \
+ ../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/bm.h
bm_value.o: bm_value.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/bm.h ../include/e_compon.h ../include/u_sim_data.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/bm.h \
+ ../include/e_compon.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/m_matrix.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h
+bm.o: bm.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/l_indirect.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/u_lang.h ../include/e_elemnt.h ../include/e_logicnode.h \
+ ../include/e_logicval.h ../include/e_node.h ../include/u_sim_data.h \
../include/constant.h ../include/l_compar.h ../include/m_matrix.h \
+ ../include/m_cpoly.h ../include/l_denoise.h ../include/e_compon.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
- ../include/e_card.h
-bm.o: bm.cc ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
- ../include/u_lang.h ../include/e_elemnt.h ../include/e_node.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/m_matrix.h ../include/m_cpoly.h ../include/l_denoise.h \
- ../include/e_compon.h ../include/u_time_pair.h ../include/u_parameter.h \
- ../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h ../include/bm.h
c__cmd.o: c__cmd.cc ../include/u_status.h ../include/mode.h \
../include/io_.h ../include/l_lib.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/l_timer.h \
../include/declare.h ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h ../include/globals.h ../include/l_dispatcher.h \
- ../include/l_stlextra.h ../include/u_opt.h ../include/ap.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h ../include/globals.h ../include/l_dispatcher.h \
+ ../include/l_stlextra.h ../include/u_opt.h
c_attach.o: c_attach.cc ../include/e_cardlist.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/c_comand.h \
- ../include/e_card.h ../include/e_base.h ../include/globals.h \
+ ../include/e_card.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/l_indirect.h ../include/globals.h \
../include/l_dispatcher.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/io_dir.h
c_file.o: c_file.cc ../include/u_lang.h ../include/e_base.h \
- ../include/md.h ../include/io_trace.h ../include/io_error.h \
+ ../include/u_attrib.h ../include/ap.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/l_indirect.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/c_comand.h ../include/e_card.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/l_stlextra.h ../include/ap.h
+ ../include/l_dispatcher.h ../include/l_stlextra.h \
+ ../include/e_cardlist.h
findbr.o: findbr.cc ../include/l_lib.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/constant.h \
../include/e_cardlist.h ../include/ap.h ../include/e_card.h \
- ../include/e_base.h
+ ../include/e_base.h ../include/u_attrib.h ../include/ap.h \
+ ../include/l_indirect.h
plot.o: plot.cc ../include/declare.h ../include/md.h \
../include/io_trace.h ../include/io_error.h ../include/constant.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_prblst.h ../include/u_probe.h ../include/e_base.h \
+ ../include/u_attrib.h ../include/ap.h ../include/l_indirect.h \
../include/l_compar.h
diff --git a/lib/Make1 b/lib/Make1
index 27f839f7..62174f6e 100644
--- a/lib/Make1
+++ b/lib/Make1
@@ -1,4 +1,4 @@
-#$Id: Make1 $ -*- Makefile -*-
+#$Id: lib/Make1 $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <[email protected]>
#
@@ -19,12 +19,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#------------------------------------------------------------------------
-TARGET = libgnucap
-#------------------------------------------------------------------------
-INSTALL_FILES = $(TARGET)$(TARGET_EXT)
+TARGET_LIB = libgnucap
+TARGET_LIB_EXT = .so
#------------------------------------------------------------------------
+INSTALL_FILES = $(TARGET_LIB)$(TARGET_LIB_EXT)
INSTALL_DIR = $(PREFIX)/lib
#------------------------------------------------------------------------
+LIBS = \
+-lreadline -ltermcap \
+-ldl
+INCLUDE = -I. -I../include -I../../include
+#------------------------------------------------------------------------
DELETED =
#------------------------------------------------------------------------
RAW_SRCS = \
@@ -36,14 +41,15 @@ l_dispatcher.cc l_ftos.cc l_pmatch.cc l_timer.cc l_trim.cc l_wmatch.cc \
io.cc io_contr.cc io_error.cc io_findf.cc io_out.cc io_xopen.cc \
u_lang.cc u_nodemap.cc u_opt1.cc u_opt2.cc \
u_parameter.cc u_prblst.cc u_probe.cc u_sim_data.cc u_xprobe.cc \
-d_subckt.cc d_logic.cc d_logicmod.cc \
+d_subckt.cc d_logicmod.cc \
e_base.cc e_card.cc e_node.cc e_model.cc e_compon.cc \
+e_logicnode.cc e_logicval.cc \
e_elemnt.cc e_ccsrc.cc e_storag.cc e_paramlist.cc e_cardlist.cc \
bm_cond.cc bm_value.cc bm.cc \
c__cmd.cc c_attach.cc c_file.cc \
findbr.cc plot.cc
#------------------------------------------------------------------------
-RAW_OTHER = Make1 Make2.g++ Make2.Debug Make2.mingw32 configure test_readline.cc
+RAW_OTHER = Make1 configure test_readline.cc
#------------------------------------------------------------------------
RAW = $(RAW_HDRS) $(RAW_SRCS) $(RAW_OTHER)
#------------------------------------------------------------------------
@@ -65,10 +71,10 @@ IMPORTED_DIST = $(IMPORTED)
DIST_FILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
-SRCS = $(IMPORTED_SRCS) $(GENERATED_SRCS) $(RAW_SRCS)
+SRCS = $(RAW_SRCS) $(GENERATED_SRCS) $(IMPORTED_SRCS)
HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
OBJS = ${SRCS:.cc=.o}
-TARGET_DEPENDS = $(OBJS) $(RAW)
+TARGET_DEPENDS = $(OBJS) $(RAW)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
MOSTLYCLEANFILES = $(OBJS) $(GENERATED)
@@ -76,4 +82,4 @@ CLEANFILES = $(MOSTLYCLEANFILES)
DISTCLEANFILES = $(CLEANFILES)
MAINTAINERCLEANFILES = $(DISTCLEANFILES)
#------------------------------------------------------------------------
-#-----------------------------------------------------------------------------
+#------------------------------------------------------------------------
diff --git a/lib/Make2.Debug b/lib/Make2.Debug
deleted file mode 100644
index b0e180a0..00000000
--- a/lib/Make2.Debug
+++ /dev/null
@@ -1,100 +0,0 @@
-#$Id: Make2.Debug $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-# Standard base for g++, debugging, a little optimization
-# Running the program will give a spew of line markers for debugging.
-
-CCC = g++
-TARGET_EXT = .so
-
-CCFLAGS = \
--fPIC \
--DHAVE_LIBREADLINE \
--DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \
--Wall -Wextra \
--Wswitch-enum -Wundef -Wpointer-arith -Woverloaded-virtual \
--Wcast-qual -Wcast-align -Wpacked -Wshadow -Wconversion \
--Winit-self -Wmissing-include-dirs -Winvalid-pch \
--Wvolatile-register-var -Wstack-protector \
--Wvla -Woverlength-strings -Wno-sign-conversion -Wno-unused-const-variable
-#last line not in 4.1
-
-LIBS = \
--lreadline -ltermcap \
--ldl
-
-LDFLAGS = -shared
-
-%.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-# warnings turned off, because they warn of nothing wrong
-# 4.3
-#-Wswitch-default -- lack of default is correct with enum
-#-Wfloat-equal -- warns on NA, div by zero trap
-#-Wpadded -- a bool in a class is enough
-#-Wredundant-decls -- in both header and func is an error check
-#-Wmissing-declarations -- pascal style
-#-Wmissing-noreturn -- warns when always throws exception
-#-Wunreachable-code -- warns even if reachable .. compiler bug??
-#-Waggregate-return -- warns even if passed by reference
-#-Wunsafe-loop-optimizations -- if can't unroll a loop
-#-Winline
-#-Wdisabled-optimization -- -O0 disables optimization, so it warns
-
-# 4.2
-#-Wpadded -- a bool in a class is enough
-#-Winline
-#-Waggregate-return -- warns even if passed by reference
-#-Wfloat-equal -- warns on NA, div by zero trap
-#-Wredundant-decls -- in both header and func is an error check
-#-Wunsafe-loop-optimizations -- warns on any loop with variable count
-
-# warnings turned off, because of the public headers
-#-Wunreachable-code -- didn't use nonportable syntax to hide
-#-Wmissing-noreturn -- didn't use nonportable syntax to hide
-
-# warnings turned off, issues with clang
-#-Wlogical-op -- not recognized
-#-Wsign-conversion -- int to size_t
-#-Wunused-const-variable -- generated code
-
-# warnings that should be on, but ...
-#-Wshadow -- lambda functions
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "debug" version, with extra warnings and run-time tracing.
-# If you get errors or warnings, make a copy of it and modify that.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to [email protected]
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/lib/Make2.mingw32 b/lib/Make2.mingw32
deleted file mode 100644
index 27a2c513..00000000
--- a/lib/Make2.mingw32
+++ /dev/null
@@ -1,50 +0,0 @@
-#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-CCC = i586-mingw32msvc-g++
-DLLTOOL = i586-mingw32msvc-dlltool
-TARGET_EXT = .dll
-
-CCFLAGS = \
--DMAKE_DLL \
--O2 -DNDEBUG -I. -I../../include
-
-LIBS =
-
-LDFLAGS = -shared
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET)$(TARGET_EXT) $(TARGET).a
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------------------
-$(TARGET).a: $(TARGET_DEPENDS) $(TARGET)$(TARGET_EXT)
- rm -f $@
- $(DLLTOOL) -l $@ -D $(TARGET)$(TARGET_EXT) $(OBJS) $(LIBS)
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/lib/ap_construct.cc b/lib/ap_construct.cc
index 39bc036e..a0b3c761 100644
--- a/lib/ap_construct.cc
+++ b/lib/ap_construct.cc
@@ -77,7 +77,7 @@ CS::CS(CS::WHOLE_FILE, const std::string& name)
{
int f = open(name.c_str(), O_RDONLY);
if (f == EOF) {itested();
- throw Exception_File_Open(name + ':' + strerror(errno));
+ throw Exception_File_Open(name + ": " + strerror(errno));
}else{
}
_length = static_cast<size_t>(lseek(f, off_t(0), SEEK_END));
@@ -243,7 +243,7 @@ static std::string getlines(FILE *fileptr)
}else{
trim(buffer);
size_t count = strlen(buffer);
- if (buffer[count-1] == '\\') {
+ if (count && buffer[count-1] == '\\') {
buffer[count-1] = '\0';
}else{
// look ahead at next line
diff --git a/lib/ap_match.cc b/lib/ap_match.cc
index 6adecdc7..06b22245 100644
--- a/lib/ap_match.cc
+++ b/lib/ap_match.cc
@@ -81,8 +81,7 @@ CS& CS::umatch(const std::string& s)
skipcom();
_ok = true;
}else{
- reset(start);
- _ok = false;
+ reset_fail(start);
}
return *this;
}
@@ -95,8 +94,7 @@ CS& CS::scan(const std::string& s)
_ok = true;
break;
}else if (!more()) { // ran out
- reset(start);
- _ok = false;
+ reset_fail(start);
break;
}else{ // skip and try again
skiparg();
diff --git a/lib/ap_skip.cc b/lib/ap_skip.cc
index 020dfbb7..e903db78 100644
--- a/lib/ap_skip.cc
+++ b/lib/ap_skip.cc
@@ -116,15 +116,15 @@ CS& CS::skiparg()
* _ok = skipped something
*/
CS& CS::skipto1(const std::string& t)
-{untested();
+{itested();
size_t here = cursor();
- while (ns_more() && !match1(t)) {untested();
+ while (ns_more() && !match1(t)) {itested();
skip();
}
_ok = ns_more();
if (!_ok) {untested();
reset(here);
- }else{untested();
+ }else{itested();
}
return *this;
}
@@ -139,7 +139,7 @@ CS& CS::skipto1(char c)
skip();
}
_ok = ns_more();
- if (!_ok) {untested();
+ if (!_ok) {itested();
reset(here);
}else{
}
diff --git a/lib/bm_cond.cc b/lib/bm_cond.cc
index 4d1d928b..d4367744 100644
--- a/lib/bm_cond.cc
+++ b/lib/bm_cond.cc
@@ -41,25 +41,25 @@ public:
explicit EVAL_BM_COND(int c=0);
~EVAL_BM_COND();
private: // override virtual
- bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new EVAL_BM_COND(*this);}
- void parse_common_obsolete_callback(CS&);
- void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const;
+ bool operator==(const COMMON_COMPONENT&)const override;
+ COMMON_COMPONENT* clone()const override {return new EVAL_BM_COND(*this);}
+ void parse_common_obsolete_callback(CS&) override;
+ void print_common_obsolete_callback(OMSTREAM&, LANGUAGE*)const override;
- void precalc_first(const CARD_LIST*);
- void expand(const COMPONENT*);
- COMMON_COMPONENT* deflate();
- void precalc_last(const CARD_LIST*);
+ void precalc_first(const CARD_LIST*) override;
+ void expand(const COMPONENT*) override;
+ COMMON_COMPONENT* deflate() override;
+ void precalc_last(const CARD_LIST*) override;
- void tr_eval(ELEMENT*d)const
+ void tr_eval(ELEMENT*d)const override
{assert(_func[d->_sim->sim_mode()]); _func[d->_sim->sim_mode()]->tr_eval(d);}
- void ac_eval(ELEMENT*d)const
+ void ac_eval(ELEMENT*d)const override
{assert(_func[s_AC]); _func[s_AC]->ac_eval(d);}
- TIME_PAIR tr_review(COMPONENT*d)const
+ TIME_PAIR tr_review(COMPONENT*d)const override
{assert(_func[d->_sim->sim_mode()]); return _func[d->_sim->sim_mode()]->tr_review(d);}
- void tr_accept(COMPONENT*d)const
+ void tr_accept(COMPONENT*d)const override
{assert(_func[d->_sim->sim_mode()]); _func[d->_sim->sim_mode()]->tr_accept(d);}
- std::string name()const {itested(); return "????";}
+ std::string name()const override {itested(); return "????";}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/lib/c_attach.cc b/lib/c_attach.cc
index 5c34a4ea..7ed11b12 100644
--- a/lib/c_attach.cc
+++ b/lib/c_attach.cc
@@ -20,14 +20,16 @@
* 02110-1301, USA.
*------------------------------------------------------------------
*/
-//testing=script 2017.06.22
+//testing=script 2023.12.02
#include "e_cardlist.h"
#include "c_comand.h"
#include "globals.h"
+#include "io_dir.h"
/*--------------------------------------------------------------------------*/
namespace {
/*--------------------------------------------------------------------------*/
std::map<std::string, void*> attach_list;
+const std::string SUFFIX(".so");
/*--------------------------------------------------------------------------*/
std::string plug_path()
{
@@ -40,23 +42,75 @@ void list()
ii = attach_list.begin(); ii != attach_list.end(); ++ii) {
if (ii->second) {
IO::mstdout << ii->first << '\n';
- }else{itested();
+ }else{untested();
error(bTRACE, ii->first + " (unloaded)\n");
}
}
}
/*--------------------------------------------------------------------------*/
+void tach_dir(CS&, std::string const&, DIRECTORY const&,
+ CARD_LIST const*, int, size_t);
+void attach_file(CS&, std::string const& file_name, CARD_LIST const*, int, size_t);
+void detach_file(CS&, std::string const& file_name, CARD_LIST const*, size_t);
+void load_or_unload(CS& cmd, CARD_LIST const* Scope, int flags)
+{
+ size_t here = cmd.cursor();
+ std::string short_file_name;
+ cmd >> short_file_name;
+ if (short_file_name == "") {
+ // nothing, list what we have
+ list();
+ }else{
+ std::string full_file_name;
+ if (short_file_name[0]=='/' || short_file_name[0]=='.'){
+ if (OS::access_ok(short_file_name, R_OK)) {
+ // found it, local or root
+ full_file_name = short_file_name;
+ }else{untested();
+ cmd.reset(here);
+ throw Exception_CS(std::string("plugin not found in ") + short_file_name[0], cmd);
+ }
+ }else{
+ std::string path = plug_path();
+ full_file_name = findfile(short_file_name, path, R_OK);
+ if (full_file_name != "") {
+ // found it, with search
+ }else{untested();
+ cmd.reset(here);
+ throw Exception_CS("plugin not found in " + path, cmd);
+ }
+ }
+
+ DIRECTORY dir(full_file_name);
+ trace2("cmd_attach", full_file_name, dir.exists());
+
+ if(dir.exists()) {
+ tach_dir(cmd, full_file_name, dir, Scope, flags, here);
+ }else{
+ if(flags){
+ attach_file(cmd, full_file_name, Scope, flags, here);
+ }else{itested();
+ detach_file(cmd, full_file_name, Scope, here);
+ }
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+
class CMD_ATTACH : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
size_t here = cmd.cursor();
int dl_scope = RTLD_LOCAL;
int check = RTLD_NOW;
// RTLD_NOW means to resolve symbols on loading
// RTLD_LOCAL means symbols defined in a plugin are local
do {
- if (cmd.umatch("public ")) {untested();
+ if (cmd.umatch("public ")) {itested();
dl_scope = RTLD_GLOBAL;
// RTLD_GLOBAL means symbols defined in a plugin are global
// Use this when a plugin depends on another.
@@ -69,60 +123,10 @@ public:
}
} while (cmd.more() && !cmd.stuck(&here));
- std::string short_file_name;
- cmd >> short_file_name;
-
- if (short_file_name == "") {
- // nothing, list what we have
- list();
- }else{
- // a name to look for
- // check if already loaded
- if (void* handle = attach_list[short_file_name]) {itested();
- if (CARD_LIST::card_list.is_empty()) {itested();
- cmd.warn(bDANGER, here, "\"" + short_file_name + "\": already loaded, replacing");
- dlclose(handle);
- attach_list[short_file_name] = NULL;
- }else{itested();
- cmd.reset(here);
- throw Exception_CS("already loaded, cannot replace when there is a circuit", cmd);
- }
- }else{
- }
-
- std::string full_file_name;
- if (short_file_name[0]=='/' || short_file_name[0]=='.'){untested();
- if (OS::access_ok(short_file_name, R_OK)) {untested();
- // found it, local or root
- full_file_name = short_file_name;
- }else{untested();
- cmd.reset(here);
- throw Exception_CS(std::string("plugin not found in ") + short_file_name[0], cmd);
- }
- }else{
- std::string path = plug_path();
- full_file_name = findfile(short_file_name, path, R_OK);
- if (full_file_name != "") {
- // found it, with search
- }else{untested();
- cmd.reset(here);
- throw Exception_CS("plugin not found in " + path, cmd);
- }
- }
-
- assert(OS::access_ok(full_file_name, R_OK));
-
- if (void* handle = dlopen(full_file_name.c_str(), check | dl_scope)) {
- attach_list[short_file_name] = handle;
- }else{untested();
- cmd.reset(here);
- throw Exception_CS(dlerror(), cmd);
- }
- }
+ load_or_unload(cmd, Scope, check | dl_scope);
}
- std::string help_text()const
- {
+ std::string help_text()const override {
return
"load command\n"
"Loads plugins\n"
@@ -134,35 +138,96 @@ public:
} p1;
DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "attach|load", &p1);
/*--------------------------------------------------------------------------*/
+void tach_dir(CS& cmd, std::string const& dirname, DIRECTORY const& dir,
+ CARD_LIST const* Scope, int flags, size_t here)
+{
+ DIRECTORY::const_iterator i;
+ std::vector<std::string> sos;
+ for(i=dir.begin(); i!=dir.end(); ++i) {
+ std::string fname = i->d_name;
+ size_t s = fname.size();
+ size_t slen = SUFFIX.size();
+ if(s<slen){
+ }else if(fname.substr(s-slen, s) == SUFFIX){
+ sos.push_back(fname);
+ }else{
+ }
+ }
+ std::sort(sos.begin(), sos.end());
+ std::vector<std::string>::const_iterator ni;
+ error(bLOG, "Plugins in " + dirname + "\n");
+ for(ni=sos.begin(); ni!=sos.end(); ++ni) {
+ error(bLOG, " .. " + *ni + "\n");
+ if(flags){
+ attach_file(cmd, dirname + "/" + *ni, Scope, flags, here);
+ }else{ itested();
+ detach_file(cmd, dirname + "/" + *ni, Scope, here);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+void attach_file(CS& cmd, std::string const& file_name,
+ CARD_LIST const* Scope, int flags,
+ size_t here)
+{
+ // a name to look for
+ // check if already loaded
+ assert(flags);
+ if (void* handle = attach_list[file_name]) {
+ if (Scope->is_empty()) {
+ cmd.warn(bDANGER, here, "\"" + file_name + "\": already loaded, replacing");
+ dlclose(handle);
+ attach_list[file_name] = NULL;
+ }else{untested();
+ cmd.reset(here);
+ throw Exception_CS("already loaded, cannot replace when there is a circuit", cmd);
+ }
+ }else{
+ }
+
+ assert(OS::access_ok(file_name, R_OK));
+
+ if (!flags) { untested();
+ }else if (void* handle = dlopen(file_name.c_str(), flags)) {
+ attach_list[file_name] = handle;
+ }else{untested();
+ throw Exception_CS(dlerror(), cmd);
+ }
+}
+/*--------------------------------------------------------------------------*/
+void detach_file(CS& cmd, std::string const& file_name,
+ CARD_LIST const* Scope, size_t here)
+{itested();
+ if (Scope->is_empty()) {itested();
+ void* handle = attach_list[file_name];
+ if (handle) {itested();
+ dlclose(handle);
+ attach_list[file_name] = NULL;
+ }else{untested();
+ cmd.reset(here);
+ throw Exception_CS("plugin not attached", cmd);
+ }
+ }else{untested();
+ cmd.reset(here);
+ throw Exception_CS("detach prohibited when there is a circuit", cmd);
+ }
+}
+/*--------------------------------------------------------------------------*/
class CMD_DETACH : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
- size_t here = cmd.cursor(); //BUG// due to the way dlopen and dlclose work
- std::string file_name; // it doesn't really work.
- cmd >> file_name; // the dispatcher's active instance blocks unload
-
- if (file_name == "") {
- // nothing, list what we have
- list();
+ void do_it(CS& cmd, CARD_LIST* Scope) override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
}else{untested();
- if (CARD_LIST::card_list.is_empty()) {untested();
- void* handle = attach_list[file_name];
- if (handle) {untested();
- dlclose(handle);
- attach_list[file_name] = NULL;
- }else{untested();
- cmd.reset(here);
- throw Exception_CS("plugin not attached", cmd);
- }
- }else{untested();
- throw Exception_CS("detach prohibited when there is a circuit", cmd);
- }
}
+ //BUG// due to the way dlopen and dlclose work
+ // it doesn't really work.
+ // the dispatcher's active instance blocks unload
+
+ load_or_unload(cmd, Scope, 0);
}
- std::string help_text()const
- {
+ std::string help_text()const override {
return
"unload command\n"
"Unloads plugins\n"
@@ -176,9 +241,12 @@ DISPATCHER<CMD>::INSTALL d2(&command_dispatcher, "detach|unload", &p2);
/*--------------------------------------------------------------------------*/
class CMD_DETACH_ALL : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {
- if (CARD_LIST::card_list.is_empty()) {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{untested();
+ }
+ if (Scope->is_empty()) {
for (std::map<std::string, void*>::iterator
ii = attach_list.begin(); ii != attach_list.end(); ++ii) {
void* handle = ii->second;
diff --git a/lib/c_file.cc b/lib/c_file.cc
index 4e6aac75..090e0596 100644
--- a/lib/c_file.cc
+++ b/lib/c_file.cc
@@ -28,6 +28,7 @@
#include "u_lang.h"
#include "c_comand.h"
#include "globals.h"
+#include "e_cardlist.h"
/*--------------------------------------------------------------------------*/
extern OMSTREAM mout; /* > file bitmap */
extern OMSTREAM mlog; /* log file bitmap */
@@ -36,8 +37,11 @@ namespace {
/*--------------------------------------------------------------------------*/
class CMD_INCLUDE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST* Scope)
- {
+ void do_it(CS& cmd, CARD_LIST* Scope)override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{ untested();
+ }
size_t here = cmd.cursor();
try {
std::string file_name;
@@ -46,7 +50,7 @@ public:
for (;;) {
if (OPT::language) {
OPT::language->parse_top_item(file, Scope);
- }else{untested();
+ }else{itested();
CMD::cmdproc(file.get_line(""), Scope);
}
}
@@ -68,8 +72,11 @@ DISPATCHER<CMD>::INSTALL d0(&command_dispatcher, "include", &p0);
*/
class CMD_LOG : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {itested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {itested();
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {untested();
+ }else{ untested();
+ }
static std::list<FILE*> filestack;
if (cmd.more()) { /* a file name .. open it */
@@ -108,8 +115,11 @@ DISPATCHER<CMD>::INSTALL d1(&command_dispatcher, "log", &p1);
*/
class CMD_FILE : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*)
- {itested();
+ void do_it(CS& cmd, CARD_LIST* Scope)override {itested();
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {itested();
+ }else{ untested();
+ }
static std::list<FILE*> filestack;
if (cmd.more()) { /* a file name .. open it */
diff --git a/lib/configure b/lib/configure
index a10a76eb..fafaa205 100755
--- a/lib/configure
+++ b/lib/configure
@@ -1,5 +1,4 @@
#!/bin/sh
-# configure for library (shared object)
mkdir -p O
#------------- Stuff added to enable --prefix --------------
@@ -25,45 +24,39 @@ sed -e "s#/usr/local#$prefix#" ../Makefile.template > Makefile
#----------------------------------------------------------------
echo "CCFLAGS = -fPIC \\" >Make.ccflags
-echo "LIBS = -ldl \\" >Make.libs
-
+echo "-std=c++11 -DUNIX -O2 -DNDEBUG \$(INCLUDE) -W \\" >>Make.ccflags
+# begin special stuff
rm -f a.out
c++ test_readline.cc -lreadline -ltermcap
if [ -f a.out ] ; then
echo "using readline"
echo "-DHAVE_LIBREADLINE \\" >>Make.ccflags
- echo "-lreadline -ltermcap \\" >>Make.libs
else
echo "warning: either libtermcap or libreadline is missing - building without readline"
fi
rm -f a.out
-
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
-echo "" >>Make.libs
-echo "PREFIX = " $prefix >>Make.libs
-echo "" >>Make.libs
+# end special stuff
+echo "" >>Make.ccflags
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
-TARGET_EXT = .so
-
-LDFLAGS = -shared
+CXX = c++
.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.SUFFIXES: .so .o .cc
+.cc.o:; \$(CXX) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.cc.so:; \$(MAKE_LIB) \$<
#------------------------------------------------------------------------
-\$(TARGET)\$(TARGET_EXT): \$(TARGET_DEPENDS)
- rm -f \$@
- \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -o \$@
+MAKE_EXE = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -o \$@
+MAKE_LIB = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -shared -o \$@
#------------------------------------------------------------------------
CAT_EOF
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------ >>Make2
-cat Make.ccflags Make.libs Make.sys >>Make2
-rm Make.ccflags Make.libs Make.sys
+echo "PREFIX = " $prefix >>Make2
+cat Make.ccflags Make.sys >>Make2
+rm Make.ccflags Make.sys
exit 0
diff --git a/lib/d_logicmod.cc b/lib/d_logicmod.cc
index 86fedc6f..0a7f4d1c 100644
--- a/lib/d_logicmod.cc
+++ b/lib/d_logicmod.cc
@@ -25,9 +25,11 @@
* model: .model mname LOGIC <args>
*/
//testing=script 2006.07.17
-#include "d_logic.h"
+#include "e_logicmod.h"
/*--------------------------------------------------------------------------*/
-MODEL_LOGIC::MODEL_LOGIC(const DEV_LOGIC* p)
+int MODEL_LOGIC::_count = -1; // there is one in e_node.cc, and the dispatcher
+/*--------------------------------------------------------------------------*/
+MODEL_LOGIC::MODEL_LOGIC(const COMPONENT* p)
:MODEL_CARD(p),
delay (1e-9),
vmax (5.),
diff --git a/lib/d_subckt.cc b/lib/d_subckt.cc
index d52e570e..069f015b 100644
--- a/lib/d_subckt.cc
+++ b/lib/d_subckt.cc
@@ -40,7 +40,7 @@
/*--------------------------------------------------------------------------*/
namespace{
/*--------------------------------------------------------------------------*/
-static COMMON_PARAMLIST Default_SUBCKT(CC_STATIC);
+COMMON_PARAMLIST Default_SUBCKT(CC_STATIC);
#define PORTS_PER_SUBCKT 100
//BUG// fixed limit on number of ports
/*--------------------------------------------------------------------------*/
@@ -49,27 +49,27 @@ class DEV_SUBCKT : public BASE_SUBCKT {
private:
explicit DEV_SUBCKT(const DEV_SUBCKT&);
public:
- explicit DEV_SUBCKT();
+ explicit DEV_SUBCKT(COMMON_COMPONENT* c=NULL);
~DEV_SUBCKT() {--_count;}
- CARD* clone()const {return new DEV_SUBCKT(*this);}
+ CARD* clone()const override {return new DEV_SUBCKT(*this);}
private: // override virtual
- char id_letter()const {return 'X';}
- bool print_type_in_spice()const {return true;}
- std::string value_name()const {return "#";}
- int max_nodes()const {return PORTS_PER_SUBCKT;}
- int min_nodes()const {return 0;}
- int matrix_nodes()const {return 0;}
- int net_nodes()const {return _net_nodes;}
- void precalc_first();
- bool makes_own_scope()const {return false;}
+ char id_letter()const override {return 'X';}
+ bool print_type_in_spice()const override {return true;}
+ std::string value_name()const override {return "#";}
+ int max_nodes()const override {return PORTS_PER_SUBCKT;}
+ int min_nodes()const override {return 0;}
+ int matrix_nodes()const override {return 0;}
+ int net_nodes()const override {return _net_nodes;}
+ void precalc_first()override;
+ bool makes_own_scope()const override {return false;}
- void expand();
+ void expand() override;
private:
- void precalc_last();
- double tr_probe_num(const std::string&)const;
- int param_count_dont_print()const {return common()->COMMON_COMPONENT::param_count();}
+ void precalc_last()override;
+ double tr_probe_num(const std::string&)const override;
+ int param_count_dont_print()const override {return common()->COMMON_COMPONENT::param_count();}
- std::string port_name(int i)const;
+ std::string port_name(int i)const override;
public:
static int count() {untested();return _count;}
protected:
@@ -77,51 +77,51 @@ protected:
private:
node_t _nodes[PORTS_PER_SUBCKT];
static int _count;
-} p1;
+} p1(&Default_SUBCKT);
int DEV_SUBCKT::_count = -1;
/*--------------------------------------------------------------------------*/
class DEV_SUBCKT_PROTO : public DEV_SUBCKT {
private:
explicit DEV_SUBCKT_PROTO(const DEV_SUBCKT_PROTO&p);
public:
- explicit DEV_SUBCKT_PROTO();
+ explicit DEV_SUBCKT_PROTO(COMMON_COMPONENT* c=NULL);
~DEV_SUBCKT_PROTO(){}
public: // override virtual
- char id_letter()const {untested();return '\0';}
- CARD* clone_instance()const;
- bool print_type_in_spice()const {unreachable(); return false;}
- std::string value_name()const {untested();incomplete(); return "";}
- std::string dev_type()const {untested(); return "";}
- int max_nodes()const {return PORTS_PER_SUBCKT;}
- int min_nodes()const {return 0;}
- int matrix_nodes()const {untested();return 0;}
- int net_nodes()const {return _net_nodes;}
- CARD* clone()const {return new DEV_SUBCKT_PROTO(*this);}
- bool is_device()const {return false;}
- bool makes_own_scope()const {return true;}
- CARD_LIST* scope() {untested();return subckt();}
- const CARD_LIST* scope()const {return subckt();}
+ char id_letter()const override {untested();return '\0';}
+ CARD* clone_instance()const override;
+ bool print_type_in_spice()const override {unreachable(); return false;}
+ std::string value_name()const override {untested();incomplete(); return "";}
+ std::string dev_type()const override {itested(); return "";}
+ int max_nodes()const override {return PORTS_PER_SUBCKT;}
+ int min_nodes()const override {return 0;}
+ int matrix_nodes()const override {untested();return 0;}
+ int net_nodes()const override {return _net_nodes;}
+ CARD* clone()const override {return new DEV_SUBCKT_PROTO(*this);}
+ bool is_device()const override {return false;}
+ bool makes_own_scope()const override {return true;}
+ CARD_LIST* scope()override {untested();return subckt();}
+ const CARD_LIST* scope()const override {return subckt();}
private: // no-ops for prototype
- void precalc_first(){}
- void expand(){}
- void precalc_last(){}
- void map_nodes(){}
- void tr_begin(){}
- void tr_load(){}
- TIME_PAIR tr_review(){ return TIME_PAIR(NEVER, NEVER);}
- void tr_accept(){}
- void tr_advance(){}
- void tr_restore(){}
- void tr_regress(){}
- void dc_advance(){}
- void ac_begin(){}
- void do_ac(){}
- void ac_load(){}
- bool do_tr(){ return true;}
- bool tr_needs_eval()const{untested(); return false;}
- void tr_queue_eval(){}
- std::string port_name(int)const {untested();return "";}
-} pp;
+ void precalc_first()override {}
+ void expand()override {}
+ void precalc_last()override {}
+ void map_nodes()override {}
+ void tr_begin()override {}
+ void tr_load()override {}
+ TIME_PAIR tr_review() override { return TIME_PAIR(NEVER, NEVER);}
+ void tr_accept()override {}
+ void tr_advance()override {}
+ void tr_restore()override {}
+ void tr_regress()override {}
+ void dc_advance()override {}
+ void ac_begin()override {}
+ void do_ac()override {}
+ void ac_load()override {}
+ bool do_tr()override { return true;}
+ bool tr_needs_eval()const override {untested(); return false;}
+ void tr_queue_eval()override {}
+ std::string port_name(int i)const override{return port_value(i);}
+} pp(&Default_SUBCKT);
DISPATCHER<CARD>::INSTALL d1(&device_dispatcher, "X|subckt", &pp);
/*--------------------------------------------------------------------------*/
DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO(const DEV_SUBCKT_PROTO& p)
@@ -130,20 +130,30 @@ DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO(const DEV_SUBCKT_PROTO& p)
new_subckt();
}
/*--------------------------------------------------------------------------*/
-DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO()
- :DEV_SUBCKT()
+DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO(COMMON_COMPONENT* c)
+ :DEV_SUBCKT(c)
{
new_subckt();
}
/*--------------------------------------------------------------------------*/
CARD* DEV_SUBCKT_PROTO::clone_instance()const
{
+#if 1
DEV_SUBCKT* new_instance = dynamic_cast<DEV_SUBCKT*>(p1.clone());
+#else
+ DEV_SUBCKT* new_instance = dynamic_cast<DEV_SUBCKT*>(DEV_SUBCKT::clone());
+ assert(new_instance);
+ for (int ii = 0; ii < net_nodes(); ++ii) {
+ new_instance->_nodes[ii] = node_t();
+ }
+ new_instance->_net_nodes = 0;
+#endif
assert(!new_instance->subckt());
if (this == &pp){
// cloning from static, empty model
// look out for _parent in expand
+ assert(!new_instance->_parent);
}else{
new_instance->_parent = this;
}
@@ -152,11 +162,10 @@ CARD* DEV_SUBCKT_PROTO::clone_instance()const
return new_instance;
}
/*--------------------------------------------------------------------------*/
-DEV_SUBCKT::DEV_SUBCKT()
- :BASE_SUBCKT(),
+DEV_SUBCKT::DEV_SUBCKT(COMMON_COMPONENT* c)
+ :BASE_SUBCKT(c),
_parent(NULL)
{
- attach_common(&Default_SUBCKT);
_n = _nodes;
++_count;
}
@@ -178,7 +187,7 @@ std::string DEV_SUBCKT::port_name(int i)const
{
if (const DEV_SUBCKT* p=dynamic_cast<const DEV_SUBCKT*>(_parent)) {
if (i<p->net_nodes()){
- return p->port_value(i);
+ return p->port_name(i);
}else{untested();
return "";
}
@@ -207,7 +216,7 @@ void DEV_SUBCKT::expand()
throw Exception_Type_Mismatch(long_label(), c->modelname(), "subckt");
}
}else{
- // reruns
+ // reruns, or got it at construction
assert(find_looking_out(c->modelname()) == _parent);
}
@@ -218,7 +227,7 @@ void DEV_SUBCKT::expand()
assert(_parent->net_nodes() <= _parent->subckt()->nodes()->how_many());
assert(_parent->subckt()->params());
- PARAM_LIST* pl = const_cast<PARAM_LIST*>(_parent->subckt()->params());
+ PARAM_LIST const* pl = _parent->subckt()->params();
assert(pl);
c->_params.set_try_again(pl);
@@ -231,7 +240,7 @@ void DEV_SUBCKT::precalc_first()
BASE_SUBCKT::precalc_first();
if (subckt()) {
- COMMON_PARAMLIST* c = prechecked_cast<COMMON_PARAMLIST*>(mutable_common());
+ auto c = prechecked_cast<COMMON_PARAMLIST const*>(common());
assert(c);
subckt()->attach_params(&(c->_params), scope());
subckt()->precalc_first();
diff --git a/lib/e_base.cc b/lib/e_base.cc
index 258771a4..2b9310df 100644
--- a/lib/e_base.cc
+++ b/lib/e_base.cc
@@ -22,7 +22,6 @@
* Base class for "cards" in the circuit description file
*/
//testing=script 2014.07.04
-#include "ap.h"
#include "u_sim_data.h"
#include "m_wave.h"
#include "u_prblst.h"
@@ -37,6 +36,7 @@ static char fix_case(char c)
double CKT_BASE::tr_probe_num(const std::string&)const {return NOT_VALID;}
XPROBE CKT_BASE::ac_probe_ext(const std::string&)const {return XPROBE(NOT_VALID, mtNONE);}
/*--------------------------------------------------------------------------*/
+INDIRECT<ATTRIB_LIST_p>* CKT_BASE::_attribs;
SIM_DATA* CKT_BASE::_sim = NULL;
PROBE_LISTS* CKT_BASE::_probe_lists = NULL;
/*--------------------------------------------------------------------------*/
@@ -51,6 +51,13 @@ CKT_BASE::~CKT_BASE()
}
trace1("", _probes);
assert(_probes==0);
+
+ if(!_attribs){ itested();
+ }else if (_attribs->count(this) > 0) {
+ _attribs->erase(this, this);
+ }else{
+ }
+ assert(!_attribs || _attribs->count(this)==0);
}
/*--------------------------------------------------------------------------*/
const std::string CKT_BASE::long_label()const
@@ -162,5 +169,14 @@ double CKT_BASE::ac_probe_num(const std::string& what)const
return NULL;
}
/*--------------------------------------------------------------------------*/
+bool CKT_BASE::operator!=(const std::string& n)const
+{
+ if(OPT::case_insensitive){
+ return strcasecmp(_label.c_str(),n.c_str())!=0;
+ }else{
+ return strcmp(_label.c_str(),n.c_str())!=0;
+ }
+}
+/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// vim:ts=8:sw=2:noet:
diff --git a/lib/e_card.cc b/lib/e_card.cc
index e560554e..d9e8b7fb 100644
--- a/lib/e_card.cc
+++ b/lib/e_card.cc
@@ -51,9 +51,17 @@ CARD::CARD(const CARD& p)
/*--------------------------------------------------------------------------*/
CARD::~CARD()
{
+ // purge();
delete _subckt;
}
/*--------------------------------------------------------------------------*/
+void CARD::purge()
+{
+ assert(_attribs);
+ _attribs->erase(reinterpret_cast<bool*>(this)-net_nodes(), reinterpret_cast<bool*>(this)+param_count());
+ CKT_BASE::purge();
+}
+/*--------------------------------------------------------------------------*/
const std::string CARD::long_label()const
{
std::string buffer(short_label());
@@ -196,14 +204,14 @@ void CARD::new_subckt()
_subckt = new CARD_LIST;
}
/*--------------------------------------------------------------------------*/
-void CARD::new_subckt(const CARD* Model, PARAM_LIST* Params)
+void CARD::new_subckt(const CARD* Model, PARAM_LIST const* Params)
{
delete _subckt;
_subckt = NULL;
_subckt = new CARD_LIST(Model, this, scope(), Params);
}
/*--------------------------------------------------------------------------*/
-void CARD::renew_subckt(const CARD* Model, PARAM_LIST* Params)
+void CARD::renew_subckt(const CARD* Model, PARAM_LIST const* Params)
{
if (_sim->is_first_expand()) {
new_subckt(Model, Params);
@@ -218,14 +226,14 @@ node_t& CARD::n_(int i)const
return _n[i];
}
/*--------------------------------------------------------------------------*/
-void CARD::set_param_by_name(std::string Name, std::string Value)
+int CARD::set_param_by_name(std::string Name, std::string Value)
{
//BUG// ugly linear search
for (int i = param_count() - 1; i >= 0; --i) {
for (int j = 0; param_name(i,j) != ""; ++j) { // multiple names
if (Umatch(Name, param_name(i,j) + ' ')) {
set_param_by_index(i, Value, 0/*offset*/);
- return; //success
+ return i; //success
}else{
//keep looking
}
diff --git a/lib/e_cardlist.cc b/lib/e_cardlist.cc
index 6c103796..c704b4f2 100644
--- a/lib/e_cardlist.cc
+++ b/lib/e_cardlist.cc
@@ -38,7 +38,7 @@ CARD_LIST::CARD_LIST()
}
/*--------------------------------------------------------------------------*/
CARD_LIST::CARD_LIST(const CARD* model, CARD* owner,
- const CARD_LIST* scope, PARAM_LIST* p)
+ const CARD_LIST* scope, PARAM_LIST const* p)
:_parent(NULL),
_nm(new NODE_MAP),
_params(NULL)
@@ -100,15 +100,23 @@ CARD_LIST::const_iterator CARD_LIST::find_again(const std::string& short_name,
CARD_LIST& CARD_LIST::erase(iterator ci)
{
assert(ci != end());
- delete *ci;
+ if (*ci) {
+ (*ci)->purge();
+ delete *ci;
+ }else{itested();
+ }
_cl.erase(ci);
return *this;
}
/*--------------------------------------------------------------------------*/
CARD_LIST& CARD_LIST::erase(CARD* c)
-{
- delete c;
- _cl.remove(c);
+{untested();
+ if (c) {untested();
+ c->purge();
+ delete c;
+ _cl.remove(c);
+ }else{untested();
+ }
return *this;
}
/*--------------------------------------------------------------------------*/
@@ -118,7 +126,11 @@ CARD_LIST& CARD_LIST::erase(CARD* c)
CARD_LIST& CARD_LIST::erase_all()
{
while (!_cl.empty()) {
- delete _cl.back();
+ if (_cl.back()) {
+ _cl.back()->purge();
+ delete _cl.back();
+ }else{itested();
+ }
_cl.pop_back();
}
return *this;
@@ -324,7 +336,7 @@ bool CARD_LIST::do_tr()
*/
CARD_LIST& CARD_LIST::tr_load()
{
- if (CKT_BASE::_sim->is_inc_mode()) {itested();
+ if (CKT_BASE::_sim->is_inc_mode()) { untested();
assert(!OPT::traceload);
for (iterator ci=begin(); ci!=end(); ++ci) {itested();
trace_func_comp();
@@ -423,7 +435,7 @@ CARD_LIST& CARD_LIST::ac_load()
return *this;
}
/*--------------------------------------------------------------------------*/
-void CARD_LIST::attach_params(PARAM_LIST* p, const CARD_LIST* scope)
+void CARD_LIST::attach_params(PARAM_LIST const* p, const CARD_LIST* scope)
{
if (p) {
assert(scope);
diff --git a/lib/e_compon.cc b/lib/e_compon.cc
index 00f4681e..cac65f6a 100644
--- a/lib/e_compon.cc
+++ b/lib/e_compon.cc
@@ -63,7 +63,7 @@ void COMMON_COMPONENT::attach_common(COMMON_COMPONENT*c, COMMON_COMPONENT**to)
assert(to);
if (c == *to) {
// The new and old are the same object. Do nothing.
- }else if (!c) {untested();
+ }else if (!c) {
// There is no new common. probably a simple element
detach_common(to);
}else if (!*to) {
@@ -227,7 +227,7 @@ void COMMON_COMPONENT::set_param_by_index(int i, std::string& Value, int Offset)
switch (i) {
case 0:untested(); _tnom_c = Value; break;
case 1:untested(); _dtemp = Value; break;
- case 2:untested(); _temp_c = Value; break;
+ case 2:itested(); _temp_c = Value; break;
case 3: _mfactor = Value; break;
default:untested(); throw Exception_Too_Many(i, 3, Offset); break;
}
@@ -240,32 +240,32 @@ bool COMMON_COMPONENT::param_is_printable(int i)const
case 1: return _dtemp.has_hard_value();
case 2: return _temp_c.has_hard_value();
case 3: return _mfactor.has_hard_value();
- default:untested(); return false;
+ default: return false;
}
}
/*--------------------------------------------------------------------------*/
std::string COMMON_COMPONENT::param_name(int i)const
{
switch (i) {
- case 0:untested(); return "tnom";
- case 1:untested(); return "dtemp";
- case 2:untested(); return "temp";
+ case 0:itested(); return "tnom";
+ case 1:itested(); return "dtemp";
+ case 2:itested(); return "temp";
case 3: return "m";
default:untested(); return "";
}
}
/*--------------------------------------------------------------------------*/
std::string COMMON_COMPONENT::param_name(int i, int j)const
-{untested();
+{itested();
return (j==0) ? param_name(i) : "";
}
/*--------------------------------------------------------------------------*/
std::string COMMON_COMPONENT::param_value(int i)const
{
switch (i) {
- case 0:untested(); return _tnom_c.string();
- case 1:untested(); return _dtemp.string();
- case 2:untested(); return _temp_c.string();
+ case 0:itested(); return _tnom_c.string();
+ case 1:itested(); return _dtemp.string();
+ case 2:itested(); return _temp_c.string();
case 3: return _mfactor.string();
default:untested(); return "";
}
@@ -304,29 +304,30 @@ bool COMMON_COMPONENT::operator==(const COMMON_COMPONENT& x)const
&& _value == x._value);
}
/*--------------------------------------------------------------------------*/
-void COMMON_COMPONENT::set_param_by_name(std::string Name, std::string Value)
+int COMMON_COMPONENT::set_param_by_name(std::string Name, std::string Value)
{
- if (has_parse_params_obsolete_callback()) {untested();
+ if (has_parse_params_obsolete_callback()) {itested();
std::string args(Name + "=" + Value);
CS cmd(CS::_STRING, args); //obsolete_callback
bool ok = parse_params_obsolete_callback(cmd); //BUG//callback
if (!ok) {untested();
throw Exception_No_Match(Name);
- }else{untested();
+ }else{itested();
}
+ return 0;
}else{
//BUG// ugly linear search
for (int i = param_count() - 1; i >= 0; --i) {
for (int j = 0; param_name(i,j) != ""; ++j) {
if (Umatch(Name, param_name(i,j) + ' ')) {
set_param_by_index(i, Value, 0/*offset*/);
- return; //success
+ return i; //success
}else{
//keep looking
}
}
}
- untested();
+ itested();
throw Exception_No_Match(Name);
}
}
@@ -334,7 +335,7 @@ void COMMON_COMPONENT::set_param_by_name(std::string Name, std::string Value)
//BUG// This is a kluge for the spice_wrapper, to disable virtual functions.
// It is called during expansion only.
-void COMMON_COMPONENT::Set_param_by_name(std::string Name, std::string Value)
+int COMMON_COMPONENT::Set_param_by_name(std::string Name, std::string Value)
{untested();
assert(!has_parse_params_obsolete_callback());
@@ -343,7 +344,7 @@ void COMMON_COMPONENT::Set_param_by_name(std::string Name, std::string Value)
for (int j = 0; COMMON_COMPONENT::param_name(i,j) != ""; ++j) {untested();
if (Umatch(Name, COMMON_COMPONENT::param_name(i,j) + ' ')) {untested();
COMMON_COMPONENT::set_param_by_index(i, Value, 0/*offset*/);
- return; //success
+ return i; //success
}else{untested();
//keep looking
}
@@ -369,10 +370,9 @@ bool COMMON_COMPONENT::parse_params_obsolete_callback(CS& cmd)
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-COMPONENT::COMPONENT()
+COMPONENT::COMPONENT(COMMON_COMPONENT* c)
:CARD(),
_common(0),
- _value(0),
_mfactor(1),
_mfactor_fixed(NOT_VALID),
_converged(false),
@@ -383,12 +383,13 @@ COMPONENT::COMPONENT()
_sim->uninit();
}else{
}
+ attach_common(c);
+ assert(_common == c);
}
/*--------------------------------------------------------------------------*/
COMPONENT::COMPONENT(const COMPONENT& p)
:CARD(p),
_common(0),
- _value(p._value),
_mfactor(p._mfactor),
_mfactor_fixed(p._mfactor_fixed),
_converged(p._converged),
@@ -428,16 +429,16 @@ bool COMPONENT::node_is_connected(int i)const
return _n[i].is_connected();
}
/*--------------------------------------------------------------------------*/
-void COMPONENT::set_port_by_name(std::string& int_name, std::string& ext_name)
+int COMPONENT::set_port_by_name(std::string& int_name, std::string& ext_name)
{
for (int i=0; i<max_nodes(); ++i) {
if (int_name == port_name(i)) {
set_port_by_index(i, ext_name);
- return;
+ return i;
}else{
}
}
- untested();
+ itested();
throw Exception_No_Match(int_name);
}
/*--------------------------------------------------------------------------*/
@@ -514,6 +515,7 @@ void COMPONENT::expand()
COMMON_COMPONENT* deflated_common = new_common->deflate();
if (deflated_common != common()) {
attach_common(deflated_common);
+ trace1("done attach", deflated_common);
}else{untested();
}
}else{
@@ -557,8 +559,6 @@ void COMPONENT::precalc_last()
}
}else{
}
-
- _value.e_val(0.,scope());
}
/*--------------------------------------------------------------------------*/
void COMPONENT::map_nodes()
@@ -585,7 +585,7 @@ void COMPONENT::tr_iwant_matrix()
assert(matrix_nodes() == 0);
if (subckt()) {
subckt()->tr_iwant_matrix();
- }else{untested();
+ }else{itested();
}
}else{
}
@@ -597,7 +597,7 @@ void COMPONENT::ac_iwant_matrix()
assert(matrix_nodes() == 0);
if (subckt()) {
subckt()->ac_iwant_matrix();
- }else{untested();
+ }else{itested();
}
}else{
}
@@ -612,7 +612,7 @@ void COMPONENT::set_parameters(const std::string& Label, CARD *Owner,
{
set_label(Label);
set_owner(Owner);
- set_value(Value);
+ obsolete_set_value(Value);
attach_common(Common);
assert(node_count <= net_nodes());
@@ -630,39 +630,29 @@ void COMPONENT::set_slave()
}
}
/*--------------------------------------------------------------------------*/
-void COMPONENT::set_value(double v, COMMON_COMPONENT* c)
-{
- if (c != _common) {
- detach_common();
- attach_common(c);
- }else{
- }
- set_value(v);
-}
-/*--------------------------------------------------------------------------*/
-void COMPONENT::set_param_by_name(std::string Name, std::string Value)
+int COMPONENT::set_param_by_name(std::string Name, std::string Value)
{
if (has_common()) {
COMMON_COMPONENT* c = common()->clone();
assert(c);
- c->set_param_by_name(Name, Value);
+ int index = c->set_param_by_name(Name, Value);
attach_common(c);
+ return index;
}else{
- CARD::set_param_by_name(Name, Value);
+ return CARD::set_param_by_name(Name, Value);
}
}
/*--------------------------------------------------------------------------*/
void COMPONENT::set_param_by_index(int i, std::string& Value, int offset)
{
- if (has_common()) {untested();
+ if (has_common()) {itested();
COMMON_COMPONENT* c = common()->clone();
assert(c);
c->set_param_by_index(i, Value, offset);
attach_common(c);
}else{
switch (COMPONENT::param_count() - 1 - i) {
- case 0: _value = Value; break;
- case 1:untested(); _mfactor = Value; break;
+ case 0:itested(); _mfactor = Value; break;
default:untested(); CARD::set_param_by_index(i, Value, offset);
}
}
@@ -674,9 +664,8 @@ bool COMPONENT::param_is_printable(int i)const
return common()->param_is_printable(i);
}else{
switch (COMPONENT::param_count() - 1 - i) {
- case 0: return value().has_hard_value();
- case 1: return _mfactor.has_hard_value();
- default:untested(); return CARD::param_is_printable(i);
+ case 0: return _mfactor.has_hard_value();
+ default: return CARD::param_is_printable(i);
}
}
}
@@ -687,21 +676,21 @@ std::string COMPONENT::param_name(int i)const
return common()->param_name(i);
}else{
switch (COMPONENT::param_count() - 1 - i) {
- case 0: return value_name();
- case 1: return "m";
- default:untested(); return CARD::param_name(i);
+ case 0: return "m";
+ default:itested(); return CARD::param_name(i);
}
}
}
/*--------------------------------------------------------------------------*/
std::string COMPONENT::param_name(int i, int j)const
{
+ trace3("COMPONENT::param_name", long_label(), i, j);
if (has_common()) {untested();
return common()->param_name(i,j);
}else{
if (j == 0) {
return param_name(i);
- }else if (i >= CARD::param_count()) {untested();
+ }else if (i >= CARD::param_count()) {itested();
return "";
}else{untested();
return CARD::param_name(i,j);
@@ -715,8 +704,7 @@ std::string COMPONENT::param_value(int i)const
return common()->param_value(i);
}else{
switch (COMPONENT::param_count() - 1 - i) {
- case 0: return value().string();
- case 1: return _mfactor.string();
+ case 0: return _mfactor.string();
default:untested(); return CARD::param_value(i);
}
}
@@ -826,7 +814,7 @@ void COMPONENT::q_eval()
if(!is_q_for_eval()) {
mark_q_for_eval();
_sim->_evalq_uc->push_back(this);
- }else{untested();
+ }else{itested();
}
}
/*--------------------------------------------------------------------------*/
@@ -874,13 +862,6 @@ bool COMPONENT::use_obsolete_callback_print()const
}
}
/*--------------------------------------------------------------------------*/
-void COMPONENT::obsolete_move_parameters_from_common(const COMMON_COMPONENT* dc)
-{
- assert(dc);
- _value = dc->value();
- _mfactor = dc->mfactor();
-}
-/*--------------------------------------------------------------------------*/
/* volts_limited: transient voltage, best approximation, with limiting
*/
double COMPONENT::volts_limited(const node_t & n1, const node_t & n2)
@@ -912,12 +893,15 @@ double COMPONENT::volts_limited(const node_t & n1, const node_t & n2)
if (OPT::dampstrategy & dsRANGE) {
_sim->_fulldamp = true;
error(bTRACE, "range limit damp\n");
+ }else{
}
- if (OPT::picky <= bTRACE) {untested();
+ if (OPT::picky <= bTRACE) {itested();
error(bNOERROR,"node limiting (n1,n2,dif) "
"was (%g %g %g) now (%g %g %g)\n",
n1.v0(), n2.v0(), n1.v0() - n2.v0(), v1, v2, v1-v2);
+ }else{
}
+ }else{
}
return dn_diff(v1,v2);
diff --git a/lib/e_elemnt.cc b/lib/e_elemnt.cc
index 7fce217d..4e8fd0f6 100644
--- a/lib/e_elemnt.cc
+++ b/lib/e_elemnt.cc
@@ -27,8 +27,9 @@
#include "e_aux.h"
#include "e_elemnt.h"
/*--------------------------------------------------------------------------*/
-ELEMENT::ELEMENT()
- :COMPONENT(),
+ELEMENT::ELEMENT(COMMON_COMPONENT* c)
+ :COMPONENT(c),
+ _value(0),
_loaditer(0),
_m0(),
_m1(),
@@ -47,6 +48,7 @@ ELEMENT::ELEMENT()
/*--------------------------------------------------------------------------*/
ELEMENT::ELEMENT(const ELEMENT& p)
:COMPONENT(p),
+ _value(p._value),
_loaditer(0),
_m0(),
_m1(),
@@ -72,6 +74,106 @@ ELEMENT::ELEMENT(const ELEMENT& p)
notstd::copy_n(p._time, int(OPT::_keep_time_steps), _time);
}
/*--------------------------------------------------------------------------*/
+void ELEMENT::set_value(double v, COMMON_COMPONENT* c)
+{
+ if (c != common()) {
+ detach_common();
+ attach_common(c);
+ }else{
+ }
+ set_value(v);
+}
+/*--------------------------------------------------------------------------*/
+int ELEMENT::set_param_by_name(std::string Name, std::string Value)
+{
+ if(Name == value_name()){
+ _value = Value;
+ return ELEMENT::param_count() - 1;
+ }else if (has_common()) {
+ COMMON_COMPONENT* c = common()->clone();
+ assert(c);
+ int index = c->set_param_by_name(Name, Value);
+ attach_common(c);
+ return index;
+ }else{
+ return COMPONENT::set_param_by_name(Name, Value);
+ }
+}
+/*--------------------------------------------------------------------------*/
+void ELEMENT::set_param_by_index(int i, std::string& Value, int offset)
+{
+ if (has_common()) {untested();
+ COMMON_COMPONENT* c = common()->clone();
+ assert(c);
+ c->set_param_by_index(i, Value, offset);
+ attach_common(c);
+ }else{
+ switch (ELEMENT::param_count() - 1 - i) {
+ case 0:
+ _value = Value; break;
+ default: itested();
+ COMPONENT::set_param_by_index(i, Value, offset);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+bool ELEMENT::param_is_printable(int i)const
+{
+ if (has_common()) {
+ return common()->param_is_printable(i);
+ }else{
+ switch (ELEMENT::param_count() - 1 - i) {
+ case 0:
+ return value().has_hard_value();
+ default:
+ return COMPONENT::param_is_printable(i);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string ELEMENT::param_name(int i)const
+{
+ if (has_common()) {
+ return common()->param_name(i);
+ }else{
+ switch (ELEMENT::param_count() - 1 - i) {
+ case 0: return value_name();
+ default:
+ return COMPONENT::param_name(i);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string ELEMENT::param_name(int i, int j)const
+{
+ if (has_common()) {untested();
+ return common()->param_name(i,j);
+ }else{ itested();
+ if (j == 0) { itested();
+ return param_name(i);
+ }else if (i >= ELEMENT::param_count()) {untested();
+ return "";
+ }else{itested();
+ return COMPONENT::param_name(i,j);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string ELEMENT::param_value(int i)const
+{
+ if (has_common()) {
+ return common()->param_value(i);
+ }else{
+ switch (ELEMENT::param_count() - 1 - i) {
+ case 0:
+ return value().string();
+ default:
+ return COMPONENT::param_value(i);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
bool ELEMENT::skip_dev_type(CS& cmd)
{
return cmd.umatch(dev_type() + ' ');
@@ -80,15 +182,7 @@ bool ELEMENT::skip_dev_type(CS& cmd)
void ELEMENT::precalc_last()
{
COMPONENT::precalc_last();
-
- //BUG// This is needed for AC analysis without doing op (or dc or tran ...) first.
- // Something like it should be moved to ac_begin.
- if (_sim->has_op() == s_NONE) {
- _y[0].x = 0.;
- _y[0].f0 = LINEAR;
- _y[0].f1 = value();
- }else{
- }
+ _value.e_val(0.,scope());
}
/*--------------------------------------------------------------------------*/
void ELEMENT::tr_begin()
@@ -105,6 +199,16 @@ void ELEMENT::tr_begin()
_dt = NOT_VALID;
}
/*--------------------------------------------------------------------------*/
+void ELEMENT::ac_begin()
+{
+ if (_sim->has_op() == s_NONE) {
+ _y[0].x = 0.;
+ _y[0].f0 = LINEAR;
+ _y[0].f1 = value();
+ }else{
+ }
+}
+/*--------------------------------------------------------------------------*/
void ELEMENT::tr_restore()
{
if (_time[0] > _sim->_time0) {untested();
@@ -317,7 +421,7 @@ double ELEMENT::tr_probe_num(const std::string& x)const
return _y[0].f1;
}else if (Umatch(x, "nv ")) {
return value();
- }else if (Umatch(x, "eiv ")) {untested();
+ }else if (Umatch(x, "eiv ")) {
return _m0.x;
}else if (Umatch(x, "y ")) {
return _m0.c1;
@@ -488,5 +592,13 @@ double ELEMENT::tr_review_check_and_convert(double timestep)
return time_future;
}
/*--------------------------------------------------------------------------*/
+void ELEMENT::obsolete_move_parameters_from_common(const COMMON_COMPONENT* dc)
+{
+ assert(dc);
+
+ _value = dc->value();
+ _mfactor = dc->mfactor();
+}
+/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// vim:ts=8:sw=2:noet:
diff --git a/lib/e_logicnode.cc b/lib/e_logicnode.cc
new file mode 100644
index 00000000..57ea31e6
--- /dev/null
+++ b/lib/e_logicnode.cc
@@ -0,0 +1,325 @@
+/*$Id: e_logicnode.cc $ -*- C++ -*-
+ * Copyright (C) 2001 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * node probes
+ */
+//testing=script,sparse 2006.07.11
+#include "e_logicmod.h"
+#include "e_logicnode.h"
+/*--------------------------------------------------------------------------*/
+LOGIC_NODE::LOGIC_NODE()
+ :NODE(),
+ _family(0),
+ _d_iter(-1), // initially d_iter is older than a_iter
+ _a_iter(0),
+ _final_time(0),
+ _lastchange(0),
+ _old_lastchange(0),
+ _mode(moANALOG),
+ _lv(),
+ _old_lv(),
+ _quality(qBAD),
+ _failure_mode("initial")
+{
+}
+/*--------------------------------------------------------------------------*/
+double LOGIC_NODE::tr_probe_num(const std::string& x)const
+{
+ if (Umatch(x, "l{ogic} ")) {
+ return annotated_logic_value();
+ }else if (Umatch(x, "la{stchange} ")) {
+ return _lastchange;
+ }else if (Umatch(x, "fi{naltime} ")) {
+ return final_time();
+ }else if (Umatch(x, "di{ter} ")) {untested();
+ return static_cast<double>(_d_iter);
+ }else if (Umatch(x, "ai{ter} ")) {untested();
+ return static_cast<double>(_a_iter);
+ }else{
+ return NODE::tr_probe_num(x);
+ }
+}
+/*--------------------------------------------------------------------------*/
+/* annotated_logic_value: a printable value for probe
+ * that has secondary info encoded in its fraction part
+ */
+double LOGIC_NODE::annotated_logic_value()const
+{
+ return (_lv + (.1 * (OPT::transits - quality())) + (.01 * (2 - _mode)));
+}
+/*--------------------------------------------------------------------------*/
+static bool newly_stable[lvUNKNOWN+1][lvUNKNOWN+1] = { // oldlv, _lv
+ /* s0 rise fall s1 u */
+ /* s0 */{false, false, false, true, false},
+ /*rise*/{false, false, false, true, false},
+ /*fall*/{true, false, false, false, false},
+ /* s1 */{true, false, false, false, false},
+ /* u */{true, false, false, true, false}
+};
+/*--------------------------------------------------------------------------*/
+inline bool LOGIC_NODE::just_reached_stable()const
+{
+ return newly_stable[old_lv()][lv()];
+}
+/*--------------------------------------------------------------------------*/
+/* to_logic: set up logic data for a node, if needed
+ * If the logic data is already up to date, do nothing.
+ * else set up: logic value (_lv) and quality.
+ * Use and update _d_iter, _lastchange to keep track of what was done.
+ */
+void LOGIC_NODE::to_logic(const MODEL_LOGIC*f)
+{
+ assert(f);
+ if (process() && process() != f) {untested();
+ set_bad_quality("logic process mismatch");
+ error(bWARNING, "node " + long_label()
+ + " logic process mismatch\nis it " + process()->long_label()
+ + " or " + f->long_label() + "?\n");
+ }
+ set_process(f);
+
+ if (is_analog() && d_iter() < a_iter()) {
+ if (_sim->analysis_is_restore()) {untested();
+ }else if (_sim->analysis_is_static()) {
+ }else{
+ }
+ if (_sim->analysis_is_static() || _sim->analysis_is_restore()) {
+ set_last_change_time(0);
+ store_old_last_change_time();
+ set_lv(lvUNKNOWN);
+ }else{
+ }
+ double dt = _sim->_time0 - last_change_time();
+ if (dt < 0.) {untested();
+ error(bPICKY, "time moving backwards. was %g, now %g\n",
+ last_change_time(), _sim->_time0);
+ dt = _sim->_time0 - old_last_change_time();
+ if (dt <= 0.) {untested();
+ throw Exception("internal error: time moving backwards, can't recover");
+ }else{untested();
+ }
+ assert(dt > 0.);
+ set_lv(old_lv()); /* skip back one */
+ }else{
+ store_old_last_change_time();
+ store_old_lv(); /* save to see if it changes */
+ }
+
+ double sv = v0() / process()->range; /* new scaled voltage */
+ if (sv >= process()->th1) { /* logic 1 */
+ switch (lv()) {
+ case lvSTABLE0: dont_set_quality("stable 0 to stable 1"); break;
+ case lvRISING: dont_set_quality("begin stable 1"); break;
+ case lvFALLING:untested();set_bad_quality("falling to stable 1"); break;
+ case lvSTABLE1: dont_set_quality("continuing stable 1"); break;
+ case lvUNKNOWN: set_good_quality("initial 1"); break;
+ }
+ set_lv(lvSTABLE1);
+ }else if (sv <= process()->th0) { /* logic 0 */
+ switch (lv()) {
+ case lvSTABLE0: dont_set_quality("continuing stable 0"); break;
+ case lvRISING: untested();set_bad_quality("rising to stable 0"); break;
+ case lvFALLING: dont_set_quality("begin stable 0"); break;
+ case lvSTABLE1: dont_set_quality("stable 1 to stable 0"); break;
+ case lvUNKNOWN: set_good_quality("initial 0"); break;
+ }
+ set_lv(lvSTABLE0);
+ }else{ /* transition region */
+ double oldsv = vt1() / process()->range;/* old scaled voltage */
+ double diff = sv - oldsv;
+ if (diff > 0) { /* rising */
+ switch (lv()) {
+ case lvSTABLE0:
+ dont_set_quality("begin good rise");
+ break;
+ case lvRISING:
+ if (diff < dt/(process()->mr * process()->rise)) {
+ set_bad_quality("slow rise");
+ }else{
+ dont_set_quality("continuing good rise");
+ }
+ break;
+ case lvFALLING:
+ untested();
+ set_bad_quality("positive glitch in fall");
+ break;
+ case lvSTABLE1:
+ untested();
+ set_bad_quality("negative glitch in 1");
+ break;
+ case lvUNKNOWN:
+ set_bad_quality("initial rise");
+ break;
+ }
+ set_lv(lvRISING);
+ }else if (diff < 0) { /* falling */
+ switch (lv()) {
+ case lvSTABLE0:
+ untested();
+ set_bad_quality("positive glitch in 0");
+ break;
+ case lvRISING:
+ set_bad_quality("negative glitch in rise");
+ break;
+ case lvFALLING:
+ if (-diff < dt/(process()->mf * process()->fall)) {
+ set_bad_quality("slow fall");
+ }else{
+ dont_set_quality("continuing good fall");
+ }
+ break;
+ case lvSTABLE1:
+ dont_set_quality("begin good fall");
+ break;
+ case lvUNKNOWN:
+ untested();
+ set_bad_quality("initial fall");
+ break;
+ }
+ set_lv(lvFALLING);
+ }else{ /* hanging up in transition */
+ untested();
+ error(bDANGER, "inflection???\n");
+ set_bad_quality("in transition but no change");
+ /* state (rise/fall) unchanged */
+ }
+ }
+ if (sv > 1.+process()->over || sv < -process()->over) {/* out of range */
+ set_bad_quality("out of range");
+ }
+ if (just_reached_stable()) { /* A bad node gets a little better */
+ improve_quality(); /* on every good transition. */
+ } /* Eventually, it is good enough. */
+ /* A good transition is defined as */
+ /* entering a stable state from */
+ /* a transition state. */
+ set_d_iter();
+ set_last_change_time();
+ trace3(_failure_mode.c_str(), _lastchange, _quality, _lv);
+ }
+}
+/*--------------------------------------------------------------------------*/
+double LOGIC_NODE::to_analog(const MODEL_LOGIC* f)
+{
+ assert(f);
+ if (process() && process() != f) {untested();
+ error(bWARNING, "node " + long_label()
+ + " logic process mismatch\nis it " + process()->long_label()
+ + " or " + f->long_label() + "?\n");
+ }
+ set_process(f);
+
+ double start = NOT_VALID;
+ double end = NOT_VALID;
+ double risefall = NOT_VALID;
+ switch (lv()) {
+ case lvSTABLE0:
+ return process()->vmin;
+ case lvRISING:
+ start = process()->vmin;
+ end = process()->vmax;
+ risefall = process()->rise;
+ break;
+ case lvFALLING:
+ start = process()->vmax;
+ end = process()->vmin;
+ risefall = process()->fall;
+ break;
+ case lvSTABLE1:
+ return process()->vmax;
+ case lvUNKNOWN:
+ return process()->unknown;
+ }
+ assert(start != NOT_VALID);
+ assert(end != NOT_VALID);
+ assert(risefall != NOT_VALID);
+
+ if (_sim->_time0 <= (final_time()-risefall)) {
+ return start;
+ }else if (_sim->_time0 >= final_time()) {
+ untested();
+ return end;
+ }else{
+ return end - ((end-start) * (final_time()-_sim->_time0) / risefall);
+ }
+}
+/*--------------------------------------------------------------------------*/
+void LOGIC_NODE::propagate()
+{
+ assert(in_transit());
+ if (lv().is_rising()) {
+ set_lv(lvSTABLE1);
+ }else if (lv().is_falling()) {
+ set_lv(lvSTABLE0);
+ }else{
+ // lv no change
+ }
+ set_d_iter();
+ set_final_time(NEVER);
+ set_last_change_time();
+ assert(!(in_transit()));
+}
+/*--------------------------------------------------------------------------*/
+void LOGIC_NODE::unpropagate()
+{
+ set_final_time(last_change_time());
+ set_last_change_time(old_last_change_time());
+ set_lv(old_lv());
+ set_d_iter();
+}
+/*--------------------------------------------------------------------------*/
+void LOGIC_NODE::force_initial_value(LOGICVAL v)
+{
+ if (_sim->analysis_is_restore()) {untested();
+ }else if (_sim->analysis_is_static()) {
+ }else{untested();
+ }
+ assert(_sim->analysis_is_static() || _sim->analysis_is_restore());
+ assert(_sim->_time0 == 0.);
+ assert(is_unknown());
+ assert(is_digital());
+ set_lv(v); // BUG ??
+ set_good_quality("initial dc");
+ set_d_iter();
+ set_final_time(NEVER);
+ set_last_change_time();
+}
+/*--------------------------------------------------------------------------*/
+void LOGIC_NODE::set_event(double delay, LOGICVAL v)
+{
+ _lv.set_in_transition(v);
+ if (_sim->analysis_is_tran_dynamic() && in_transit()) {
+ set_bad_quality("race");
+ }else{
+ // normal good quality event
+ // leaving quality as it was
+ }
+ set_d_iter();
+ set_final_time(_sim->_time0 + delay);
+ if (OPT::picky <= bTRACE) {
+ error(bTRACE, "%s:%u:%g new event\n",
+ long_label().c_str(), d_iter(), final_time());
+ }
+ set_last_change_time();
+}
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+// vim:ts=8:sw=2:noet:
diff --git a/lib/e_logicval.cc b/lib/e_logicval.cc
new file mode 100644
index 00000000..bfa0bb9c
--- /dev/null
+++ b/lib/e_logicval.cc
@@ -0,0 +1,64 @@
+/*$Id: e_logicval.cc $ -*- C++ -*-
+ * Copyright (C) 2001 Albert Davis
+ * Author: Albert Davis <[email protected]>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program 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, or (at your option)
+ * any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ * node probes
+ */
+//testing=none
+#include "e_logicval.h"
+/*--------------------------------------------------------------------------*/
+const _LOGICVAL LOGICVAL::or_truth[lvNUM_STATES][lvNUM_STATES] = {
+ {lvSTABLE0, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
+ {lvRISING, lvRISING, lvRISING, lvSTABLE1, lvRISING},
+ {lvFALLING, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
+ {lvSTABLE1, lvSTABLE1, lvSTABLE1, lvSTABLE1, lvSTABLE1},
+ {lvUNKNOWN, lvRISING, lvUNKNOWN, lvSTABLE1, lvUNKNOWN}
+};
+/*--------------------------------------------------------------------------*/
+const _LOGICVAL LOGICVAL::xor_truth[lvNUM_STATES][lvNUM_STATES] = {
+ {lvSTABLE0, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
+ {lvRISING, lvFALLING, lvRISING, lvFALLING, lvUNKNOWN},
+ {lvFALLING, lvRISING, lvFALLING, lvRISING, lvUNKNOWN},
+ {lvSTABLE1, lvFALLING, lvRISING, lvSTABLE0, lvUNKNOWN},
+ {lvUNKNOWN, lvUNKNOWN, lvUNKNOWN, lvUNKNOWN, lvUNKNOWN}
+};
+/*--------------------------------------------------------------------------*/
+const _LOGICVAL LOGICVAL::and_truth[lvNUM_STATES][lvNUM_STATES] = {
+ {lvSTABLE0, lvSTABLE0, lvSTABLE0, lvSTABLE0, lvSTABLE0},
+ {lvSTABLE0, lvRISING, lvFALLING, lvRISING, lvUNKNOWN},
+ {lvSTABLE0, lvFALLING, lvFALLING, lvFALLING, lvFALLING},
+ {lvSTABLE0, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
+ {lvSTABLE0, lvUNKNOWN, lvFALLING, lvUNKNOWN, lvUNKNOWN}
+};
+/*--------------------------------------------------------------------------*/
+const _LOGICVAL LOGICVAL::not_truth[lvNUM_STATES] = {
+ lvSTABLE1, lvFALLING, lvRISING, lvSTABLE0, lvUNKNOWN
+};
+/*--------------------------------------------------------------------------*/
+const _LOGICVAL LOGICVAL::prop_truth[lvNUM_STATES][lvNUM_STATES] = {
+ {lvSTABLE0, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN},
+ {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN},
+ {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN},
+ {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvSTABLE1, lvUNKNOWN},
+ {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN}
+};
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+// vim:ts=8:sw=2:noet:
diff --git a/lib/e_node.cc b/lib/e_node.cc
index 85a3552e..6b7be319 100644
--- a/lib/e_node.cc
+++ b/lib/e_node.cc
@@ -22,69 +22,12 @@
* node probes
*/
//testing=script,sparse 2006.07.11
+#include "e_cardlist.h"
+#include "e_card.h"
#include "u_nodemap.h"
-#include "d_logic.h"
#include "e_aux.h"
#include "u_xprobe.h"
-/*--------------------------------------------------------------------------*/
-const _LOGICVAL LOGICVAL::or_truth[lvNUM_STATES][lvNUM_STATES] = {
- {lvSTABLE0, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
- {lvRISING, lvRISING, lvRISING, lvSTABLE1, lvRISING},
- {lvFALLING, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
- {lvSTABLE1, lvSTABLE1, lvSTABLE1, lvSTABLE1, lvSTABLE1},
- {lvUNKNOWN, lvRISING, lvUNKNOWN, lvSTABLE1, lvUNKNOWN}
-};
-/*--------------------------------------------------------------------------*/
-const _LOGICVAL LOGICVAL::xor_truth[lvNUM_STATES][lvNUM_STATES] = {
- {lvSTABLE0, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
- {lvRISING, lvFALLING, lvRISING, lvFALLING, lvUNKNOWN},
- {lvFALLING, lvRISING, lvFALLING, lvRISING, lvUNKNOWN},
- {lvSTABLE1, lvFALLING, lvRISING, lvSTABLE0, lvUNKNOWN},
- {lvUNKNOWN, lvUNKNOWN, lvUNKNOWN, lvUNKNOWN, lvUNKNOWN}
-};
-/*--------------------------------------------------------------------------*/
-const _LOGICVAL LOGICVAL::and_truth[lvNUM_STATES][lvNUM_STATES] = {
- {lvSTABLE0, lvSTABLE0, lvSTABLE0, lvSTABLE0, lvSTABLE0},
- {lvSTABLE0, lvRISING, lvFALLING, lvRISING, lvUNKNOWN},
- {lvSTABLE0, lvFALLING, lvFALLING, lvFALLING, lvFALLING},
- {lvSTABLE0, lvRISING, lvFALLING, lvSTABLE1, lvUNKNOWN},
- {lvSTABLE0, lvUNKNOWN, lvFALLING, lvUNKNOWN, lvUNKNOWN}
-};
-/*--------------------------------------------------------------------------*/
-const _LOGICVAL LOGICVAL::not_truth[lvNUM_STATES] = {
- lvSTABLE1, lvFALLING, lvRISING, lvSTABLE0, lvUNKNOWN
-};
-/*--------------------------------------------------------------------------*/
-static _LOGICVAL prop_truth[lvNUM_STATES][lvNUM_STATES] = {
- {lvSTABLE0, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN},
- {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN},
- {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN},
- {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvSTABLE1, lvUNKNOWN},
- {lvFALLING, lvUNKNOWN, lvUNKNOWN, lvRISING, lvUNKNOWN}
-};
-/*--------------------------------------------------------------------------*/
-inline LOGICVAL& LOGICVAL::set_in_transition(LOGICVAL newval)
-{
- _lv = prop_truth[_lv][newval];
- assert(_lv != lvUNKNOWN);
- return *this;
-}
-/*--------------------------------------------------------------------------*/
-LOGIC_NODE::LOGIC_NODE()
- :NODE(),
- _family(0),
- _d_iter(-1), // initially d_iter is older than a_iter
- _a_iter(0),
- _final_time(0),
- _lastchange(0),
- _old_lastchange(0),
- _mode(moANALOG),
- _lv(),
- _old_lv(),
- _quality(qBAD),
- _failure_mode("initial")
-{
-}
+#include "e_logicnode.h"
/*--------------------------------------------------------------------------*/
/* default constructor : unconnected, don't use
*/
@@ -208,23 +151,6 @@ double NODE::tr_probe_num(const std::string& x)const
}
}
/*--------------------------------------------------------------------------*/
-double LOGIC_NODE::tr_probe_num(const std::string& x)const
-{
- if (Umatch(x, "l{ogic} ")) {
- return annotated_logic_value();
- }else if (Umatch(x, "la{stchange} ")) {
- return _lastchange;
- }else if (Umatch(x, "fi{naltime} ")) {
- return final_time();
- }else if (Umatch(x, "di{ter} ")) {untested();
- return static_cast<double>(_d_iter);
- }else if (Umatch(x, "ai{ter} ")) {untested();
- return static_cast<double>(_a_iter);
- }else{
- return NODE::tr_probe_num(x);
- }
-}
-/*--------------------------------------------------------------------------*/
XPROBE NODE::ac_probe_ext(const std::string& x)const
{
if (Umatch(x, "v ")) {
@@ -237,269 +163,6 @@ XPROBE NODE::ac_probe_ext(const std::string& x)const
}
}
/*--------------------------------------------------------------------------*/
-/* annotated_logic_value: a printable value for probe
- * that has secondary info encoded in its fraction part
- */
-double LOGIC_NODE::annotated_logic_value()const
-{
- return (_lv + (.1 * (OPT::transits - quality())) + (.01 * (2 - _mode)));
-}
-/*--------------------------------------------------------------------------*/
-static bool newly_stable[lvUNKNOWN+1][lvUNKNOWN+1] = { // oldlv, _lv
- /* s0 rise fall s1 u */
- /* s0 */{false, false, false, true, false},
- /*rise*/{false, false, false, true, false},
- /*fall*/{true, false, false, false, false},
- /* s1 */{true, false, false, false, false},
- /* u */{true, false, false, true, false}
-};
-/*--------------------------------------------------------------------------*/
-inline bool LOGIC_NODE::just_reached_stable()const
-{
- return newly_stable[old_lv()][lv()];
-}
-/*--------------------------------------------------------------------------*/
-/* to_logic: set up logic data for a node, if needed
- * If the logic data is already up to date, do nothing.
- * else set up: logic value (_lv) and quality.
- * Use and update _d_iter, _lastchange to keep track of what was done.
- */
-void LOGIC_NODE::to_logic(const MODEL_LOGIC*f)
-{
- assert(f);
- if (process() && process() != f) {untested();
- set_bad_quality("logic process mismatch");
- error(bWARNING, "node " + long_label()
- + " logic process mismatch\nis it " + process()->long_label()
- + " or " + f->long_label() + "?\n");
- }
- set_process(f);
-
- if (is_analog() && d_iter() < a_iter()) {
- if (_sim->analysis_is_restore()) {untested();
- }else if (_sim->analysis_is_static()) {
- }else{
- }
- if (_sim->analysis_is_static() || _sim->analysis_is_restore()) {
- set_last_change_time(0);
- store_old_last_change_time();
- set_lv(lvUNKNOWN);
- }else{
- }
- double dt = _sim->_time0 - last_change_time();
- if (dt < 0.) {untested();
- error(bPICKY, "time moving backwards. was %g, now %g\n",
- last_change_time(), _sim->_time0);
- dt = _sim->_time0 - old_last_change_time();
- if (dt <= 0.) {untested();
- throw Exception("internal error: time moving backwards, can't recover");
- }else{untested();
- }
- assert(dt > 0.);
- set_lv(old_lv()); /* skip back one */
- }else{
- store_old_last_change_time();
- store_old_lv(); /* save to see if it changes */
- }
-
- double sv = v0() / process()->range; /* new scaled voltage */
- if (sv >= process()->th1) { /* logic 1 */
- switch (lv()) {
- case lvSTABLE0: dont_set_quality("stable 0 to stable 1"); break;
- case lvRISING: dont_set_quality("begin stable 1"); break;
- case lvFALLING:untested();set_bad_quality("falling to stable 1"); break;
- case lvSTABLE1: dont_set_quality("continuing stable 1"); break;
- case lvUNKNOWN: set_good_quality("initial 1"); break;
- }
- set_lv(lvSTABLE1);
- }else if (sv <= process()->th0) { /* logic 0 */
- switch (lv()) {
- case lvSTABLE0: dont_set_quality("continuing stable 0"); break;
- case lvRISING: untested();set_bad_quality("rising to stable 0"); break;
- case lvFALLING: dont_set_quality("begin stable 0"); break;
- case lvSTABLE1: dont_set_quality("stable 1 to stable 0"); break;
- case lvUNKNOWN: set_good_quality("initial 0"); break;
- }
- set_lv(lvSTABLE0);
- }else{ /* transition region */
- double oldsv = vt1() / process()->range;/* old scaled voltage */
- double diff = sv - oldsv;
- if (diff > 0) { /* rising */
- switch (lv()) {
- case lvSTABLE0:
- dont_set_quality("begin good rise");
- break;
- case lvRISING:
- if (diff < dt/(process()->mr * process()->rise)) {
- set_bad_quality("slow rise");
- }else{
- dont_set_quality("continuing good rise");
- }
- break;
- case lvFALLING:
- untested();
- set_bad_quality("positive glitch in fall");
- break;
- case lvSTABLE1:
- untested();
- set_bad_quality("negative glitch in 1");
- break;
- case lvUNKNOWN:
- set_bad_quality("initial rise");
- break;
- }
- set_lv(lvRISING);
- }else if (diff < 0) { /* falling */
- switch (lv()) {
- case lvSTABLE0:
- untested();
- set_bad_quality("positive glitch in 0");
- break;
- case lvRISING:
- set_bad_quality("negative glitch in rise");
- break;
- case lvFALLING:
- if (-diff < dt/(process()->mf * process()->fall)) {
- set_bad_quality("slow fall");
- }else{
- dont_set_quality("continuing good fall");
- }
- break;
- case lvSTABLE1:
- dont_set_quality("begin good fall");
- break;
- case lvUNKNOWN:
- untested();
- set_bad_quality("initial fall");
- break;
- }
- set_lv(lvFALLING);
- }else{ /* hanging up in transition */
- untested();
- error(bDANGER, "inflection???\n");
- set_bad_quality("in transition but no change");
- /* state (rise/fall) unchanged */
- }
- }
- if (sv > 1.+process()->over || sv < -process()->over) {/* out of range */
- set_bad_quality("out of range");
- }
- if (just_reached_stable()) { /* A bad node gets a little better */
- improve_quality(); /* on every good transition. */
- } /* Eventually, it is good enough. */
- /* A good transition is defined as */
- /* entering a stable state from */
- /* a transition state. */
- set_d_iter();
- set_last_change_time();
- trace3(_failure_mode.c_str(), _lastchange, _quality, _lv);
- }
-}
-/*--------------------------------------------------------------------------*/
-double LOGIC_NODE::to_analog(const MODEL_LOGIC* f)
-{
- assert(f);
- if (process() && process() != f) {untested();
- error(bWARNING, "node " + long_label()
- + " logic process mismatch\nis it " + process()->long_label()
- + " or " + f->long_label() + "?\n");
- }
- set_process(f);
-
- double start = NOT_VALID;
- double end = NOT_VALID;
- double risefall = NOT_VALID;
- switch (lv()) {
- case lvSTABLE0:
- return process()->vmin;
- case lvRISING:
- start = process()->vmin;
- end = process()->vmax;
- risefall = process()->rise;
- break;
- case lvFALLING:
- start = process()->vmax;
- end = process()->vmin;
- risefall = process()->fall;
- break;
- case lvSTABLE1:
- return process()->vmax;
- case lvUNKNOWN:
- return process()->unknown;
- }
- assert(start != NOT_VALID);
- assert(end != NOT_VALID);
- assert(risefall != NOT_VALID);
-
- if (_sim->_time0 <= (final_time()-risefall)) {
- return start;
- }else if (_sim->_time0 >= final_time()) {
- untested();
- return end;
- }else{
- return end - ((end-start) * (final_time()-_sim->_time0) / risefall);
- }
-}
-/*--------------------------------------------------------------------------*/
-void LOGIC_NODE::propagate()
-{
- assert(in_transit());
- if (lv().is_rising()) {
- set_lv(lvSTABLE1);
- }else if (lv().is_falling()) {
- set_lv(lvSTABLE0);
- }else{
- // lv no change
- }
- set_d_iter();
- set_final_time(NEVER);
- set_last_change_time();
- assert(!(in_transit()));
-}
-/*--------------------------------------------------------------------------*/
-void LOGIC_NODE::unpropagate()
-{
- set_final_time(last_change_time());
- set_last_change_time(old_last_change_time());
- set_lv(old_lv());
- set_d_iter();
-}
-/*--------------------------------------------------------------------------*/
-void LOGIC_NODE::force_initial_value(LOGICVAL v)
-{
- if (_sim->analysis_is_restore()) {untested();
- }else if (_sim->analysis_is_static()) {
- }else{untested();
- }
- assert(_sim->analysis_is_static() || _sim->analysis_is_restore());
- assert(_sim->_time0 == 0.);
- assert(is_unknown());
- assert(is_digital());
- set_lv(v); // BUG ??
- set_good_quality("initial dc");
- set_d_iter();
- set_final_time(NEVER);
- set_last_change_time();
-}
-/*--------------------------------------------------------------------------*/
-void LOGIC_NODE::set_event(double delay, LOGICVAL v)
-{
- _lv.set_in_transition(v);
- if (_sim->analysis_is_tran_dynamic() && in_transit()) {
- set_bad_quality("race");
- }else{
- // normal good quality event
- // leaving quality as it was
- }
- set_d_iter();
- set_final_time(_sim->_time0 + delay);
- if (OPT::picky <= bTRACE) {
- error(bTRACE, "%s:%u:%g new event\n",
- long_label().c_str(), d_iter(), final_time());
- }
- set_last_change_time();
-}
-/*--------------------------------------------------------------------------*/
void node_t::set_to_ground(CARD* d)
{
//assert(!_nnn); //BUG// fails on MUTUAL_L::expand after clone
diff --git a/lib/e_paramlist.cc b/lib/e_paramlist.cc
index 4bc9226b..92fcdb52 100644
--- a/lib/e_paramlist.cc
+++ b/lib/e_paramlist.cc
@@ -49,7 +49,7 @@ std::string COMMON_PARAMLIST::param_name(int i)const
assert(i < COMMON_PARAMLIST::param_count());
if (i >= COMMON_COMPONENT::param_count()) {
return _params.name(COMMON_PARAMLIST::param_count() - 1 - i);
- }else{untested();
+ }else{itested();
return COMMON_COMPONENT::param_name(i);
}
}
@@ -71,7 +71,7 @@ std::string COMMON_PARAMLIST::param_value(int i)const
assert(i < COMMON_PARAMLIST::param_count());
if (i >= COMMON_COMPONENT::param_count()) {
return _params.value(COMMON_PARAMLIST::param_count() - 1 - i);
- }else{untested();
+ }else{itested();
return COMMON_COMPONENT::param_value(i);
}
}
diff --git a/lib/io_error.cc b/lib/io_error.cc
index 2c1102ab..10747b44 100644
--- a/lib/io_error.cc
+++ b/lib/io_error.cc
@@ -52,7 +52,7 @@ const std::string Exception_CS::message()const
if (_cursor < 40) {itested();
s = _cmd.substr(0,60)
+ '\n' + std::string(_cursor, ' ') + "^ ? " + Exception::message();
- }else{untested();
+ }else{itested();
s = "... " + _cmd.substr(_cursor-36, 56)
+ "\n ^ ? " + Exception::message();
}
diff --git a/lib/l_dispatcher.cc b/lib/l_dispatcher.cc
index 822956ae..a79b3fc4 100644
--- a/lib/l_dispatcher.cc
+++ b/lib/l_dispatcher.cc
@@ -48,20 +48,23 @@ CKT_BASE* DISPATCHER_BASE::operator[](std::string s)
/*--------------------------------------------------------------------------*/
void DISPATCHER_BASE::uninstall(CKT_BASE* p)
{
- assert(_map);
- for (typename std::map<std::string, CKT_BASE*>::iterator
- ii = _map->begin(); ii != _map->end(); ++ii) {
- if (ii->second == p) {
- ii->second = NULL;
- }else{
+ if(p){
+ assert(_map);
+ for (typename std::map<std::string, CKT_BASE*>::iterator
+ ii = _map->begin(); ii != _map->end(); ++ii) {
+ if (ii->second == p) {
+ ii->second = NULL;
+ }else{
+ }
}
- }
#if !defined(NDEBUG)
- for (typename std::map<std::string, CKT_BASE*>::iterator
- ii = _map->begin(); ii != _map->end(); ++ii) {
- assert(ii->second != p);
- }
+ for (typename std::map<std::string, CKT_BASE*>::iterator
+ ii = _map->begin(); ii != _map->end(); ++ii) {
+ assert(ii->second != p);
+ }
#endif
+ }else{ itested();
+ }
}
/*--------------------------------------------------------------------------*/
void DISPATCHER_BASE::check_init()
@@ -87,11 +90,11 @@ void DISPATCHER_BASE::install(const std::string& s, CKT_BASE* p)
trace2(name.c_str(), bss, ess);
if (name == "") {untested();
// quietly ignore empty string
- }else if ((*_map)[name]) {untested();
+ }else if ((*_map)[name]) {itested();
// duplicate .. stash the old one so we can get it back
error(bWARNING, name + ": already installed, replacing\n");
std::string save_name = name + ":0";
- for (int ii = 0; (*_map)[save_name]; ++ii) {untested();
+ for (int ii = 0; (*_map)[save_name]; ++ii) {itested();
save_name = name + ":" + to_string(ii);
}
(*_map)[save_name] = (*_map)[name];
diff --git a/lib/m_base_in.cc b/lib/m_base_in.cc
index 27e2d110..e39bcc3c 100644
--- a/lib/m_base_in.cc
+++ b/lib/m_base_in.cc
@@ -60,27 +60,56 @@ void Name_String::parse(CS& File)
_data += File.ctoc();
}
}else{
- while (File.is_alpha() || File.is_pfloat() || File.match1("_[]")) {
+ int bracket = 0;
+ while (true) {
+ if (File.is_alpha() || File.is_pfloat() || File.match1("_$")) {
+ }else if (File.match1("[")) {
+ ++bracket;
+ }else if (bracket && File.match1("]")) {
+ --bracket;
+ }else{
+ break;
+ }
_data += File.ctoc();
}
+ if(bracket){
+ File.warn(bDANGER, "missing ]?");
+ }else{
+ }
}
File.skipbl();
}
/*--------------------------------------------------------------------------*/
+void Angled_String::parse(CS& File)
+{
+ File.skipbl();
+ _data = File.ctos("", "<", ">");
+ File.skipbl();
+}
+/*--------------------------------------------------------------------------*/
void Quoted_String::parse(CS& File)
-{untested();
+{
File.skipbl();
size_t here = File.cursor();
char quote = File.ctoc();
_data = "";
- for (;;) {untested();
- if (File.skip1(quote)) {untested();
+ // TODO: extend ctos and use it.
+ for (;;) {
+ if (File.match1('\\')) { itested();
+ _data += File.ctoc();
+ if (File.match1(quote)) { itested();
+ _data += File.ctoc();
+ }else if (File.match1('\\')) { itested();
+ _data += File.ctoc();
+ }else{ itested();
+ }
+ }else if (File.skip1(quote)) {
break;
- }else if (!File.more()) {untested();
- File.warn(0, "end of file in quoted string");
- File.warn(0, here, "string begins here");
+ }else if (!File.ns_more()) {
+ File.warn(bNOERROR, "end of file in quoted string");
+ File.warn(bNOERROR, here, "string begins here");
break;
- }else{untested();
+ }else{
_data += File.ctoc();
}
}
diff --git a/lib/m_base_math.cc b/lib/m_base_math.cc
index 0858eba2..10694442 100644
--- a/lib/m_base_math.cc
+++ b/lib/m_base_math.cc
@@ -35,7 +35,7 @@ Base* Base::logic_not()const
{
if (to_bool()) {
return new Float(0.);
- }else{untested();
+ }else{itested();
return new Float(1.);
}
}
diff --git a/lib/m_expression_dump.cc b/lib/m_expression_dump.cc
index 60dd8dd6..ab32f8f1 100644
--- a/lib/m_expression_dump.cc
+++ b/lib/m_expression_dump.cc
@@ -38,10 +38,14 @@ void Expression::dump(std::ostream& out)const
for (const_iterator i = begin(); i != end(); ++i) {
if (dynamic_cast<const Token_STOP*>(*i)) {
stack.push_back(*i);
- }else if (dynamic_cast<const Token_PARLIST*>(*i)) {
+ }else if (dynamic_cast<const Token_PARLIST*>(*i)
+ || dynamic_cast<const Token_ARRAY*>(*i)) {
+ if((*i)->data()){ untested();
+ }else{
+ }
// pop*n push
bool been_here = false;
- std::string tmp(")");
+ std::string tmp((*i)->name());
for (;;) {
if (stack.empty()) {untested();
throw Exception("bad expression");
@@ -50,9 +54,11 @@ void Expression::dump(std::ostream& out)const
const Token* t = stack.back();
stack.pop_back();
if (dynamic_cast<const Token_STOP*>(t)) {
- tmp = "(" + tmp;
+ tmp = t->name() + tmp;
break;
- }else if (dynamic_cast<const Token_SYMBOL*>(t)) {
+ }else if (dynamic_cast<const Token_SYMBOL*>(t)
+ || dynamic_cast<const Token_CONSTANT*>(t)
+ || dynamic_cast<const Token_ARRAY*>(t)) {
if (been_here) {
tmp = ", " + tmp;
}else{
@@ -63,7 +69,12 @@ void Expression::dump(std::ostream& out)const
unreachable();
}
}
- Token* t = new Token_PARLIST(tmp);
+ Token* t;
+ if (dynamic_cast<const Token_PARLIST*>(*i)){
+ t = new Token_PARLIST(tmp);
+ }else{
+ t = new Token_ARRAY(tmp);
+ }
locals.push_back(t);
stack.push_back(t);
}else if (dynamic_cast<const Token_CONSTANT*>(*i)|| dynamic_cast<const Token_SYMBOL*>(*i)) {
@@ -72,7 +83,7 @@ void Expression::dump(std::ostream& out)const
// pop op push
const Token* t1 = stack.back();
stack.pop_back();
- Token* t = new Token_SYMBOL((**i).name(), t1->full_name());
+ Token* t = new Token_SYMBOL((**i).name() + t1->full_name());
locals.push_back(t);
stack.push_back(t);
}else{
@@ -88,7 +99,7 @@ void Expression::dump(std::ostream& out)const
const Token* t1 = stack.back();
stack.pop_back();
std::string tmp('(' + t1->full_name() + ' ' + (**i).name() + ' ' + t2->full_name() + ')');
- Token* t = new Token_SYMBOL(tmp, "");
+ Token* t = new Token_SYMBOL(tmp);
locals.push_back(t);
stack.push_back(t);
}else if (dynamic_cast<const Token_UNARY*>(*i)) {
@@ -97,9 +108,24 @@ void Expression::dump(std::ostream& out)const
const Token* t1 = stack.back();
stack.pop_back();
std::string tmp('(' + (**i).name() + ' ' + t1->full_name() + ')');
- Token* t = new Token_SYMBOL(tmp, "");
+ Token* t = new Token_SYMBOL(tmp);
locals.push_back(t);
stack.push_back(t);
+ }else if (auto t = dynamic_cast<const Token_TERNARY*>(*i)) {
+ assert(!stack.empty());
+ const Token* cond = stack.back();
+ stack.pop_back();
+ std::stringstream tmp;
+
+ tmp << '(' << cond->full_name() << ")? (";
+ t->true_part()->dump(tmp);
+ tmp << "):(";
+ t->false_part()->dump(tmp);
+ tmp << ')';
+
+ Token* n = new Token_SYMBOL(tmp.str());
+ locals.push_back(n);
+ stack.push_back(n);
}else{
unreachable();
}
@@ -108,7 +134,10 @@ void Expression::dump(std::ostream& out)const
out << "empty";
}else{
out << stack.back()->full_name();
- assert(stack.size() == 1);
+ if(stack.size() == 1){
+ }else{ untested();
+ incomplete();
+ }
}
while (!locals.empty()) {
delete locals.back();
diff --git a/lib/m_expression_in.cc b/lib/m_expression_in.cc
index dfb23713..bc1f2eef 100644
--- a/lib/m_expression_in.cc
+++ b/lib/m_expression_in.cc
@@ -52,6 +52,7 @@
* | nothing
* andarg : logical andtail
* exptail : "||" andarg exptail
+ * | "?" expression ":" expression
* | nothing
* expression : andarg exptail
*/
@@ -85,28 +86,62 @@ void Expression::arglist(CS& File)
}
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+CS& Expression::array(CS& File)
+{itested();
+ trace1("array", File.tail().substr(0,20));
+ size_t here = File.cursor();
+ if (File.skip1b("'") && File.peek() == '{') { itested();
+ File.skip();
+ trace1("array2", File.tail().substr(0,20));
+ push_back(new Token_STOP("'{"));
+ if (!File.skip1b("}")) { itested();
+ expression(File);
+ arglisttail(File);
+ if (!File.skip1b("}")) { untested();
+ throw Exception_CS("unbalanced parentheses (array)", File);
+ }else{ itested();
+ }
+ }else{
+ }
+
+ push_back(new Token_ARRAY("}"));
+ }else{itested();
+ File.reset_fail(here);
+ }
+ return File;
+}
+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void Expression::leaf(CS& File)
{
-#if 0
- if (File.peek() == '"') {untested();
- Quoted_String name(File);
- push_back(new Token_SYMBOL(name, ""));
- // do not put constants in symbol table
- } // else
-#endif
+ trace1("leaf?", File.tail());
size_t here = File.cursor();
- Name_String name(File);
- if (!File.stuck(&here)) {
- arglist(File);
- push_back(new Token_SYMBOL(name, ""));
- }else{itested();
- throw Exception_CS("what's this?", File);
+ if (File.peek() == '"') {
+ Quoted_String* s = new Quoted_String(File);
+ if (File.stuck(&here)) { untested();
+ delete s;
+ throw Exception_CS("what's this?", File);
+ }else{
+ push_back(new Token_CONSTANT("\"" + s->val_string() + "\"", s));
+ }
+ }else if (File.peek() == '<') {
+ std::string s = File.ctos("", "<", ">");
+ push_back(new Token_SYMBOL("<" + s + ">"));
+ }else if (array(File)) { itested();
+ }else{
+ Name_String name(File);
+ if (!File.stuck(&here)) {
+ arglist(File);
+ push_back(new Token_SYMBOL(name));
+ }else{itested();
+ trace1("leafstuck", File.tail());
+ throw Exception_CS("what's this?", File);
+ }
}
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void Expression::factor(CS& File)
{
- Token* t = 0;
+ Token* t = NULL;
if (File >> "-|+|!") {
std::string name(File.last_match());
t = new Token_UNARY(name);
@@ -125,11 +160,33 @@ void Expression::factor(CS& File)
push_back(t);
}else{
}
+ trace1("factor1", File.tail());
+}
+/*--------------------------------------------------------------------------*/
+void Expression::ternary(CS& File)
+{
+ std::string name(File.last_match());
+ Expression* true_part = NULL;
+ Expression* false_part = NULL;
+
+ true_part = new Expression(File);
+
+ if (!File.skip1b(":")) {
+ delete true_part;
+ throw Exception_CS("missing colon (ternary)", File);
+ }else{
+ // push_back(new Token_STOP(":"));
+ }
+ false_part = new Expression(File);
+
+ // andarg(File);
+
+ push_back(new Token_TERNARY(name, true_part, false_part));
}
/*--------------------------------------------------------------------------*/
void Expression::termtail(CS& File)
{
- if (File >> "*|/") {
+ if (File >> "*|/|%") {
std::string name(File.last_match());
factor(File);
push_back(new Token_BINOP(name));
@@ -140,7 +197,9 @@ void Expression::termtail(CS& File)
/*--------------------------------------------------------------------------*/
void Expression::term(CS& File)
{
+ trace1("term0", File.tail());
factor(File);
+ trace1("term1", File.tail());
termtail(File);
}
/*--------------------------------------------------------------------------*/
@@ -202,6 +261,9 @@ void Expression::exptail(CS& File)
andarg(File);
push_back(new Token_BINOP(name));
exptail(File);
+ }else if (File >> "?") {
+ assert(size());
+ ternary(File);
}else{
}
}
diff --git a/lib/m_expression_reduce.cc b/lib/m_expression_reduce.cc
index ece1428f..355c1ef0 100644
--- a/lib/m_expression_reduce.cc
+++ b/lib/m_expression_reduce.cc
@@ -1,6 +1,6 @@
-/*$Id: m_expression_reduce.cc,v 26.137 2010/04/10 02:37:33 al Exp $ -*- C++ -*-
+/* -*- C++ -*-
* Copyright (C) 2003 Albert Davis
- * Author: Albert Davis <[email protected]>
+ * 2023 Felix Salfelder
*
* This file is part of "Gnucap", the Gnu Circuit Analysis Package
*
@@ -28,6 +28,7 @@
#include "globals.h"
#include "u_function.h"
#include "u_parameter.h"
+#include <stack>
/*--------------------------------------------------------------------------*/
Token* Token_BINOP::op(const Token* T1, const Token* T2)const
{
@@ -48,6 +49,8 @@ Token* Token_BINOP::op(const Token* T1, const Token* T2)const
b = (T1->data())->subtract(T2->data());
}else if (name() == "/") {
b = (T1->data())->divide(T2->data());
+ }else if (name() == "%") {
+ b = (T1->data())->modulo(T2->data());
}else if (name() == "==") {
b = (T1->data())->equal(T2->data());
}else if (name() == "!=") {
@@ -70,16 +73,10 @@ Token* Token_BINOP::op(const Token* T1, const Token* T2)const
return NULL;
}
if (b) {
- if (T1->aRgs() == "") {
- }else{untested();
- }
- if (T2->aRgs() == "") {
- }else{untested();
- }
- return new Token_CONSTANT(b->val_string(), b, (T1->aRgs()+T2->aRgs()));
+ return new Token_CONSTANT(b->val_string(), b);
}else{
// can get here if either T1 or T2 has no data
- return new Token_CONSTANT("false", NULL, "");
+ return new Token_CONSTANT("false", NULL);
}
}
/*--------------------------------------------------------------------------*/
@@ -102,13 +99,46 @@ Token* Token_UNARY::op(const Token* T1)const
return NULL;
}
if (b) {
- if (T1->aRgs() == "") {
- }else{untested();
- }
- return new Token_CONSTANT(b->val_string(), b, (T1->aRgs()));
+ return new Token_CONSTANT(b->val_string(), b);
}else{untested();
// can get here if T1 has no data
- return new Token_CONSTANT("false", NULL, "");
+ return new Token_CONSTANT("false", NULL);
+ }
+}
+/*--------------------------------------------------------------------------*/
+static std::string call_function(FUNCTION const* F, Expression const* E)
+{
+ assert(!E->is_empty());
+ Expression::const_iterator input = E->end();
+ --input;
+ assert(dynamic_cast<const Token_PARLIST*>(*input));
+ --input;
+
+ std::string arg;
+ std::string comma = "";
+ bool all_float = true;
+ while (!dynamic_cast<const Token_STOP*>(*input)) {
+ Float const* f = dynamic_cast<Float const*>((*input)->data());
+ all_float = f;
+ if(!all_float){
+ trace1("not float", (*input)->name());
+ break;
+ }else{
+ assert(dynamic_cast<Token_CONSTANT const*>(*input));
+ }
+
+ arg = (*input)->name() + comma + arg;
+ comma = ", ";
+ assert(input != E->begin());
+ --input;
+ }
+
+ if(all_float){
+ // function call as usual
+ CS cmd(CS::_STRING, arg);
+ return F->eval(cmd, E->_scope);
+ }else{
+ return "";
}
}
/*--------------------------------------------------------------------------*/
@@ -117,46 +147,119 @@ void Token_SYMBOL::stack_op(Expression* E)const
assert(E);
// replace single token with its value
if (!E->is_empty() && dynamic_cast<const Token_PARLIST*>(E->back())) {
+ trace1("SYM stackop", name());
// has parameters (table or function)
if (FUNCTION* f = function_dispatcher[name()]) {
- const Token* T1 = E->back(); // arglist
- E->pop_back();
- CS cmd(CS::_STRING, T1->name());
- std::string value = f->eval(cmd, E->_scope);
- const Float* v = new Float(value);
- E->push_back(new Token_CONSTANT(value, v, ""));
- delete T1;
+ std::string result = call_function(f, E);
+ trace2("callf", result, name());
+ if(result==""){
+ E->push_back(clone());
+ }else{
+ while (!dynamic_cast<const Token_STOP*>(E->back())) {
+ delete(E->back());
+ E->pop_back();
+ assert(!E->is_empty());
+ }
+ delete(E->back());
+ E->pop_back();
+ const Float* v = new Float(result);
+ E->push_back(new Token_CONSTANT(result, v));
+ }
}else{
throw Exception_No_Match(name()); //BUG// memory leak
unreachable();
E->push_back(clone());
}
+
}else{
// has no parameters (scalar)
if (strchr("0123456789.", name()[0])) {
// a number
Float* n = new Float(name());
- E->push_back(new Token_CONSTANT(name(), n, ""));
+ trace1("found number", name());
+ E->push_back(new Token_CONSTANT(name(), n));
}else{
// a name
PARAMETER<double> p = (*(E->_scope->params()))[name()];
if (p.has_hard_value()) {
- // can find value - push value
- double v = p.e_val(NOT_INPUT, E->_scope);
- Float* n = new Float(v);
- E->push_back(new Token_CONSTANT(n->val_string(), n, ""));
+ CS cmd(CS::_STRING, p.string());
+ Expression pp(cmd);
+ Expression e(pp, E->_scope);
+ double v = e.eval();
+
+ if(v!=NOT_INPUT){
+ // it's a float constant.
+ Float* n = new Float(v);
+ E->push_back(new Token_CONSTANT(n->val_string(), n));
+ }else{
+ // not a float. keep expression
+ for (Expression::const_iterator i = e.begin(); i != e.end(); ++i) {
+ E->push_back(*i);
+ }
+ // disown
+ while (e.size()){
+ e.pop_back();
+ }
+ }
}else{
// no value - push name (and accept incomplete solution later)
String* s = new String(name());
- E->push_back(new Token_CONSTANT(name(), s, ""));
+ E->push_back(new Token_CONSTANT(name(), s));
}
}
}
}
/*--------------------------------------------------------------------------*/
-void Token_BINOP::stack_op(Expression* E)const
+Token_TERNARY::~Token_TERNARY()
+{
+ delete _true;
+ _true = NULL;
+
+ delete _false;
+ _false = NULL;
+}
+/*--------------------------------------------------------------------------*/
+void Token_TERNARY::stack_op(Expression* E)const
{
assert(E);
+ Token const* t = E->back();
+ auto constant = dynamic_cast<Token_CONSTANT const*>(t);
+
+ bool is_float = false;
+ if(constant){
+ is_float = dynamic_cast<Float const*>(constant->data());
+ }else{
+ }
+
+ assert(true_part());
+ assert(false_part());
+ if (is_float) {
+ assert(constant->data());
+ bool select = constant->data()->to_bool();
+ delete t;
+ E->pop_back();
+ Expression const* sel;
+
+ if(select){
+ sel = true_part();
+ }else{
+ sel = false_part();
+ }
+ // E->reduce_copy(*sel);
+ for (Expression::const_iterator i = sel->begin(); i != sel->end(); ++i) {
+ (**i).stack_op(E);
+ }
+
+ }else{
+ Expression* te = new Expression(*true_part(), E->_scope);
+ Expression* fe = new Expression(*false_part(), E->_scope);
+ E->push_back(new Token_TERNARY(name(), te, fe));
+ }
+}
+/*--------------------------------------------------------------------------*/
+void Token_BINOP::stack_op(Expression* E)const
+{ itested();
+ assert(E);
// replace 2 tokens (binop) with 1 (result)
Token* t1 = E->back();
E->pop_back();
@@ -206,13 +309,13 @@ void Token_BINOP::stack_op(Expression* E)const
E->push_back(clone());
delete t;
}
- }else{untested();
+ }else{
// # - # - or something like that
E->push_back(t2);
E->push_back(t1);
E->push_back(clone());
}
- }else{untested();
+ }else{
// # - # - or something like that
E->push_back(t2);
E->push_back(t1);
@@ -226,29 +329,18 @@ void Token_STOP::stack_op(Expression* E)const
E->push_back(clone());
}
/*--------------------------------------------------------------------------*/
+void Token_ARRAY::stack_op(Expression* E)const
+{
+ assert(E);
+ E->push_back(clone());
+ return;
+}
+/*--------------------------------------------------------------------------*/
void Token_PARLIST::stack_op(Expression* E)const
{
assert(E);
- // replace multiple tokens of a PARLIST with a single token
- bool been_here = false;
- std::string tmp;//(")");
- for (;;) {
- const Token* t = E->back();
- E->pop_back();
- if (dynamic_cast<const Token_STOP*>(t)) {
- // tmp = "(" + tmp;
- break;
- }else{
- if (been_here) {
- tmp = ", " + tmp;
- }else{
- been_here = true;
- }
- tmp = t->name() + tmp;
- }
- delete t;
- }
- E->push_back(new Token_PARLIST(tmp));
+ E->push_back(clone());
+ return;
}
/*--------------------------------------------------------------------------*/
void Token_UNARY::stack_op(Expression* E)const
@@ -268,7 +360,7 @@ void Token_UNARY::stack_op(Expression* E)const
E->push_back(clone());
delete t;
}
- }else{untested();
+ }else{itested();
E->push_back(t1);
E->push_back(clone());
}
@@ -276,9 +368,18 @@ void Token_UNARY::stack_op(Expression* E)const
/*--------------------------------------------------------------------------*/
void Token_CONSTANT::stack_op(Expression* E)const
{
- unreachable();
- (void)(E);
+ // unreachable(); no. restoring arg expression??
+ trace2("stackop constant", name(), dynamic_cast<Float const*>(data()));
+
assert(E);
+ if(auto f = dynamic_cast<Float const*>(data())){
+ E->push_back(new Token_CONSTANT(name(), new Float(*f)));
+ }else if(auto s = dynamic_cast<String const*>(data())){
+ E->push_back(new Token_CONSTANT(name(), new String(*s)));
+ }else{
+ assert(false);
+ unreachable();
+ }
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
@@ -287,6 +388,9 @@ void Expression::reduce_copy(const Expression& Proto)
// The Proto._list is the expression in RPN.
// Attempt to build a reduced _list here, hopefully with only one item.
for (const_iterator i = Proto.begin(); i != Proto.end(); ++i) {
+ trace2("reducecopy", (**i).name(), (**i).data() );
+ trace1("reducecopy", dynamic_cast<const Token_CONSTANT*>(*i));
+ trace1("reducecopy", dynamic_cast<const Token_SYMBOL*>(*i));
(**i).stack_op(this);
}
if (is_empty()) {untested();
@@ -298,7 +402,33 @@ void Expression::reduce_copy(const Expression& Proto)
Expression::Expression(const Expression& Proto, const CARD_LIST* Scope)
:_scope(Scope)
{
- reduce_copy(Proto);
+ //BUG// is this thread-safe?
+ static int recursion = 0;
+ static Expression const* first_name;
+
+ if(recursion==0){
+ first_name = &Proto;
+ }else{
+ }
+
+ ++recursion;
+ if (recursion <= OPT::recursion) {
+ try{
+ reduce_copy(Proto);
+ }catch(Exception const& e){
+ recursion = 0;
+ throw e;
+ }
+ // first_name->dump(std::cerr);
+ }else{
+ std::stringstream s;
+ first_name->dump(s);
+ recursion = 0;
+ //BUG// needs to show scope
+ throw Exception("parameter " + s.str() + ": recursion too deep");
+ }
+
+ --recursion;
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/lib/u_lang.cc b/lib/u_lang.cc
index ad807700..0d8bb458 100644
--- a/lib/u_lang.cc
+++ b/lib/u_lang.cc
@@ -85,7 +85,7 @@ const CARD* LANGUAGE::find_proto(const std::string& Name, const CARD* Scope)
else if (Umatch(Name, "st{atus} ")) { s = "status";}
else if (Umatch(Name, "te{mperature} ")){untested(); s = "temperature";}
else if (Umatch(Name, "tr{ansient} ")) { s = "transient";}
- else if (Umatch(Name, "!")) {untested(); s = "system";}
+ else if (Umatch(Name, "!")) {itested(); s = "system";}
else if (Umatch(Name, "<")) {untested(); s = "<";}
else if (Umatch(Name, ">")) {untested(); s = ">";}
else{ /* no shortcut available */
@@ -101,7 +101,7 @@ const CARD* LANGUAGE::find_proto(const std::string& Name, const CARD* Scope)
/*--------------------------------------------------------------------------*/
void LANGUAGE::new__instance(CS& cmd, BASE_SUBCKT* owner, CARD_LIST* Scope)
{
- if (cmd.is_end()) {untested();
+ if (cmd.is_end()) {itested();
// nothing
}else{
std::string type = find_type_in_string(cmd);
@@ -164,9 +164,9 @@ void LANGUAGE::print_item(OMSTREAM& o, const CARD* c)
print_paramset(o, m);
}else if (const DEV_COMMENT* com = dynamic_cast<const DEV_COMMENT*>(c)) {
print_comment(o, com);
- }else if (const DEV_DOT* d = dynamic_cast<const DEV_DOT*>(c)) {untested();
+ }else if (const DEV_DOT* d = dynamic_cast<const DEV_DOT*>(c)) {itested();
print_command(o, d);
- }else{untested();
+ }else{itested();
incomplete();
unreachable();
}
diff --git a/lib/u_opt2.cc b/lib/u_opt2.cc
index 30a80136..f7356e70 100644
--- a/lib/u_opt2.cc
+++ b/lib/u_opt2.cc
@@ -21,12 +21,12 @@
*------------------------------------------------------------------
* command and functions to access OPT class
*/
-//testing=script,complete 2006.07.14
+//testing=script 2006.07.14
#include "globals.h"
#include "c_comand.h"
#include "u_lang.h"
#include "l_compar.h"
-#include "ap.h"
+#include "e_cardlist.h"
/*--------------------------------------------------------------------------*/
void OPT::command(CS& cmd)
{
@@ -322,7 +322,11 @@ void OPT::print(OMSTREAM& o)
namespace {
class CMD_OPT : public CMD {
public:
- void do_it(CS& cmd, CARD_LIST*) {
+ void do_it(CS& cmd, CARD_LIST* Scope) override {
+ assert(Scope);
+ if (Scope == &CARD_LIST::card_list) {
+ }else{itested();
+ }
static OPT o;
o.command(cmd);
}
diff --git a/lib/u_parameter.cc b/lib/u_parameter.cc
index 75f49d80..ca6ab01e 100644
--- a/lib/u_parameter.cc
+++ b/lib/u_parameter.cc
@@ -102,17 +102,22 @@ std::string PARAM_LIST::value(int i)const
return "";
}
/*--------------------------------------------------------------------------*/
-void PARAM_LIST::eval_copy(PARAM_LIST& p, const CARD_LIST* scope)
+void PARAM_LIST::eval_copy(PARAM_LIST const& p, const CARD_LIST* scope)
{
assert(!_try_again);
_try_again = p._try_again;
- for (iterator i = p._pl.begin(); i != p._pl.end(); ++i) {
+ for (const_iterator i = p._pl.begin(); i != p._pl.end(); ++i) {
if (i->second.has_hard_value()) {
- if (_pl[i->first].has_hard_value()) {untested();
- _pl[i->first] = i->second.e_val(_pl[i->first], scope);
- }else{
+ auto j = _pl.find(i->first);
+ if(j == _pl.end()){
+ // spice feature: create parameters from arglist
+ // should not get here in verilog mode
_pl[i->first] = i->second.e_val(NOT_INPUT, scope);
+ }else if(j->second.has_hard_value()) {untested();
+ j->second = i->second.e_val(j->second, scope);
+ }else{
+ // this is not needed.
}
}else{
}
@@ -125,10 +130,10 @@ const PARAMETER<double>& PARAM_LIST::deep_lookup(std::string Name)const
notstd::to_lower(&Name);
}else{
}
- PARAMETER<double> & rv = _pl[Name];
- if (rv.has_hard_value()) {
+ const_iterator i = _pl.find(Name);
+ if (i!=_pl.end() && i->second.has_hard_value()) {
// found a value, return it
- return rv;
+ return i->second;
}else if (_try_again) {
// didn't find one, look in enclosing scope
return _try_again->deep_lookup(Name);
@@ -136,8 +141,18 @@ const PARAMETER<double>& PARAM_LIST::deep_lookup(std::string Name)const
// no enclosing scope to look in
// really didn't find it, give up
// return garbage value (NOT_INPUT)
- return rv;
+ static PARAMETER<double> garbage;
+ return garbage;
+ }
+}
+/*--------------------------------------------------------------------------*/
+void PARAM_LIST::set(std::string Name, const double& Value)
+{
+ if (OPT::case_insensitive) {
+ notstd::to_lower(&Name);
+ }else{
}
+ _pl[Name] = Value;
}
/*--------------------------------------------------------------------------*/
void PARAM_LIST::set(std::string Name, const std::string& Value)
diff --git a/lib/u_prblst.cc b/lib/u_prblst.cc
index 358c6b91..88a0ee64 100644
--- a/lib/u_prblst.cc
+++ b/lib/u_prblst.cc
@@ -127,8 +127,12 @@ void PROBELIST::remove_one(CKT_BASE *brh)
* but not "v(r4) v(r5)" which has two parameters.
* It also takes care of setting the range for plot or alarm.
*/
-void PROBELIST::add_list(CS& cmd)
+void PROBELIST::add_list(CS& cmd, CARD_LIST* scope)
{
+ assert(scope);
+ if (scope==&CARD_LIST::card_list) {
+ }else{itested();
+ }
int oldcount = size();
std::string what(cmd.ctos(TOKENTERM));/* parameter */
if (what.empty()) {untested();
@@ -139,14 +143,14 @@ void PROBELIST::add_list(CS& cmd)
int paren = cmd.skip1b('('); /* device, node, etc. */
if (cmd.umatch("nodes ")) {
// all nodes
- add_all_nodes(what);
+ add_all_nodes(what, scope);
}else if (cmd.umatch("0")) {
// node 0 means system stuff
push_new_probe(what, 0);
}else if (cmd.is_alnum() || cmd.match1("*?")) {
// branches or named nodes
size_t here1 = cmd.cursor();
- bool found_something = add_branches(cmd.ctos(),what,&CARD_LIST::card_list);
+ bool found_something = add_branches(cmd.ctos(), what, scope);
if (!found_something) {
cmd.warn(bWARNING, here1, "no match");
}else{
@@ -158,7 +162,7 @@ void PROBELIST::add_list(CS& cmd)
}else{
}
size_t here2 = cmd.cursor();
- found_something = add_branches(cmd.ctos(),what,&CARD_LIST::card_list);
+ found_something = add_branches(cmd.ctos(), what, scope);
if (!found_something) {itested();
cmd.reset(here2);
break;
@@ -193,11 +197,15 @@ void PROBELIST::push_new_probe(const std::string& param,const CKT_BASE* object)
bag.push_back(PROBE(param, object));
}
/*--------------------------------------------------------------------------*/
-void PROBELIST::add_all_nodes(const std::string& what)
+void PROBELIST::add_all_nodes(const std::string& what, CARD_LIST* scope)
{
+ assert(scope);
+ if (scope == &CARD_LIST::card_list) {
+ }else{itested();
+ }
for (NODE_MAP::const_iterator
- i = CARD_LIST::card_list.nodes()->begin();
- i != CARD_LIST::card_list.nodes()->end();
+ i = scope->nodes()->begin();
+ i != scope->nodes()->end();
++i) {
if ((i->first != "0") && (i->first.find('.') == std::string::npos)) {
NODE* node = i->second;
@@ -216,6 +224,9 @@ bool PROBELIST::add_branches(const std::string&device,
const CARD_LIST* scope)
{
assert(scope);
+ if (scope == &CARD_LIST::card_list) {
+ }else{
+ }
bool found_something = false;
std::string::size_type dotplace = device.find_first_of(".");
diff --git a/lib/u_sim_data.cc b/lib/u_sim_data.cc
index 7b484d54..9ae7cf8f 100644
--- a/lib/u_sim_data.cc
+++ b/lib/u_sim_data.cc
@@ -23,7 +23,7 @@
*/
//testing=script 2015.01.28
#include "m_wave.h"
-#include "e_node.h"
+#include "e_logicnode.h"
#include "u_nodemap.h"
#include "e_cardlist.h"
#include "u_status.h"
@@ -242,23 +242,27 @@ void SIM_DATA::order_auto()
/* init: allocate, set up, etc ... for any type of simulation
* also called by status and probe for access to internals and subckts
*/
-void SIM_DATA::init()
+void SIM_DATA::init(CARD_LIST* scope)
{
+ assert(scope);
+ if (scope == &CARD_LIST::card_list) {
+ }else{itested();
+ }
if (is_first_expand()) {
uninit();
- init_node_count(CARD_LIST::card_list.nodes()->how_many(), 0, 0);
- CARD_LIST::card_list.expand();
+ init_node_count(scope->nodes()->how_many(), 0, 0);
+ scope->expand();
map__nodes();
- CARD_LIST::card_list.map_nodes();
+ scope->map_nodes();
alloc_hold_vectors();
_aa.reinit(_total_nodes);
_lu.reinit(_total_nodes);
_acx.reinit(_total_nodes);
- CARD_LIST::card_list.tr_iwant_matrix();
- CARD_LIST::card_list.ac_iwant_matrix();
+ scope->tr_iwant_matrix();
+ scope->ac_iwant_matrix();
_last_time = 0;
}else{
- CARD_LIST::card_list.precalc_first();
+ scope->precalc_first();
}
}
/*--------------------------------------------------------------------------*/
diff --git a/main/Make.depend b/main/Make.depend
index bdea9c8a..b24a0aa7 100644
--- a/main/Make.depend
+++ b/main/Make.depend
@@ -1,7 +1,8 @@
-main.o: main.cc config.h ../include/globals.h ../include/l_dispatcher.h \
- ../include/e_base.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+main.o: main.cc ../include/config.h ../include/globals.h \
+ ../include/l_dispatcher.h ../include/e_base.h ../include/u_attrib.h \
+ ../include/ap.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_indirect.h ../include/l_stlextra.h \
+ ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_prblst.h ../include/u_probe.h ../include/l_compar.h \
../include/u_sim_data.h ../include/constant.h ../include/m_matrix.h \
../include/e_cardlist.h ../include/u_lang.h ../include/ap.h \
diff --git a/main/Make1 b/main/Make1
index 14d44c7c..a32f662b 100644
--- a/main/Make1
+++ b/main/Make1
@@ -1,4 +1,4 @@
-#$Id: Make1,v 26.138 2013/04/24 03:32:53 al Exp $ -*- Makefile -*-
+#$Id: main/Make1 $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <[email protected]>
#
@@ -19,19 +19,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#------------------------------------------------------------------------
-TARGET = gnucap
+TARGET_EXE = gnucap
#------------------------------------------------------------------------
+INSTALL_FILES = $(TARGET_EXE)$(TARGET_EXE_EXT)
INSTALL_DIR = $(PREFIX)/bin
-INSTALL_FILES = $(TARGET)$(TARGET_EXT) ../gnucap-conf
#------------------------------------------------------------------------
-INSTALL_SYSCONF_DIR = $(PREFIX)/etc
-INSTALL_SYSCONF_FILES = ../gnucap.conf
+LIBS = -lgnucap -L../../lib/O -L../../lib/O-DEBUG
+INCLUDE = -I. -I../include -I../../include
#------------------------------------------------------------------------
DELETED =
#------------------------------------------------------------------------
RAW_SRCS = main.cc
#------------------------------------------------------------------------
-RAW_OTHER = Make1 Make2.g++ Make2.Debug Make2.mingw32 configure
+RAW_OTHER = Make1 configure
#------------------------------------------------------------------------
RAW = $(RAW_HDRS) $(RAW_SRCS) $(RAW_OTHER)
#------------------------------------------------------------------------
@@ -53,10 +53,10 @@ IMPORTED_DIST = $(IMPORTED)
DIST_FILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
-SRCS = $(IMPORTED_SRCS) $(GENERATED_SRCS) $(RAW_SRCS)
+SRCS = $(RAW_SRCS) $(GENERATED_SRCS) $(IMPORTED_SRCS)
HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
OBJS = ${SRCS:.cc=.o}
-TARGET_DEPENDS = $(OBJS) $(RAW)
+TARGET_DEPENDS = $(OBJS) $(RAW)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
MOSTLYCLEANFILES = $(OBJS) $(GENERATED)
diff --git a/main/Make2.Debug b/main/Make2.Debug
deleted file mode 100644
index e531639f..00000000
--- a/main/Make2.Debug
+++ /dev/null
@@ -1,97 +0,0 @@
-#$Id: Make2.Debug $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-# Standard base for g++, debugging, no optimization
-# Running the program will give a spew of line markers for debugging.
-
-CCC = g++
-
-CCFLAGS = \
--DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \
--Wall -Wextra \
--Wswitch-enum -Wundef -Wpointer-arith -Woverloaded-virtual \
--Wcast-qual -Wcast-align -Wpacked -Wshadow -Wconversion \
--Winit-self -Wmissing-include-dirs -Winvalid-pch \
--Wvolatile-register-var -Wstack-protector \
--Wvla -Woverlength-strings -Wno-sign-conversion -Wno-unused-const-variable
-#last line not in 4.1
-
-LIBS = \
--lgnucap \
-
-LDFLAGS = -rdynamic \
--L../../lib/O-DEBUG
-
-%.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-# warnings turned off, because they warn of nothing wrong
-# 4.3
-#-Wswitch-default -- lack of default is correct with enum
-#-Wfloat-equal -- warns on NA, div by zero trap
-#-Wpadded -- a bool in a class is enough
-#-Wredundant-decls -- in both header and func is an error check
-#-Wmissing-declarations -- pascal style
-#-Wmissing-noreturn -- warns when always throws exception
-#-Wunreachable-code -- warns even if reachable .. compiler bug??
-#-Waggregate-return -- warns even if passed by reference
-#-Wunsafe-loop-optimizations -- if can't unroll a loop
-#-Winline
-#-Wdisabled-optimization -- -O0 disables optimization, so it warns
-
-# 4.2
-#-Wpadded -- a bool in a class is enough
-#-Winline
-#-Waggregate-return -- warns even if passed by reference
-#-Wfloat-equal -- warns on NA, div by zero trap
-#-Wredundant-decls -- in both header and func is an error check
-#-Wunsafe-loop-optimizations -- warns on any loop with variable count
-
-# warnings turned off, because of the public headers
-#-Wunreachable-code -- didn't use nonportable syntax to hide
-#-Wmissing-noreturn -- didn't use nonportable syntax to hide
-
-# warnings turned off, issues with clang
-#-Wlogical-op -- not recognized
-#-Wsign-conversion -- int to size_t
-#-Wunused-const-variable -- generated code
-
-# warnings that should be on, but ...
-#-Wshadow -- lambda functions
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "debug" version, with extra warnings and run-time tracing.
-# If you get errors or warnings, make a copy of it and modify that.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to [email protected]
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/main/Make2.g++ b/main/Make2.g++
deleted file mode 100644
index 89919626..00000000
--- a/main/Make2.g++
+++ /dev/null
@@ -1,57 +0,0 @@
-#$Id: Make2.g++ 2014/07/03 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-# Standard base for g++.
-
-CCC = g++
-
-CCFLAGS = \
--DUNIX -O3 -DNDEBUG -I. -I../include -I../../include -W
-
-LIBS = \
--lgnucap \
-
-LDFLAGS = -rdynamic \
--L../../lib/O
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to [email protected]
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/main/Make2.mingw32 b/main/Make2.mingw32
deleted file mode 100644
index b6150e6d..00000000
--- a/main/Make2.mingw32
+++ /dev/null
@@ -1,45 +0,0 @@
-#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-CCC = i586-mingw32msvc-g++
-DLLTOOL = i586-mingw32msvc-dlltool
-TARGET_EXT = .exe
-
-CCFLAGS = \
--O2 -DNDEBUG -I. -I../../include
-
-LIBS = -lgnucap
-
-LDFLAGS = -L../../lib/MSW
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET)$(TARGET_EXT)
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/main/configure b/main/configure
index 9c43821e..48e59b3e 100755
--- a/main/configure
+++ b/main/configure
@@ -1,5 +1,4 @@
#!/bin/sh
-# configure for executable
mkdir -p O
#------------- Stuff added to enable --prefix --------------
@@ -22,64 +21,33 @@ else
fi
sed -e "s#/usr/local#$prefix#" ../Makefile.template > Makefile
-#----------------------------------------------------------------
-pkglibdir='${prefix}/lib/gnucap'
-pkglibdir_expanded="${prefix}/lib/gnucap"
-
-# bug. this is not implemented consistently.
-CXX=${CXX-c++}
-
-fill_template() {
-sed -e "s#@prefix@#$prefix#" \
- -e "s#@exec_prefix@#$prefix#" \
- -e "s#@libdir@#$prefix/lib#" \
- -e "s#@includedir@#$\{prefix\}/include#" \
- -e "s#@datarootdir@#$\{prefix\}/share/gnucap#" \
- -e "s#@docdir@#$\{prefix\}/share/doc/gnucap#" \
- -e "s#@sysconfdir@#$\{prefix\}/etc#" \
- -e "s#@pkglibdir@#$pkglibdir#" \
- -e "s#@pkglibdir_expanded@#$pkglibdir_expanded#" \
- -e "s#@CXXFLAGS@#$CCFLAGS#" \
- -e "s#@GNUCAP_LIBS@#-lgnucap#" \
- -e "s#@CXX@#$CXX#" < $1.in > $1
-}
-fill_template config.h
-fill_template gnucap-conf
-fill_template gnucap.conf
-
-chmod +x gnucap-conf
#----------------------------------------------------------------
-echo "CCFLAGS = \\" >Make.ccflags
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
-
-echo "LIBS = \\" >Make.libs
-echo "-lgnucap \\" >>Make.libs
-echo "" >>Make.libs
-echo "PREFIX = " $prefix >>Make.libs
-echo "" >>Make.libs
+echo "CCFLAGS = -fPIC \\" >Make.ccflags
+echo "-std=c++11 -DUNIX -O2 -DNDEBUG \$(INCLUDE) -W \\" >>Make.ccflags
+# begin special stuff
+# end special stuff
+echo "" >>Make.ccflags
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
-TARGET_EXT =
-
-LDFLAGS = -rdynamic \
--L../../lib/O
+CXX = c++
-.SUFFIXES : .o .cc
-.cc.o:; \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.SUFFIXES:
+.SUFFIXES: .so .o .cc
+.cc.o:; \$(CXX) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.cc.so:; \$(MAKE_LIB) \$<
#------------------------------------------------------------------------
-\$(TARGET): \$(OBJS)
- rm -f \$@
- \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) \$(OBJS) -o \$@ \$(LIBS) \$(LDFLAGS)
+MAKE_EXE = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -o \$@
+MAKE_LIB = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -shared -o \$@
#------------------------------------------------------------------------
CAT_EOF
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------ >>Make2
-cat Make.ccflags Make.libs Make.sys >>Make2
-rm Make.ccflags Make.libs Make.sys
+echo "PREFIX = " $prefix >>Make2
+cat Make.ccflags Make.sys >>Make2
+rm Make.ccflags Make.sys
exit 0
diff --git a/main/main.cc b/main/main.cc
index 6f4e5a89..117aedd1 100644
--- a/main/main.cc
+++ b/main/main.cc
@@ -34,6 +34,7 @@
#include "c_comand.h"
#include "declare.h" /* plclose */
/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
struct JMP_BUF{
sigjmp_buf p;
} env;
@@ -85,7 +86,9 @@ static void read_startup_files(void)
}
}
//CMD::command("clear", &CARD_LIST::card_list);
- if (!OPT::language) {
+ if (language_dispatcher.empty()) {
+ // go on without language.
+ }else if (!OPT::language) {
OPT::language = language_dispatcher[DEFAULT_LANGUAGE];
for(DISPATCHER<LANGUAGE>::const_iterator
@@ -98,7 +101,7 @@ static void read_startup_files(void)
if (OPT::language) {
OPT::case_insensitive = OPT::language->case_insensitive();
OPT::units = OPT::language->units();
- }else{
+ }else{ untested();
OPT::case_insensitive = false;
OPT::units = uSI;
}
@@ -130,7 +133,7 @@ extern "C" {
static void sig_int(SIGNALARGS)
{itested();
signal(SIGINT,sig_int);
- if (ENV::run_mode == rBATCH) {untested();
+ if (ENV::run_mode == rBATCH) {itested();
exit(1);
}else{itested();
IO::error << '\n';
@@ -184,9 +187,9 @@ static void process_cmd_line(int argc, const char *argv[])
CMD::cmdproc(cmd, &CARD_LIST::card_list);
}else{untested();
}
- }else if (strcasecmp(argv[ii], "-i") == 0) {untested();
+ }else if (strcasecmp(argv[ii], "-i") == 0) {itested();
++ii;
- if (ii < argc) {untested();
+ if (ii < argc) {itested();
CMD::command(std::string("include ") + argv[ii++], &CARD_LIST::card_list);
}else{untested();
}
@@ -220,7 +223,7 @@ static void process_cmd_line(int argc, const char *argv[])
error(bDANGER, e.message() + '\n');
finish();
}
- if (ii >= argc) {itested();
+ if (ii >= argc) {
//CMD::command("end", &CARD_LIST::card_list);
throw Exception_Quit("");
}else{untested();
@@ -241,6 +244,7 @@ int main(int argc, const char *argv[])
prepare_env();
CKT_BASE::_sim = new SIM_DATA;
CKT_BASE::_probe_lists = new PROBE_LISTS;
+ CKT_BASE::_attribs = new INDIRECT<ATTRIB_LIST_p>;
try {
{
SET_RUN_MODE xx(rBATCH);
@@ -261,7 +265,7 @@ int main(int argc, const char *argv[])
exit(0);
}
#endif
- }else{untested();
+ }else{
finish(); /* error clean up (from longjmp()) */
//CMD::command("quit", &CARD_LIST::card_list);
exit(0);
@@ -306,6 +310,8 @@ int main(int argc, const char *argv[])
CKT_BASE::_probe_lists = NULL;
delete CKT_BASE::_sim;
CKT_BASE::_sim = NULL;
+ delete CKT_BASE::_attribs;
+ CKT_BASE::_attribs = NULL;
return 0;
}
diff --git a/man/gnucap-modelgen.1 b/man/gnucap-modelgen.1
new file mode 100644
index 00000000..f79ce5d1
--- /dev/null
+++ b/man/gnucap-modelgen.1
@@ -0,0 +1,42 @@
+.\" Hey, Emacs! This is an -*- nroff -*- source file.
+.TH GNUCAP-MODELGEN 1 "November 2016" "Debian Project" "Debian GNU"
+
+.SH NAME
+gnucap-modelgen \- GNU Circuit Analysis Package .model translator
+.SH SYNOPSIS
+.B gnucap-modelgen [\fB-cc\fP] [\fB-h\fP] [filename]
+.br
+.SH DESCRIPTION
+.B Gnucap-Modelgen
+is a .model translator tool in the Gnucap suite. It will transform .model models
+into c++ code implementing gnucap component plugins.
+.PP
+A typical usage can be
+
+gnucap-modelgen \-cc mymodel.model
+
+.SH OPTIONS
+
+.TP
+\fI-cc\fI
+generate c++ file
+.TP
+\fI-h\fI
+create header
+
+.SH BUGS
+See
+.B /usr/share/doc/gnucap/bugs
+for a list of known bugs in this release.
+.PP
+Gnucap is an ongoing research project. It is being released in a
+preliminary phase in hopes that it will be useful and that others
+will use it as a thrust or base for their research. I also hope
+for some comments that may help me direct my research.
+
+.SH AUTHOR
+Gnucap is being written by Albert Davis <[email protected]>
+.PP
+This manual page was written by Felix Salfelder <[email protected]>.
+For the full LaTeX documentation, please see
+.B /usr/share/doc/gnucap/manual.
diff --git a/man/gnucap.1 b/man/gnucap.1
new file mode 100644
index 00000000..c3274df8
--- /dev/null
+++ b/man/gnucap.1
@@ -0,0 +1,102 @@
+.\" Hey, Emacs! This is an -*- nroff -*- source file.
+.TH GNUCAP 1 "November 2001" "Debian Project" "Debian GNU"
+
+.SH NAME
+gnucap \- GNU Circuit Analysis Package
+.SH SYNOPSIS
+.B gnucap
+[\fB-b\fP filename] [\fB-i\fP filename] [filename]
+.br
+.SH DESCRIPTION
+.B Gnucap
+is a general purpose circuit simulator. It performs nonlinear
+dc and transient analyses, fourier analysis, and ac analysis
+linearized at an operating point. It is fully interactive and
+command driven. It can also be run in batch mode or as a server.
+The output is produced as it simulates. Spice compatible models
+for the MOSFET (level 1,2,3) and diode are included in this
+release.
+.PP
+Since it is fully interactive, it is possible to make changes and
+re-simulate quickly. The interactive design makes it well suited
+to the typical iterative design process used it optimizing a circuit
+design. It is also well suited to undergraduate teaching where
+Spice in batch mode can be quite intimidating. This version, while
+still officially in beta test, should be stable enough for basic
+undergraduate teaching and courses in MOS design.
+.PP
+In batch mode it is mostly Spice compatible, so it is often possible
+to use the same file for both Gnucap and Spice (e.g. ngspice).
+.PP
+The analog simulation is based on traditional nodal analysis with
+iteration by Newton's method and LU decomposition. An event queue
+and incremental matrix update speed up the solution for large
+circuits (at some expense for small circuits).
+.PP
+It also has digital devices for mixed signal simulation. The
+digital devices may be implemented as either analog subcircuits or
+as true digital models. The simulator will automatically determine
+which to use. Networks of digital devices are simulated as digital,
+with no conversions to analog between gates. This results in
+digital circuits being simulated faster than on a typical analog
+simulator, even with behavioral models. The digital mode is
+experimental and needs work. There will be substantial improvements
+in future releases.
+.PP
+Gnucap is modular from the ground up. All devices, input languages and most
+algorithms can be customized and replaced at running time. Extensions and
+additional plugins are not part of the main package, but can be found on the
+project website.
+
+.SH OPTIONS
+Various command-line options are available. These are processed in order.
+If no parameters are given, gnucap will start in interactive
+mode (recommended) and read from standard input.
+.TP
+\fI-a filename\fP
+load plugin from filename during startup
+.TP
+\fI-i filename\fI
+execute the commands in the named file then go into interactive mode
+.TP
+\fI-b filename\fP
+execute the commands in the named file then exit (Spice batch mode)
+.TP
+\fI--<command>\fP
+execute interactive command as if typed into interactive mode. E.g. --verilog,
+switches to verilog mode.
+.TP
+.SH BUGS
+See
+.B /usr/share/doc/gnucap/bugs
+for a list of known bugs in this release.
+.PP
+Gnucap is an ongoing research project. It is being released in a
+preliminary phase in hopes that it will be useful and that others
+will use it as a thrust or base for their research and development.
+
+.SH FILES
+
+During startup, the first of
+\fIgnucap.rc\fP,
+\fI.gnucap/gnucap.rc\fP,
+\fI$sysconfdir/gnucap.rc\fP,
+\fI$sysconfdir/gnucap/gnucap.rc\fP will be included. Otherwise, default plugins will be loaded.
+
+Here, \fI$sysconfdir\fP is typically \fI${prefix}/etc\fP, and defaults to \fI/usr/local/etc\fP.
+It is expected to be set to \fI/etc\fP in packages obtained from the usual
+operating system distributors.
+
+.SH AUTHOR
+Gnucap is being written by Albert Davis <[email protected]>
+.PP
+This manual page was written by Jon Rabone <[email protected]> and maintained
+by Hamish Moffatt <[email protected]> for the Debian package of gnucap.
+Modified by Felix Salfelder <[email protected]>.
+For the full documentation, please visit
+.B http://gnucap.org.
+.PP
+This release has been prepared with funding through the NGI0 Entrust Fund, a
+fund established by NLnet with financial support from the European Commission's
+Next Generation Internet programme, under the aegis of DG Communications
+Networks, Content and Technology under grant agreement No 101069594.
diff --git a/modelgen/Make1 b/modelgen/Make1
index d894294b..48ab76e8 100644
--- a/modelgen/Make1
+++ b/modelgen/Make1
@@ -1,5 +1,4 @@
-#$Id: Make1,v 26.138 2013/04/24 03:21:58 al Exp $ -*- Makefile -*-
-#
+#$Id: modelgen/Make1 $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <[email protected]>
#
@@ -20,12 +19,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#------------------------------------------------------------------------
-TARGET = gnucap-modelgen
-#------------------------------------------------------------------------
-INSTALL_FILES = $(TARGET)$(TARGET_EXT)
+TARGET_EXE = gnucap-modelgen
#------------------------------------------------------------------------
+INSTALL_FILES = $(TARGET_EXE)$(TARGET_EXE_EXT)
INSTALL_DIR = $(PREFIX)/bin
#------------------------------------------------------------------------
+LIBS = -lgnucap -L../../lib/O -L../../lib/O-DEBUG
+INCLUDE = -I. -I../include -I../../include
+#------------------------------------------------------------------------
DELETED =
#------------------------------------------------------------------------
RAW_SRCS = \
@@ -34,14 +35,13 @@ mg_out_common.cc mg_out_dev.cc mg_out_lib.cc mg_out_model.cc mg_out_root.cc
#------------------------------------------------------------------------
RAW_HDRS = mg_.h mg_out.h
#------------------------------------------------------------------------
-RAW_OTHER = Make1 Make2.g++ Make2.Debug Make2.mingw32 configure
+RAW_OTHER = Make1 configure
#------------------------------------------------------------------------
RAW = $(RAW_HDRS) $(RAW_SRCS) $(RAW_OTHER)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
IMPORTED_SRCS =
IMPORTED_HDRS =
-NOT_IMPORTED_HDRS =
IMPORTED_OTHER =
IMPORTED = $(IMPORTED_SRCS) $(IMPORTED_HDRS) $(IMPORTED_OTHER)
#------------------------------------------------------------------------
@@ -57,7 +57,7 @@ IMPORTED_DIST = $(IMPORTED)
DIST_FILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
-SRCS = $(RAW_SRCS) $(GENERATED_SRCS)
+SRCS = $(RAW_SRCS) $(GENERATED_SRCS) $(IMPORTED_SRCS)
HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
OBJS = ${SRCS:.cc=.o}
TARGET_DEPENDS = $(OBJS) $(RAW)
diff --git a/modelgen/Make2.g++ b/modelgen/Make2.g++
deleted file mode 100644
index 89919626..00000000
--- a/modelgen/Make2.g++
+++ /dev/null
@@ -1,57 +0,0 @@
-#$Id: Make2.g++ 2014/07/03 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-# Standard base for g++.
-
-CCC = g++
-
-CCFLAGS = \
--DUNIX -O3 -DNDEBUG -I. -I../include -I../../include -W
-
-LIBS = \
--lgnucap \
-
-LDFLAGS = -rdynamic \
--L../../lib/O
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to [email protected]
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/modelgen/Make2.mingw32 b/modelgen/Make2.mingw32
deleted file mode 100644
index 63b96579..00000000
--- a/modelgen/Make2.mingw32
+++ /dev/null
@@ -1,46 +0,0 @@
-#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
-# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <[email protected]>
-#
-# This file is part of "Gnucap", the Gnu Circuit Analysis Package
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#------------------------------------------------------------------------
-VPATH = .:..
-
-CCC = i586-mingw32msvc-g++
-DLLTOOL = i586-mingw32msvc-dlltool
-TARGET_EXT = .exe
-
-CCFLAGS = \
--O2 -DNDEBUG -I. -I../../include
-
-LIBS = -lgnucap
-
-LDFLAGS = -L../../lib/MSW
-
-.SUFFIXES:
-.SUFFIXES: .o .cc
-.cc.o:; $(CCC) $(CCFLAGS) -c $<
-#------------------------------------------------------------------------
-$(TARGET): $(TARGET)$(TARGET_EXT)
- -ln -s `which gnucap-modelgen` .
-#------------------------------------------------------------------------
-$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
- rm -f $@
- $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------
-#------------------------------------------------------------
diff --git a/modelgen/configure b/modelgen/configure
index d11d07ec..48e59b3e 100755
--- a/modelgen/configure
+++ b/modelgen/configure
@@ -1,5 +1,4 @@
#!/bin/sh
-# configure for executable
mkdir -p O
#------------- Stuff added to enable --prefix --------------
@@ -24,36 +23,31 @@ fi
sed -e "s#/usr/local#$prefix#" ../Makefile.template > Makefile
#----------------------------------------------------------------
-echo "CCFLAGS = \\" >Make.ccflags
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
-
-echo "LIBS = \\" >Make.libs
-echo "-lgnucap \\" >>Make.libs
-echo "" >>Make.libs
-echo "PREFIX = " $prefix >>Make.libs
-echo "" >>Make.libs
+echo "CCFLAGS = -fPIC \\" >Make.ccflags
+echo "-std=c++11 -DUNIX -O2 -DNDEBUG \$(INCLUDE) -W \\" >>Make.ccflags
+# begin special stuff
+# end special stuff
+echo "" >>Make.ccflags
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
-TARGET_EXT =
-
-LDFLAGS = -rdynamic \
--L../../lib/O
+CXX = c++
-.SUFFIXES : .o .cc
-.cc.o:; \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.SUFFIXES:
+.SUFFIXES: .so .o .cc
+.cc.o:; \$(CXX) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) -c \$<
+.cc.so:; \$(MAKE_LIB) \$<
#------------------------------------------------------------------------
-\$(TARGET): \$(OBJS)
- rm -f \$@
- \$(CCC) \$(CXXFLAGS) \$(CPPFLAGS) \$(CCFLAGS) \$(OBJS) -o \$@ \$(LIBS) \$(LDFLAGS)
+MAKE_EXE = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -o \$@
+MAKE_LIB = \$(CXX) \$(CCFLAGS) \$(OBJS) \$(LIBS) \$(LDFLAGS) -shared -o \$@
#------------------------------------------------------------------------
CAT_EOF
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------ >>Make2
-cat Make.ccflags Make.libs Make.sys >>Make2
-rm Make.ccflags Make.libs Make.sys
+echo "PREFIX = " $prefix >>Make2
+cat Make.ccflags Make.sys >>Make2
+rm Make.ccflags Make.sys
exit 0
diff --git a/modelgen/gnucap-modelgen b/modelgen/gnucap-modelgen
new file mode 120000
index 00000000..091d5ac7
--- /dev/null
+++ b/modelgen/gnucap-modelgen
@@ -0,0 +1 @@
+O/gnucap-modelgen \ No newline at end of file
diff --git a/modelgen/mg_.h b/modelgen/mg_.h
index 288b45b6..1e469ae8 100644
--- a/modelgen/mg_.h
+++ b/modelgen/mg_.h
@@ -83,7 +83,7 @@ protected:
}
}
public:
- virtual void parse(CS& f) = 0;
+ void parse(CS& f)override = 0;
typedef typename std::list<T*>::const_iterator const_iterator;
const_iterator begin()const {return _list.begin();}
const_iterator end()const {return _list.end();}
@@ -95,14 +95,14 @@ class C_Comment
:public Base
{
public:
- void parse(CS& f);
+ void parse(CS& f)override;
};
/*--------------------------------------------------------------------------*/
class Cxx_Comment
:public Base
{
public:
- void parse(CS& f);
+ void parse(CS& f)override;
};
/*--------------------------------------------------------------------------*/
/* A "Collection" differs from a "List" in how it is parsed.
@@ -124,7 +124,7 @@ public:
const_iterator begin()const {return _list.begin();}
const_iterator end()const {return _list.end();}
- void parse(CS& file) {
+ void parse(CS& file)override {
int paren = !BEGIN || file.skip1b(BEGIN);
size_t here = file.cursor();
for (;;) {
@@ -152,7 +152,7 @@ public:
}
}
}
- void print(std::ostream& f)const {
+ void print(std::ostream& f)const override {
f << BEGIN;
for (const_iterator i = begin(); i != end(); ++i) {
f << (**i);
@@ -180,7 +180,7 @@ public:
const_iterator begin()const {return _list.begin();}
const_iterator end()const {return _list.end();}
- void parse(CS& file) {
+ void parse(CS& file) override{
size_t here = file.cursor();
T* m = new T(file);
if (!file.stuck(&here)) {
@@ -190,7 +190,7 @@ public:
file.warn(0, "what's this??");
}
}
- void print(std::ostream& f)const {
+ void print(std::ostream& f)const override{
for (const_iterator i = begin(); i != end(); ++i) {
f << (**i);
}
@@ -204,8 +204,8 @@ class Key
std::string _var;
std::string _value;
public:
- void parse(CS& f) {f >> _name >> _var >> '=' >> _value >> ';';}
- void print(std::ostream& f)const
+ void parse(CS& f)override {f >> _name >> _var >> '=' >> _value >> ';';}
+ void print(std::ostream& f)const override
{f << name() << " " << var() << "=" << value() << "; ";}
Key(CS& f) {parse(f);}
const std::string& name()const {return _name;}
@@ -219,8 +219,8 @@ class String_Arg
{
std::string _s;
public:
- void parse(CS& f) {f >> _s >> ';';}
- void print(std::ostream& f)const {f << _s;}
+ void parse(CS& f)override {f >> _s >> ';';}
+ void print(std::ostream& f)const override {f << _s;}
void operator=(const std::string& s) {untested();_s = s;}
void operator+=(const std::string& s) {_s += s;}
bool operator!=(const std::string& s)const {return _s != s;}
@@ -234,8 +234,8 @@ class Bool_Arg
{
bool _s;
public:
- void parse(CS& f) {_s = true; f.skip1b(";");}
- void print(std::ostream& f)const {untested();f << _s;}
+ void parse(CS& f)override {_s = true; f.skip1b(";");}
+ void print(std::ostream& f)const override {untested();f << _s;}
Bool_Arg() :_s(false) {}
operator bool()const {return _s;}
};
@@ -260,8 +260,8 @@ class Parameter
bool _positive;
bool _octal;
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override;
Parameter(CS& f) :_positive(false), _octal(false) {parse(f);}
const std::string& type()const {return _type;}
const std::string& code_name()const {return _code_name;}
@@ -294,8 +294,8 @@ class Code_Block
{
std::string s;
public:
- void parse(CS& f);
- void print(std::ostream& f)const {f << s;}
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override{f << s;}
Code_Block() {}
bool is_empty()const {return s.length() < 2;}
};
@@ -311,8 +311,8 @@ class Parameter_Block
Code_Block _code_mid;
Code_Block _code_post;
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override;
const String_Arg& unnamed_value()const {return _unnamed_value;}
const Parameter_List& override()const {return _override;}
const Parameter_List& raw()const {return _raw;}
@@ -337,8 +337,8 @@ protected:
Code_Block _code;
Eval() :_name(), _code() {}
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override;
Eval(CS& f) :_name(), _code() {parse(f);}
const String_Arg& name()const {return _name;}
const Code_Block& code()const {return _code;}
@@ -349,8 +349,8 @@ class Function
:public Eval
{
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override;
Function(CS& f) :Eval() {parse(f);}
};
typedef Collection<Function> Function_List;
@@ -362,8 +362,8 @@ class Port
std::string _short_to;
std::string _short_if;
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override;
Port() {untested();}
Port(CS& f) {parse(f);}
const std::string& name()const {return _name;}
@@ -385,8 +385,8 @@ class Element
std::string _reverse;
std::string _state;
public:
- void parse(CS&);
- void print(std::ostream& f)const;
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override;
Element() {untested();}
Element(CS& f) {parse(f);}
const std::string& dev_type()const {return _dev_type;}
@@ -407,8 +407,8 @@ class Arg
{
std::string _arg;
public:
- void parse(CS& f);
- void print(std::ostream& f)const {f << " " << arg() << ";\n";}
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override {f << " " << arg() << ";\n";}
Arg(CS& f) {parse(f);}
const std::string& arg()const {return _arg;}
};
@@ -421,8 +421,8 @@ class Args
String_Arg _type;
Arg_List _arg_list;
public:
- void parse(CS& f) {f >> _name >> _type >> _arg_list;}
- void print(std::ostream& f)const
+ void parse(CS& f)override {f >> _name >> _type >> _arg_list;}
+ void print(std::ostream& f)const override
{f << " args " << name() << " " << type() << "\n"
<< arg_list() << "\n";}
Args(CS& f) {parse(f);}
@@ -445,8 +445,8 @@ class Circuit
Args_List _args_list;
bool _sync;
public:
- void parse(CS&);
- void print(std::ostream& f)const;
+ void parse(CS&) override;
+ void print(std::ostream& f)const override;
Circuit() : _sync(false) {}
bool sync()const {return _sync;}
const Port_List& req_nodes()const {return _required_nodes;}
@@ -465,8 +465,8 @@ class Probe
std::string _name;
std::string _expression;
public:
- void parse(CS& f) {f >> _name >> '=' >> _expression >> ';';}
- void print(std::ostream& f)const
+ void parse(CS& f) override{f >> _name >> '=' >> _expression >> ';';}
+ void print(std::ostream& f)const override
{f << " " << name() << " = \"" << expression() << "\";\n";}
Probe() {untested();}
Probe(CS& f) {parse(f);}
@@ -492,8 +492,8 @@ class Model
Code_Block _validate;
Bool_Arg _hide_base;
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS&) override;
+ void print(std::ostream& f)const override;
Model(CS& f) {parse(f);}
bool hide_base()const {return _hide_base;}
const String_Arg& name()const {return _name;}
@@ -525,8 +525,8 @@ class Device
Eval_List _eval_list;
Function_List _function_list;
public:
- void parse(CS& f);
- void print(std::ostream& f)const;
+ void parse(CS&) override;
+ void print(std::ostream& f)const override;
Device(CS& f) {parse(f);}
const String_Arg& name()const {return _name;}
const String_Arg& parse_name()const {return _parse_name;}
@@ -551,8 +551,8 @@ class Head
{
std::string s;
public:
- void parse(CS& f);
- void print(std::ostream& f)const {f << s;}
+ void parse(CS& f)override;
+ void print(std::ostream& f)const override{f << s;}
Head() {}
};
/*--------------------------------------------------------------------------*/
@@ -563,7 +563,7 @@ class Attribute
String_Arg _name;
String_Arg _value;
public:
- void parse(CS& f);
+ void parse(CS& f)override;
Attribute(CS& f) {untested();parse(f);}
const String_Arg& name()const {untested();return _name;}
const String_Arg& value()const {untested();return _value;}
diff --git a/modelgen/mg_out_h.cc b/modelgen/mg_out_h.cc
index bd2ad8da..4c5b61bd 100644
--- a/modelgen/mg_out_h.cc
+++ b/modelgen/mg_out_h.cc
@@ -46,7 +46,7 @@ static void make_sdp(std::ofstream& out, const Model& m)
"public:\n"
" explicit SDP_" << m.name() << "(const COMMON_COMPONENT* c) : SDP_"
<< m.inherit() << "(c) {init(c);}\n"
- " void init(const COMMON_COMPONENT*);\n"
+ " void init(const COMMON_COMPONENT*)override;\n"
"public:\n";
Parameter_List::const_iterator p = m.size_dependent().raw().begin();
for (;;) {
@@ -104,18 +104,18 @@ static void make_model(std::ofstream& out, const Model& m)
" explicit " << class_name << "(const BASE_SUBCKT*);\n"
" ~" << class_name << "() {--_count;}\n"
"public: // override virtual\n"
- " std::string dev_type()const;\n"
- " void set_dev_type(const std::string& nt);\n"
- " CARD* clone()const {return new " << class_name << "(*this);}\n"
- " void precalc_first();\n"
- " void precalc_last();\n"
- " SDP_CARD* new_sdp(COMMON_COMPONENT* c)const;\n"
- " void set_param_by_index(int, std::string&, int);\n"
- " bool param_is_printable(int)const;\n"
- " std::string param_name(int)const;\n"
- " std::string param_name(int,int)const;\n"
- " std::string param_value(int)const;\n"
- " int param_count()const {return (" << 1 + m.independent().override().size()
+ " std::string dev_type()const override;\n"
+ " void set_dev_type(const std::string& nt) override;\n"
+ " CARD* clone()const override {return new " << class_name << "(*this);}\n"
+ " void precalc_first() override;\n"
+ " void precalc_last() override;\n"
+ " SDP_CARD* new_sdp(COMMON_COMPONENT* c)const override;\n"
+ " void set_param_by_index(int, std::string&, int) override;\n"
+ " bool param_is_printable(int)const override;\n"
+ " std::string param_name(int)const override;\n"
+ " std::string param_name(int,int)const override;\n"
+ " std::string param_value(int)const override;\n"
+ " int param_count()const override {return (" << 1 + m.independent().override().size()
+ 4 * m.size_dependent().raw().size() + m.independent().raw().size();
if (!m.hide_base()) {
out << " + MODEL_" << m.inherit() << "::param_count());}\n";
@@ -123,8 +123,8 @@ static void make_model(std::ofstream& out, const Model& m)
out << ");}\n";
}
out <<
- " bool is_valid(const COMPONENT*)const;\n"
- " void tr_eval(COMPONENT*)const;\n"
+ " bool is_valid(const COMPONENT*)const override;\n"
+ " void tr_eval(COMPONENT*)const override;\n"
"public: // not virtual\n"
" static int count() {return _count;}\n"
"private: // strictly internal\n";
@@ -168,20 +168,20 @@ static void make_common(std::ofstream& out, const Device& d)
" explicit " << class_name << "(const " << class_name << "& p);\n"
" explicit " << class_name << "(int c=0);\n"
" ~" << class_name << "();\n"
- " bool operator==(const COMMON_COMPONENT&)const;\n"
- " COMMON_COMPONENT* clone()const {return new "<<class_name<<"(*this);}\n"
- " void set_param_by_index(int, std::string&, int);\n"
- " bool param_is_printable(int)const;\n"
- " std::string param_name(int)const;\n"
- " std::string param_name(int,int)const;\n"
- " std::string param_value(int)const;\n"
- " int param_count()const {return ("
+ " bool operator==(const COMMON_COMPONENT&)const override;\n"
+ " COMMON_COMPONENT* clone()const override {return new "<<class_name<<"(*this);}\n"
+ " void set_param_by_index(int, std::string&, int) override;\n"
+ " bool param_is_printable(int)const override;\n"
+ " std::string param_name(int)const override;\n"
+ " std::string param_name(int,int)const override;\n"
+ " std::string param_value(int)const override;\n"
+ " int param_count()const override{return ("
<< d.common().override().size() + d.common().raw().size()
<< " + COMMON_COMPONENT::param_count());}\n"
- " void expand(const COMPONENT*);\n"
- " void precalc_last(const CARD_LIST*);\n"
- " std::string name()const {itested();return \"" << d.parse_name() << "\";}\n"
- " const SDP_CARD* sdp()const {return _sdp;}\n"
+ " void expand(const COMPONENT*)override;\n"
+ " void precalc_last(const CARD_LIST*)override;\n"
+ " std::string name()const override{itested();return \"" << d.parse_name() << "\";}\n"
+ " const SDP_CARD* sdp()const{return _sdp;}\n"
" bool has_sdp()const {untested();return _sdp;}\n"
" static int count() {return _count;}\n"
"private: // strictly internal\n"
@@ -227,12 +227,12 @@ static void make_device(std::ofstream& out, const Device& d)
" explicit " << class_name << "();\n"
" ~" << class_name << "() {--_count;}\n"
"private: // override virtual\n"
- " char id_letter()const {untested();return '" << d.id_letter() << "';}\n"
- " bool print_type_in_spice()const {return true;}\n"
- " std::string value_name()const {return \"area\";}\n"
- " //std::string dev_type()const; //BASE_SUBCKT\n"
- " int max_nodes()const {return " << d.max_nodes() << ";}\n"
- " int min_nodes()const {return " << d.min_nodes() << ";}\n";
+ " char id_letter()const override {untested();return '" << d.id_letter() << "';}\n"
+ " bool print_type_in_spice()const override {return true;}\n"
+ " std::string value_name()const override {return \"area\";}\n"
+ " //std::string dev_type()const override; //BASE_SUBCKT\n"
+ " int max_nodes()const override {return " << d.max_nodes() << ";}\n"
+ " int min_nodes()const override {return " << d.min_nodes() << ";}\n";
if (d.max_nodes() != d.min_nodes()) {
out <<
" //int matrix_nodes()const; //BASE_SUBCKT\n"
@@ -240,16 +240,16 @@ static void make_device(std::ofstream& out, const Device& d)
}else{
out <<
" //int matrix_nodes()const; //BASE_SUBCKT\n"
- " int net_nodes()const {return " << d.max_nodes() << ";}\n";
+ " int net_nodes()const override {return " << d.max_nodes() << ";}\n";
}
out <<
- " int int_nodes()const {return "
+ " int int_nodes()const override {return "
<< d.circuit().local_nodes().size() << ";}\n"
- " CARD* clone()const {return new "
+ " CARD* clone()const override {return new "
<< class_name << "(*this);}\n"
- " void precalc_first() {COMPONENT::precalc_first(); if(subckt()) subckt()->precalc_first();}\n"
- " void expand();\n"
- " void precalc_last() {COMPONENT::precalc_last(); assert(subckt()); subckt()->precalc_last();}\n"
+ " void precalc_first()override {COMPONENT::precalc_first(); if(subckt()) subckt()->precalc_first();}\n"
+ " void expand()override;\n"
+ " void precalc_last()override {COMPONENT::precalc_last(); assert(subckt()); subckt()->precalc_last();}\n"
" //void map_nodes(); //BASE_SUBCKT\n"
" //void tr_begin(); //BASE_SUBCKT\n"
" //void tr_restore(); //BASE_SUBCKT\n";
@@ -263,19 +263,19 @@ static void make_device(std::ofstream& out, const Device& d)
" //bool do_tr(); //BASE_SUBCKT\n";
}else{
out <<
- " void dc_advance() {set_not_converged(); BASE_SUBCKT::dc_advance();}\n"
- " void tr_advance() {set_not_converged(); BASE_SUBCKT::tr_advance();}\n"
- " void tr_regress() {set_not_converged(); BASE_SUBCKT::tr_regress();}\n"
- " bool tr_needs_eval()const;\n"
- " void tr_queue_eval() {if(tr_needs_eval()){q_eval();}}\n"
- " bool do_tr();\n";
+ " void dc_advance()override {set_not_converged(); BASE_SUBCKT::dc_advance();}\n"
+ " void tr_advance()override {set_not_converged(); BASE_SUBCKT::tr_advance();}\n"
+ " void tr_regress()override {set_not_converged(); BASE_SUBCKT::tr_regress();}\n"
+ " bool tr_needs_eval()const override;\n"
+ " void tr_queue_eval()override {if(tr_needs_eval()){q_eval();}}\n"
+ " bool do_tr()override;\n";
}
out <<
" //void tr_load(); //BASE_SUBCKT\n"
" //double tr_review(); //BASE_SUBCKT\n"
" //void tr_accept(); //BASE_SUBCKT\n"
" //void tr_unload(); //BASE_SUBCKT\n"
- " double tr_probe_num(const std::string&)const;\n"
+ " double tr_probe_num(const std::string&)const override;\n"
" //void ac_begin(); //BASE_SUBCKT\n"
" //void do_ac(); //BASE_SUBCKT\n"
" //void ac_load(); //BASE_SUBCKT\n"
@@ -345,7 +345,7 @@ static void make_device(std::ofstream& out, const Device& d)
+ d.circuit().local_nodes().size();
out << "};\n"
" node_t _nodes[" << total_nodes << "];\n"
- " std::string port_name(int i)const {\n"
+ " std::string port_name(int i)const override {\n"
" assert(i >= 0);\n"
" assert(i < " << d.circuit().req_nodes().size() + d.circuit().opt_nodes().size() << ");\n"
" static std::string names[] = {";
@@ -381,13 +381,13 @@ static void make_eval(std::ofstream& out, const Eval& e,
" :COMMON_COMPONENT(p) {}\n"
"public:\n"
" explicit "<< class_name << "(int c=0) :COMMON_COMPONENT(c) {}\n"
- " bool operator==(const COMMON_COMPONENT& x)const "
+ " bool operator==(const COMMON_COMPONENT& x)const override"
"{return COMMON_COMPONENT::operator==(x);}\n"
- " COMMON_COMPONENT* clone()const {return new "<<class_name<<"(*this);}\n"
- " std::string name()const {untested(); return \""<< class_name << "\";}\n"
- " void tr_eval(ELEMENT*d)const;\n"
- " bool has_tr_eval()const {return true;}\n"
- " bool has_ac_eval()const {return false;}\n"
+ " COMMON_COMPONENT* clone()const override{return new "<<class_name<<"(*this);}\n"
+ " std::string name()const override {untested(); return \""<< class_name << "\";}\n"
+ " void tr_eval(ELEMENT*d)const override;\n"
+ " bool has_tr_eval()const override {return true;}\n"
+ " bool has_ac_eval()const override {return false;}\n"
"};\n"
"/*--------------------------------------"
"------------------------------------*/\n";
diff --git a/tests/==out/bm_fit.0.1.ckt.out b/tests/==out/bm_fit.0.1.ckt.out
index 80b24193..d346e43a 100644
--- a/tests/==out/bm_fit.0.1.ckt.out
+++ b/tests/==out/bm_fit.0.1.ckt.out
@@ -10,3 +10,8 @@ duplicate points in spline: 9., 9.
duplicate points in spline: 9., 9.
duplicate points in spline: 9., 9.
duplicate points in spline: 9., 9.
+Gnucap System status
+iterations: op=0, dc=0, tran=0, fourier=0, total=4
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=4, subckt=0, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/bm_fit.1.1.ckt.out b/tests/==out/bm_fit.1.1.ckt.out
index ede1a52e..f7f22f49 100644
--- a/tests/==out/bm_fit.1.1.ckt.out
+++ b/tests/==out/bm_fit.1.1.ckt.out
@@ -48,3 +48,8 @@ r4 ( 4 0 ) 10.K
50. 50. 25. 5. -50.K
59. 59. 29.5 5.5 -55.K
68. 68. 34. 6. -60.K
+Gnucap System status
+iterations: op=4, dc=20, tran=0, fourier=0, total=152
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=4, subckt=0, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/bm_fit.2.1.ckt.out b/tests/==out/bm_fit.2.1.ckt.out
index bdd153c7..ba4846fa 100644
--- a/tests/==out/bm_fit.2.1.ckt.out
+++ b/tests/==out/bm_fit.2.1.ckt.out
@@ -90,3 +90,8 @@ e1 ( 4 0 5 1 ) fit( 0., 0. 1., 1. 4., 2. 9., 3. 16., 4. 25., 5. ) order=2
9.5 1.u 9.5 12.25 12.25 90.25 65.5 65.5
9.75 1.u 9.75 12.785 12.785 95.063 67.75 67.75
10. 1.u 10. 13.333 13.333 100. 70. 70.
+Gnucap System status
+iterations: op=5, dc=431, tran=0, fourier=0, total=436
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=7, subckt=0, model=0, total=7
+dctran density=59.2%, ac density=59.2%
diff --git a/tests/==out/bm_fit.2.2.ckt.out b/tests/==out/bm_fit.2.2.ckt.out
index df2d7a27..6cef2e5e 100644
--- a/tests/==out/bm_fit.2.2.ckt.out
+++ b/tests/==out/bm_fit.2.2.ckt.out
@@ -90,3 +90,8 @@ e1 ( 4 0 5 1 ) fit( 0., 0. 1., 1. 4., 2. 9., 3. 16., 4. 25., 5. ) order=2 b
9.5 1.u 9.5 11.525 11.525 90.25 70. 70.
9.75 1.u 9.75 12.006 12.006 95.063 72.5 72.5
10. 1.u 10. 12.5 12.5 100. 75. 75.
+Gnucap System status
+iterations: op=5, dc=431, tran=0, fourier=0, total=436
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=7, subckt=0, model=0, total=7
+dctran density=59.2%, ac density=59.2%
diff --git a/tests/==out/bm_fit.2.3.ckt.out b/tests/==out/bm_fit.2.3.ckt.out
index a7589932..39e63a90 100644
--- a/tests/==out/bm_fit.2.3.ckt.out
+++ b/tests/==out/bm_fit.2.3.ckt.out
@@ -90,3 +90,8 @@ e1 ( 4 0 5 1 ) fit( 0., 0. 1., 1. 4., 2. 9., 3. 16., 4. 25., 5. ) order=2 a
9.5 1.u 9.5 11.525 11.525 90.25 70. 70.
9.75 1.u 9.75 12.006 12.006 95.063 72.5 72.5
10. 1.u 10. 12.5 12.5 100. 75. 75.
+Gnucap System status
+iterations: op=5, dc=431, tran=0, fourier=0, total=436
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=7, subckt=0, model=0, total=7
+dctran density=59.2%, ac density=59.2%
diff --git a/tests/==out/bm_fit.3.3.ckt.out b/tests/==out/bm_fit.3.3.ckt.out
index 53de62a1..d4844653 100644
--- a/tests/==out/bm_fit.3.3.ckt.out
+++ b/tests/==out/bm_fit.3.3.ckt.out
@@ -102,3 +102,8 @@
9.8n 5.
9.9n 5.
10.n 5.
+Gnucap System status
+iterations: op=0, dc=0, tran=254, fourier=0, total=356
+transient timesteps: accepted=102, rejected=0, total=102
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/bm_table.1.1.ckt.out b/tests/==out/bm_table.1.1.ckt.out
index 2b0dab9f..eb1592c3 100644
--- a/tests/==out/bm_table.1.1.ckt.out
+++ b/tests/==out/bm_table.1.1.ckt.out
@@ -49,3 +49,8 @@ r4 ( 4 0 ) 10.K
50. 50. 25. 5. -50.K
59. 59. 29.5 5.5 -55.K
68. 68. 34. 6. -60.K
+Gnucap System status
+iterations: op=4, dc=20, tran=0, fourier=0, total=152
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=4, subckt=0, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/bm_table.2.1.ckt.out b/tests/==out/bm_table.2.1.ckt.out
index dd1aa0fc..6b827b5c 100644
--- a/tests/==out/bm_table.2.1.ckt.out
+++ b/tests/==out/bm_table.2.1.ckt.out
@@ -92,3 +92,8 @@ e1 ( 4 0 5 1 ) t2
9.5 1.u 9.5 12.25 12.25 90.25 65.5 65.5
9.75 1.u 9.75 12.785 12.785 95.063 67.75 67.75
10. 1.u 10. 13.333 13.333 100. 70. 70.
+Gnucap System status
+iterations: op=5, dc=431, tran=0, fourier=0, total=436
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=7, subckt=0, model=0, total=7
+dctran density=59.2%, ac density=59.2%
diff --git a/tests/==out/bm_table.2.3.ckt.out b/tests/==out/bm_table.2.3.ckt.out
index 09eb4161..7f73a200 100644
--- a/tests/==out/bm_table.2.3.ckt.out
+++ b/tests/==out/bm_table.2.3.ckt.out
@@ -92,3 +92,8 @@ e1 ( 4 0 5 1 ) t2
9.5 1.u 9.5 11.525 11.525 90.25 70. 70.
9.75 1.u 9.75 12.006 12.006 95.063 72.5 72.5
10. 1.u 10. 12.5 12.5 100. 75. 75.
+Gnucap System status
+iterations: op=5, dc=431, tran=0, fourier=0, total=436
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=7, subckt=0, model=0, total=7
+dctran density=59.2%, ac density=59.2%
diff --git a/tests/==out/bm_table.2.4.ckt.out b/tests/==out/bm_table.2.4.ckt.out
index a55ed7d7..0f2fb9a0 100644
--- a/tests/==out/bm_table.2.4.ckt.out
+++ b/tests/==out/bm_table.2.4.ckt.out
@@ -92,3 +92,8 @@ e1 ( 4 0 5 1 ) t2
9.5 1.u 9.5 11.525 11.525 90.25 70. 70.
9.75 1.u 9.75 12.006 12.006 95.063 72.5 72.5
10. 1.u 10. 12.5 12.5 100. 75. 75.
+Gnucap System status
+iterations: op=5, dc=431, tran=0, fourier=0, total=436
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=7, subckt=0, model=0, total=7
+dctran density=59.2%, ac density=59.2%
diff --git a/tests/==out/bm_table.3.1.ckt.out b/tests/==out/bm_table.3.1.ckt.out
index 133354d6..57ce5dcf 100644
--- a/tests/==out/bm_table.3.1.ckt.out
+++ b/tests/==out/bm_table.3.1.ckt.out
@@ -80,3 +80,8 @@ r4 ( 4 0 ) 10.K
56.5 56.5 8.4855 510.18
61. 61. 8.9834 552.58
65.5 65.5 9.4813 594.97
+Gnucap System status
+iterations: op=4, dc=48, tran=0, fourier=0, total=280
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=3, subckt=0, model=0, total=3
+dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/bm_table.3.2.ckt.out b/tests/==out/bm_table.3.2.ckt.out
index 3a58e6c7..69f2e081 100644
--- a/tests/==out/bm_table.3.2.ckt.out
+++ b/tests/==out/bm_table.3.2.ckt.out
@@ -80,3 +80,8 @@ r4 ( 4 0 ) 10.K
56.5 56.5 8.7047 25.
61. 61. 9.2339 25.
65.5 65.5 9.7631 25.
+Gnucap System status
+iterations: op=4, dc=48, tran=0, fourier=0, total=280
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=3, subckt=0, model=0, total=3
+dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/bm_table.3.3.ckt.out b/tests/==out/bm_table.3.3.ckt.out
index 53de62a1..d4844653 100644
--- a/tests/==out/bm_table.3.3.ckt.out
+++ b/tests/==out/bm_table.3.3.ckt.out
@@ -102,3 +102,8 @@
9.8n 5.
9.9n 5.
10.n 5.
+Gnucap System status
+iterations: op=0, dc=0, tran=254, fourier=0, total=356
+transient timesteps: accepted=102, rejected=0, total=102
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/bm_tanh.1.ckt.out b/tests/==out/bm_tanh.1.ckt.out
index a56b45a8..a6bade8d 100644
--- a/tests/==out/bm_tanh.1.ckt.out
+++ b/tests/==out/bm_tanh.1.ckt.out
@@ -59,3 +59,8 @@ v1 ( 1 0 ) generator scale= 1.
e1 ( 2 0 1 0 ) tanh gain= 5. limit= 5.
e2 ( 3 0 1 0 ) tanh gain=-5. limit= 3.
e3 ( 4 0 1 0 ) tanh gain= 4. limit= 3.
+Gnucap System status
+iterations: op=0, dc=4, tran=0, fourier=0, total=179
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=4, subckt=0, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/bm_tanh.2.ckt.out b/tests/==out/bm_tanh.2.ckt.out
index 3ce46578..fb4c7b6c 100644
--- a/tests/==out/bm_tanh.2.ckt.out
+++ b/tests/==out/bm_tanh.2.ckt.out
@@ -351,3 +351,8 @@
8.Meg 8.Meg 0.01
9.Meg 9.Meg 0.01
10.Meg 10.Meg 0.01
+Gnucap System status
+iterations: op=0, dc=84, tran=0, fourier=0, total=1344
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/bmm_res.4.ckt.out b/tests/==out/bmm_res.4.ckt.out
index 6d9e5a45..1d1b1d8c 100644
--- a/tests/==out/bmm_res.4.ckt.out
+++ b/tests/==out/bmm_res.4.ckt.out
@@ -1,12 +1,12 @@
# semiconductor "resistor" test
r2: t1: effective length is negative or zero
-# v(1) v(2) r(r1) r(r2)
+# v(1) v(2) r(r1) r(r2) iter(0)
r2: t1: effective length is negative or zero
r2: short circuit
r2: short circuit
r2: short circuit
r2: short circuit
- 27. 2. 0. 1.K 10.u
+ 27. 2. 20.n 1.K 10.u 4.
r2: t1: effective length is negative or zero
#Freq v(1) v(2)
r2: short circuit
@@ -15,3 +15,8 @@ v1 ( 1 0 ) DC 2. AC 5.
r1 ( 1 2 ) 1.K
r2 ( 2 0 ) t1 l= 1.u w= 2.u
.model t1 r ( rsh=1k narrow=1u defw=NA( 1.u) tc1=NA( 0.) tc2=NA( 0.) tnom=NA( 27.))
+Gnucap System status
+iterations: op=4, dc=0, tran=0, fourier=0, total=5
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/bmm_res.4p.ckt.out b/tests/==out/bmm_res.4p.ckt.out
index 6c4afd36..6564d1e0 100644
--- a/tests/==out/bmm_res.4p.ckt.out
+++ b/tests/==out/bmm_res.4p.ckt.out
@@ -1,12 +1,12 @@
# semiconductor "resistor" test
r2: t1: effective length is negative or zero
-# v(1) v(2) r(r1) r(r2)
+# v(1) v(2) r(r1) r(r2) iter(0)
r2: t1: effective length is negative or zero
r2: short circuit
r2: short circuit
r2: short circuit
r2: short circuit
- 27. 2. 0. 1.K 10.u
+ 27. 2. 20.n 1.K 10.u 4.
r2: t1: effective length is negative or zero
#Freq v(1) v(2)
r2: short circuit
@@ -15,3 +15,8 @@ v1 ( 1 0 ) DC 2. AC 5.
r1 ( 1 2 ) 1.K
r2 ( 2 0 ) t1 l=pl w=pw
.model t1 r ( rsh=1k narrow=1u defw=NA( 1.u) tc1=NA( 0.) tc2=NA( 0.) tnom=NA( 27.))
+Gnucap System status
+iterations: op=4, dc=0, tran=0, fourier=0, total=5
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/c_eval.1.ckt.out b/tests/==out/c_eval.1.ckt.out
index b44a6ac5..8f67502a 100644
--- a/tests/==out/c_eval.1.ckt.out
+++ b/tests/==out/c_eval.1.ckt.out
@@ -1,7 +1,5 @@
* unknown parameter check
-parameter 3+a+1+1 not specified, using default
-parameter 3+a+1+1 value is "NOT_INPUT"
-x= NA
+x=(a + 5.)
(((3 + a) + 1) + 1)=(a + 5.)
(a + b)=(b + a)
(((2 + a) + b) + 3)=(((a + 2) + b) + 3)
diff --git a/tests/==out/c_eval.2.ckt.out b/tests/==out/c_eval.2.ckt.out
new file mode 100644
index 00000000..d12fb7ff
--- /dev/null
+++ b/tests/==out/c_eval.2.ckt.out
@@ -0,0 +1,12 @@
+* unknown parameter check
+>>>>>.param x='3+a+1+1+exp(b-17)-3'
+>>>>>.param a = sqrt(b)
+>>>>>.eval x
+x=((((3 + sqrt(b)) + 2.) + exp((b - 17))) - 3)
+>>>>>.eval 3+a+1+1+exp(b-17)-3
+(((((3 + a) + 1) + 1) + exp((b - 17))) - 3)=((((3 + sqrt(b)) + 2.) + exp((b - 17))) - 3)
+>>>>>.param a={2+b}
+>>>>>.eval x
+x=((((3 + (b + 2)) + 2.) + exp((b - 17))) - 3)
+>>>>>.eval 3+a+1+1
+(((3 + a) + 1) + 1)=((3 + (b + 2)) + 2.)
diff --git a/tests/==out/c_eval.3.ckt.out b/tests/==out/c_eval.3.ckt.out
new file mode 100644
index 00000000..73e281ff
--- /dev/null
+++ b/tests/==out/c_eval.3.ckt.out
@@ -0,0 +1,11 @@
+* unknown parameter check
+x=max(a, 2)
+y=min(a, 2)
+z=(zz + 3)
+max(a, 2)=max(a, 2)
+min(a, 2)=min(a, 2)
+min(exp((- 1)), exp((- 2)))= 0.135335283236613
+min(exp(a), exp(b))=min(exp(a), exp(b))
+x= 2.
+max(a, 2)= 2.
+min(exp(a), exp((b + a)))=min( 7.38905609893065, exp((b + 2.)))
diff --git a/tests/==out/c_eval.error.0.ckt.out b/tests/==out/c_eval.error.0.ckt.out
new file mode 100644
index 00000000..6ae32761
--- /dev/null
+++ b/tests/==out/c_eval.error.0.ckt.out
@@ -0,0 +1,8 @@
+* unknown parameter check
+.eval z
+ ^ ? parameter z: recursion too deep
+.eval z
+ ^ ? parameter z: recursion too deep
+.eval z
+ ^ ? parameter z: recursion too deep
+a= 1.
diff --git a/tests/==out/d_bjt-diffpair-dc.ckt.out b/tests/==out/d_bjt-diffpair-dc.ckt.out
index c905320d..ccc086a9 100644
--- a/tests/==out/d_bjt-diffpair-dc.ckt.out
+++ b/tests/==out/d_bjt-diffpair-dc.ckt.out
@@ -55,3 +55,8 @@ difpair ckt - simple differential pair
27. -7.6611u -0.0025152 0.0025306
# p(vin) p(vcc) p(vee)
27. 586.9E-18 -0.030183 -0.030367
+Gnucap System status
+iterations: op=9, dc=0, tran=0, fourier=0, total=243
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=9, subckt=0, model=4, total=13
+dctran density=65.7%, ac density=65.7%
diff --git a/tests/==out/d_ccvs.2.ckt.out b/tests/==out/d_ccvs.2.ckt.out
index 2f5b70f6..79a18824 100644
--- a/tests/==out/d_ccvs.2.ckt.out
+++ b/tests/==out/d_ccvs.2.ckt.out
@@ -15,3 +15,8 @@
+ v(22) v(3) v(4) v(5) v(6) v(7) v(8) v(9) i(v7) i(v8)
1.K 110. 110. 88. 1.1001 1.1 88. 1.1 1.1001 1.1 88. 11. 880. 8.8 11.
+ 8.8 110. 110. 88. 110. 110. 88. 110. 1.1 1.1
+Gnucap System status
+iterations: op=3, dc=0, tran=15, fourier=0, total=24
+transient timesteps: accepted=5, rejected=0, total=5
+nodes: user=22, subckt=0, model=0, total=22
+dctran density=10.7%, ac density=10.7%
diff --git a/tests/==out/d_diode.1.ckt.out b/tests/==out/d_diode.1.ckt.out
index 53f97a5c..216b8e8e 100644
--- a/tests/==out/d_diode.1.ckt.out
+++ b/tests/==out/d_diode.1.ckt.out
@@ -6,26 +6,26 @@ D1 ( 2 0 ) ddd 1
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cd(D1) z(D1) zraw(D1) gd(D1) z(2)
27. 10. 0.59396 -94.061u 94.06u 94.06u 0.59396 274.97 1.5471p 100.K 274.22 0.0036367 274.22
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cd(D1) z(D1) zraw(D1) gd(D1) z(2) iter(0)
--10. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.01p -10.f -8. 553.9E144 333.33f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.01p -10.f -6. 144.8E111 377.96f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.01p -10.f -4. 37.85E+78 447.21f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.01p -10.f -2. 9.894E+45 577.35f 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 5.
2. 2. 0.54568 -14.543u 14.543u 14.543u 0.54568 1.7784K 1.4788p 100.K 1.7474K 562.29u 1.7474K 10.
4. 4. 0.56789 -34.321u 34.321u 34.321u 0.56789 753.59 1.5102p 100.K 747.96 0.001327 747.96 5.
6. 6. 0.5797 -54.203u 54.203u 54.203u 0.5797 477.17 1.5269p 100.K 474.91 0.0020957 474.91 5.
8. 8. 0.5878 -74.122u 74.122u 74.122u 0.5878 348.94 1.5384p 100.K 347.73 0.0028658 347.73 5.
10. 10. 0.59396 -94.061u 94.06u 94.06u 0.59396 274.97 1.5471p 100.K 274.22 0.0036367 274.22 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cd(D1) z(D1) zraw(D1) gd(D1) z(2)
27. 10. 0.59396 -94.061u 94.06u 94.06u 0.59396 274.97 1.5471p 100.K 274.22 0.0036367 274.22
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=72
+iterations: op=9, dc=56, tran=0, fourier=0, total=74
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.12.ckt.out b/tests/==out/d_diode.12.ckt.out
index 9a0fd062..a859bb04 100644
--- a/tests/==out/d_diode.12.ckt.out
+++ b/tests/==out/d_diode.12.ckt.out
@@ -8,6 +8,7 @@ D1 ( 2 0 ) ddd 1.
-1. -10. -10. 0. -13.866p -3.8663p -10. 2.586E+12 1.p 100.K 100.K 386.64f 100.K
-2. -10. -10. 0. -10.01p -10.f -10. Inf 301.51f 100.K 100.K 0. 100.K
-3. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K
+-4. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K
27. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K
#Freq vr(2) vi(2)
10. 1. -1.8945u
@@ -20,12 +21,12 @@ D1 ( 2 0 ) ddd 1.
100.Meg 0.0027786 -0.052639
1.G 27.863u -0.0052784
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cd(D1) z(D1) zraw(D1) gd(D1) z(2) iter(0)
--10. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.01p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.01p -10.f -8. 553.9E144 333.33f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.01p -10.f -6. 144.8E111 377.96f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.01p -10.f -4. 37.85E+78 447.21f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.01p -10.f -2. 9.894E+45 577.35f 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 5.
#Freq vr(2) vi(2)
10. 1. -6.2832u
100. 1. -62.832u
@@ -221,7 +222,7 @@ v(2) -10. -5. 0. 5.
100.Meg 250.29u -0.015819
1.G 2.5035u -0.0015823
Gnucap System status
-iterations: op=4, dc=24, tran=365, fourier=0, total=2342
-transient timesteps: accepted=284, rejected=8, total=292
+iterations: op=5, dc=26, tran=376, fourier=0, total=2398
+transient timesteps: accepted=292, rejected=8, total=300
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.2.ckt.out b/tests/==out/d_diode.2.ckt.out
index 4e6abe82..bc6eb5b4 100644
--- a/tests/==out/d_diode.2.ckt.out
+++ b/tests/==out/d_diode.2.ckt.out
@@ -1,3 +1,8 @@
simple diode test
# v(1) v(2)
27. 10. 2.1726
+Gnucap System status
+iterations: op=9, dc=0, tran=0, fourier=0, total=9
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=1, total=3
+dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/d_diode.3.ckt.out b/tests/==out/d_diode.3.ckt.out
index ab60a2db..1581a2d0 100644
--- a/tests/==out/d_diode.3.ckt.out
+++ b/tests/==out/d_diode.3.ckt.out
@@ -11,14 +11,14 @@ D1 ( 2 0 ) ddd 1.
-6. -6. -3. 30.u -30.u -30.u -3. 100.K 500.f 100.K 50.K 10.u 50.K 4.
-4. -4. -2. 20.u -20.u -20.u -2. 100.K 577.35f 100.K 50.K 10.u 50.K 4.
-2. -2. -1. 10.u -10.u -10.u -1. 100.K 707.11f 100.K 50.K 10.u 50.K 4.
- 0. 0. 0. 0. 0. 0. 0. 100.K 1.p 100.K 50.K 10.u 50.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 100.K 1.p 100.K 50.K 10.u 50.K 5.
2. 2. 0.53636 -14.636u 14.636u 14.636u 0.53636 1.7364K 1.4656p 100.K 1.7068K 575.89u 1.7068K 6.
4. 4. 0.56367 -34.363u 34.363u 34.363u 0.56367 747.05 1.5043p 100.K 741.51 0.0013386 741.51 5.
6. 6. 0.57697 -54.23u 54.23u 54.23u 0.57697 474.67 1.5231p 100.K 472.43 0.0021067 472.43 5.
8. 8. 0.58576 -74.142u 74.142u 74.142u 0.58576 347.63 1.5355p 100.K 346.43 0.0028766 346.43 5.
10. 10. 0.59234 -94.077u 94.077u 94.077u 0.59234 274.17 1.5448p 100.K 273.42 0.0036473 273.42 5.
Gnucap System status
-iterations: op=6, dc=50, tran=0, fourier=0, total=56
+iterations: op=6, dc=51, tran=0, fourier=0, total=57
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.59234 -94.077u 94.077u 94.077u 0.59234 274.17 1.5448p 100.K 273.42 0.0036473 273.42
Gnucap System status
-iterations: op=6, dc=10, tran=0, fourier=0, total=72
+iterations: op=6, dc=10, tran=0, fourier=0, total=73
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.4.ckt.out b/tests/==out/d_diode.4.ckt.out
index 9d9095de..9cee2091 100644
--- a/tests/==out/d_diode.4.ckt.out
+++ b/tests/==out/d_diode.4.ckt.out
@@ -6,19 +6,19 @@ D1 ( 2 0 ) ddd 2.
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.57608 -94.239u 94.239u 94.239u 0.57608 274.45 3.0436p 100.K 273.7 0.0036436 273.7
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2) iter(0)
--10. -10. -10. 0. -10.02p -20.f -10. 1.06E180 603.02f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.02p -20.f -10. 1.06E180 603.02f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.02p -20.f -8. 277.E144 666.67f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.02p -20.f -6. 72.4E111 755.93f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.02p -20.f -4. 18.93E+78 894.43f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.02p -20.f -2. 4.947E+45 1.1547p 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 1.293E+12 2.p 100.K 100.K 773.27f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 1.293E+12 2.p 100.K 100.K 773.27f 100.K 5.
2. 2. 0.52806 -14.719u 14.719u 14.719u 0.52806 1.7572K 2.9078p 100.K 1.7268K 569.1u 1.7268K 10.
4. 4. 0.55009 -34.499u 34.499u 34.499u 0.55009 749.71 2.9701p 100.K 744.13 0.0013339 744.13 5.
6. 6. 0.56186 -54.381u 54.381u 54.381u 0.56186 475.61 3.0034p 100.K 473.36 0.0021026 473.36 5.
8. 8. 0.56993 -74.301u 74.301u 74.301u 0.56993 348.1 3.0262p 100.K 346.89 0.0028727 346.89 5.
10. 10. 0.57608 -94.239u 94.239u 94.239u 0.57608 274.45 3.0436p 100.K 273.7 0.0036436 273.7 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.57608 -94.239u 94.239u 94.239u 0.57608 274.45 3.0436p 100.K 273.7 0.0036436 273.7
Gnucap System status
-iterations: op=9, dc=13, tran=0, fourier=0, total=85
+iterations: op=9, dc=13, tran=0, fourier=0, total=87
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.5.ckt.out b/tests/==out/d_diode.5.ckt.out
index 9d9095de..9cee2091 100644
--- a/tests/==out/d_diode.5.ckt.out
+++ b/tests/==out/d_diode.5.ckt.out
@@ -6,19 +6,19 @@ D1 ( 2 0 ) ddd 2.
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.57608 -94.239u 94.239u 94.239u 0.57608 274.45 3.0436p 100.K 273.7 0.0036436 273.7
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2) iter(0)
--10. -10. -10. 0. -10.02p -20.f -10. 1.06E180 603.02f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.02p -20.f -10. 1.06E180 603.02f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.02p -20.f -8. 277.E144 666.67f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.02p -20.f -6. 72.4E111 755.93f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.02p -20.f -4. 18.93E+78 894.43f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.02p -20.f -2. 4.947E+45 1.1547p 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 1.293E+12 2.p 100.K 100.K 773.27f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 1.293E+12 2.p 100.K 100.K 773.27f 100.K 5.
2. 2. 0.52806 -14.719u 14.719u 14.719u 0.52806 1.7572K 2.9078p 100.K 1.7268K 569.1u 1.7268K 10.
4. 4. 0.55009 -34.499u 34.499u 34.499u 0.55009 749.71 2.9701p 100.K 744.13 0.0013339 744.13 5.
6. 6. 0.56186 -54.381u 54.381u 54.381u 0.56186 475.61 3.0034p 100.K 473.36 0.0021026 473.36 5.
8. 8. 0.56993 -74.301u 74.301u 74.301u 0.56993 348.1 3.0262p 100.K 346.89 0.0028727 346.89 5.
10. 10. 0.57608 -94.239u 94.239u 94.239u 0.57608 274.45 3.0436p 100.K 273.7 0.0036436 273.7 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.57608 -94.239u 94.239u 94.239u 0.57608 274.45 3.0436p 100.K 273.7 0.0036436 273.7
Gnucap System status
-iterations: op=9, dc=13, tran=0, fourier=0, total=85
+iterations: op=9, dc=13, tran=0, fourier=0, total=87
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.6.ckt.out b/tests/==out/d_diode.6.ckt.out
index 2fb93b4c..32030ce5 100644
--- a/tests/==out/d_diode.6.ckt.out
+++ b/tests/==out/d_diode.6.ckt.out
@@ -6,19 +6,19 @@ D1 ( 2 0 ) ddd NA( 1.) m=2.
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.57608 -94.239u 94.239u 47.12u 0.57608 548.91 1.5218p 100.K 273.7 0.0018218 273.7
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2) iter(0)
--10. -10. -10. 0. -10.02p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.02p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.02p -10.f -8. 553.9E144 333.33f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.02p -10.f -6. 144.8E111 377.96f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.02p -10.f -4. 37.85E+78 447.21f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.02p -10.f -2. 9.894E+45 577.35f 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 5.
2. 2. 0.52806 -14.719u 14.719u 7.3597u 0.52806 3.5143K 1.4539p 100.K 1.7268K 284.55u 1.7268K 10.
4. 4. 0.55009 -34.499u 34.499u 17.25u 0.55009 1.4994K 1.4851p 100.K 744.13 666.93u 744.13 5.
6. 6. 0.56186 -54.381u 54.381u 27.191u 0.56186 951.21 1.5017p 100.K 473.36 0.0010513 473.36 5.
8. 8. 0.56993 -74.301u 74.301u 37.15u 0.56993 696.2 1.5131p 100.K 346.89 0.0014364 346.89 5.
10. 10. 0.57608 -94.239u 94.239u 47.12u 0.57608 548.91 1.5218p 100.K 273.7 0.0018218 273.7 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.57608 -94.239u 94.239u 47.12u 0.57608 548.91 1.5218p 100.K 273.7 0.0018218 273.7
Gnucap System status
-iterations: op=9, dc=13, tran=0, fourier=0, total=85
+iterations: op=9, dc=13, tran=0, fourier=0, total=87
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.7.ckt.out b/tests/==out/d_diode.7.ckt.out
index 905fae61..8d27537d 100644
--- a/tests/==out/d_diode.7.ckt.out
+++ b/tests/==out/d_diode.7.ckt.out
@@ -6,19 +6,19 @@ D1 ( 2 0 ) ddd 2 m=2
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.5582 -94.418u 94.418u 47.209u 0.5582 547.87 2.9931p 100.K 273.18 0.0018253 273.18
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2) iter(0)
--10. -10. -10. 0. -10.04p -20.f -10. 1.06E180 603.02f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.04p -20.f -10. 1.06E180 603.02f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.04p -20.f -8. 277.E144 666.67f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.04p -20.f -6. 72.4E111 755.93f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.04p -20.f -4. 18.93E+78 894.43f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.04p -20.f -2. 4.947E+45 1.1547p 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 1.293E+12 2.p 100.K 100.K 773.27f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 1.293E+12 2.p 100.K 100.K 773.27f 100.K 5.
2. 2. 0.51044 -14.896u 14.896u 7.4478u 0.51044 3.4727K 2.858p 100.K 1.7067K 287.96u 1.7067K 10.
4. 4. 0.5323 -34.677u 34.677u 17.339u 0.5323 1.4917K 2.9198p 100.K 740.34 670.37u 740.34 5.
6. 6. 0.54402 -54.56u 54.56u 27.28u 0.54402 948.1 2.9529p 100.K 471.82 0.0010547 471.82 5.
8. 8. 0.55207 -74.479u 74.479u 37.24u 0.55207 694.53 2.9757p 100.K 346.06 0.0014398 346.06 5.
10. 10. 0.5582 -94.418u 94.418u 47.209u 0.5582 547.87 2.9931p 100.K 273.18 0.0018253 273.18 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.5582 -94.418u 94.418u 47.209u 0.5582 547.87 2.9931p 100.K 273.18 0.0018253 273.18
Gnucap System status
-iterations: op=9, dc=13, tran=0, fourier=0, total=85
+iterations: op=9, dc=13, tran=0, fourier=0, total=87
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.8.ckt.out b/tests/==out/d_diode.8.ckt.out
index a2fc2d8c..67ae4cec 100644
--- a/tests/==out/d_diode.8.ckt.out
+++ b/tests/==out/d_diode.8.ckt.out
@@ -6,19 +6,19 @@ D1 ( 2 0 ) ddd 4.
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.5582 -94.418u 94.418u 94.418u 0.5582 273.93 5.9861p 100.K 273.18 0.0036505 273.18
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2) iter(0)
--10. -10. -10. 0. -10.04p -40.f -10. 529.8E177 1.206p 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.04p -40.f -10. 529.8E177 1.206p 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.04p -40.f -8. 138.5E144 1.3333p 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.04p -40.f -6. 36.2E111 1.5119p 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.04p -40.f -4. 9.463E+78 1.7889p 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.04p -40.f -2. 2.474E+45 2.3094p 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 646.6G 4.p 100.K 100.K 1.5465p 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 646.6G 4.p 100.K 100.K 1.5465p 100.K 5.
2. 2. 0.51044 -14.896u 14.896u 14.896u 0.51044 1.7364K 5.7159p 100.K 1.7067K 575.92u 1.7067K 10.
4. 4. 0.5323 -34.677u 34.677u 34.677u 0.5323 745.86 5.8396p 100.K 740.34 0.0013407 740.34 5.
6. 6. 0.54402 -54.56u 54.56u 54.56u 0.54402 474.05 5.9059p 100.K 471.82 0.0021095 471.82 5.
8. 8. 0.55207 -74.479u 74.479u 74.479u 0.55207 347.27 5.9514p 100.K 346.06 0.0028796 346.06 5.
10. 10. 0.5582 -94.418u 94.418u 94.418u 0.5582 273.93 5.9861p 100.K 273.18 0.0036505 273.18 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.5582 -94.418u 94.418u 94.418u 0.5582 273.93 5.9861p 100.K 273.18 0.0036505 273.18
Gnucap System status
-iterations: op=9, dc=13, tran=0, fourier=0, total=85
+iterations: op=9, dc=13, tran=0, fourier=0, total=87
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_diode.9.ckt.out b/tests/==out/d_diode.9.ckt.out
index 9be4437d..03cac1c2 100644
--- a/tests/==out/d_diode.9.ckt.out
+++ b/tests/==out/d_diode.9.ckt.out
@@ -6,19 +6,19 @@ D1 ( 2 0 ) ddd NA( 1.) m=4.
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.5582 -94.418u 94.418u 23.604u 0.5582 1.0957K 1.4965p 100.K 273.18 912.63u 273.18
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2) iter(0)
--10. -10. -10. 0. -10.04p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 4.
+-10. -10. -10. 0. -10.04p -10.f -10. 2.119E180 301.51f 100.K 100.K 0. 100.K 5.
-8. -8. -8. 0. -8.04p -10.f -8. 553.9E144 333.33f 100.K 100.K 0. 100.K 4.
-6. -6. -6. 0. -6.04p -10.f -6. 144.8E111 377.96f 100.K 100.K 0. 100.K 4.
-4. -4. -4. 0. -4.04p -10.f -4. 37.85E+78 447.21f 100.K 100.K 0. 100.K 4.
-2. -2. -2. 0. -2.04p -10.f -2. 9.894E+45 577.35f 100.K 100.K 0. 100.K 4.
- 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 4.
+ 0. 0. 0. 0. 0. 0. 0. 2.586E+12 1.p 100.K 100.K 386.64f 100.K 5.
2. 2. 0.51044 -14.896u 14.896u 3.7239u 0.51044 6.9455K 1.429p 100.K 1.7067K 143.98u 1.7067K 10.
4. 4. 0.5323 -34.677u 34.677u 8.6693u 0.5323 2.9834K 1.4599p 100.K 740.34 335.18u 740.34 5.
6. 6. 0.54402 -54.56u 54.56u 13.64u 0.54402 1.8962K 1.4765p 100.K 471.82 527.37u 471.82 5.
8. 8. 0.55207 -74.479u 74.479u 18.62u 0.55207 1.3891K 1.4878p 100.K 346.06 719.91u 346.06 5.
10. 10. 0.5582 -94.418u 94.418u 23.604u 0.5582 1.0957K 1.4965p 100.K 273.18 912.63u 273.18 5.
Gnucap System status
-iterations: op=9, dc=54, tran=0, fourier=0, total=63
+iterations: op=9, dc=56, tran=0, fourier=0, total=65
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
@@ -29,7 +29,7 @@ dctran density=100.0%, ac density=100.0%
# v(1) v(2) i(V1) i(R1) id(D1) vd(D1) req(D1) cap(D1) z(D1) zraw(D1) y(D1) z(2)
27. 10. 0.5582 -94.418u 94.418u 23.604u 0.5582 1.0957K 1.4965p 100.K 273.18 912.63u 273.18
Gnucap System status
-iterations: op=9, dc=13, tran=0, fourier=0, total=85
+iterations: op=9, dc=13, tran=0, fourier=0, total=87
transient timesteps: accepted=0, rejected=0, total=0
nodes: user=2, subckt=0, model=0, total=2
dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_logic.1.ckt.out b/tests/==out/d_logic.1.ckt.out
index b8b37e84..d5eee920 100644
--- a/tests/==out/d_logic.1.ckt.out
+++ b/tests/==out/d_logic.1.ckt.out
@@ -2,7 +2,7 @@
# v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8) logic(1) logic(2) logic(3) logic(4) logic(5) logic(6) logic(7) logic(8)
27. 0. 5. 66.926n 5. 66.926n 5. 66.926n 5. 0.01 3.01 0.01 3.01 0.01 3.01 0.01 4.21
Gnucap System status
-iterations: op=13, dc=0, tran=0, fourier=0, total=13
+iterations: op=12, dc=0, tran=0, fourier=0, total=12
transient timesteps: accepted=0, rejected=0, total=0
-nodes: user=8, subckt=0, model=0, total=8
-dctran density=53.1%, ac density=53.1%
+nodes: user=8, subckt=6, model=0, total=14
+dctran density=56.1%, ac density=56.1%
diff --git a/tests/==out/d_logic.1.gc.out b/tests/==out/d_logic.1.gc.out
index 762c0c8d..c9622cdf 100644
--- a/tests/==out/d_logic.1.gc.out
+++ b/tests/==out/d_logic.1.gc.out
@@ -1,30 +1,7 @@
-paramset mos logic;
- ^ ? paramset: base has incorrect type
-.delay= 1n;
-^ ? .delay: no match
-.rise= 1n;
-^ ? .rise: no match
-.fall= 1n;
-^ ? .fall: no match
-.rs= 100.;
-^ ? .rs: no match
-.rw= 1.G ;
-^ ? .rw: no match
-.thh= 0.75;
-^ ? .thh: no match
-.thl= 0.25;
-^ ? .thl: no match
-.mr= 5.;
-^ ? .mr: no match
-.mf= 5.;
-^ ? .mf: no match
-.over=10k;
-^ ? .over: no match
-.vmax= 5.;
-^ ? .vmax: no match
-.vmin= 0.;
-^ ? .vmin: no match
-endparamset
-^ ? endparamset: no match
-// does not work yet. logic "model" is inaccessible from verilog
-// paramset must support COMPONENTS...
+# v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8) logic(1) logic(2) logic(3) logic(4) logic(5) logic(6) logic(7) logic(8)
+ 27. 0. 5. 66.926n 5. 66.926n 5. 66.926n 5. 0.01 3.01 0.01 3.01 0.01 3.01 0.01 4.21
+Gnucap System status
+iterations: op=12, dc=0, tran=0, fourier=0, total=12
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=8, subckt=6, model=0, total=14
+dctran density=56.1%, ac density=56.1%
diff --git a/tests/==out/d_logic.2.ckt.out b/tests/==out/d_logic.2.ckt.out
index b8b37e84..d5eee920 100644
--- a/tests/==out/d_logic.2.ckt.out
+++ b/tests/==out/d_logic.2.ckt.out
@@ -2,7 +2,7 @@
# v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8) logic(1) logic(2) logic(3) logic(4) logic(5) logic(6) logic(7) logic(8)
27. 0. 5. 66.926n 5. 66.926n 5. 66.926n 5. 0.01 3.01 0.01 3.01 0.01 3.01 0.01 4.21
Gnucap System status
-iterations: op=13, dc=0, tran=0, fourier=0, total=13
+iterations: op=12, dc=0, tran=0, fourier=0, total=12
transient timesteps: accepted=0, rejected=0, total=0
-nodes: user=8, subckt=0, model=0, total=8
-dctran density=53.1%, ac density=53.1%
+nodes: user=8, subckt=6, model=0, total=14
+dctran density=56.1%, ac density=56.1%
diff --git a/tests/==out/d_logic.2.gc.out b/tests/==out/d_logic.2.gc.out
new file mode 100644
index 00000000..9c81888f
--- /dev/null
+++ b/tests/==out/d_logic.2.gc.out
@@ -0,0 +1,60 @@
+# v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8) logic(1) logic(2) logic(3) logic(4) logic(5) logic(6) logic(7) logic(8)
+ 27. 0. 5. 66.926n 5. 66.926n 5. 66.926n 5. 0.01 3.01 0.01 3.01 0.01 3.01 0.01 4.21
+Gnucap System status
+iterations: op=12, dc=0, tran=0, fourier=0, total=12
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=8, subckt=6, model=0, total=14
+dctran density=56.1%, ac density=56.1%
+.model mos logic ( delay=1n vmax=5. vmin=0. unknown=NA( 2.5) rise=1n fall=1n rs=100. rw=1.G thh=0.75 thl=0.25 mr=5. mf=5. over=10k tnom=NA( 27.))
+Vdd ( 8 0 ) DC 5.
+V1 ( 1 0 ) generator scale= 1.
+U2 ( 2 1 ) mos inv
+U3 ( 3 2 ) mos inv
+U4 ( 4 3 ) mos inv
+U5 ( 5 4 ) mos inv
+U6 ( 6 5 ) mos inv
+U7 ( 7 6 ) mos inv
+.subckt mosinv1 ( 2 3 )
+Vdd ( 1 0 ) DC 5.
+M1 ( 2 3 0 0 ) nmos l=100.u w=100.u nrd=1. nrs=1.
+M2 ( 2 3 1 1 ) pmos l=100.u w=100.u nrd=1. nrs=1.
+.ends mosinv1
+.model nmos nmos2 ( level=2 nfs=0. neff=1. delta=0. vto=0. gamma=0. phi=0.6 tox=100.n uo=600. tpg=1 tnom=NA( 27.) fc=0.5 pb=0.8 cj=0. mj=0.5 cjsw=0. mjsw=0.33 is=10.E-15 rsh=0. cgso=0. cgdo=0. cgbo=0. ld=0.)
+.model pmos pmos2 ( level=2 nfs=0. neff=1. delta=0. vto=0. gamma=0. phi=0.6 tox=100.n uo=600. tpg=1 tnom=NA( 27.) fc=0.5 pb=0.8 cj=0. mj=0.5 cjsw=0. mjsw=0.33 is=10.E-15 rsh=0. cgso=0. cgdo=0. cgbo=0. ld=0.)
+*'.option trace
+*'.print tran v(nodes) l(nodes)
+*'.tran 0 10 .05
+paramset mos logic;
+ .delay=1n; .vmax=5.; .vmin=0.; .unknown=NA( 2.5); .rise=1n; .fall=1n; .rs=100.; .rw=1.G; .thh=0.75; .thl=0.25; .mr=5.; .mf=5.; .over=10k; .tnom=NA( 27.);
+endparamset
+
+vsource #( DC 5.) Vdd (.p(8),.n(0));
+vsource #(generator.scale( 1.)) V1 (.p(1),.n(0));
+inv #(.model(mos)) U2 (.out(2),.in1(1));
+inv #(.model(mos)) U3 (.out(3),.in1(2));
+inv #(.model(mos)) U4 (.out(4),.in1(3));
+inv #(.model(mos)) U5 (.out(5),.in1(4));
+inv #(.model(mos)) U6 (.out(6),.in1(5));
+inv #(.model(mos)) U7 (.out(7),.in1(6));
+module mosinv1 (2,3);
+vsource #( DC 5.) Vdd (.p(1),.n(0));
+nmos #(.l(100.u),.w(100.u),.nrd(1.),.nrs(1.)) M1 (.d(2),.g(3),.s(0),.b(0));
+pmos #(.l(100.u),.w(100.u),.nrd(1.),.nrs(1.)) M2 (.d(2),.g(3),.s(1),.b(1));
+endmodule // mosinv1
+
+//*+ends mosinv1
+paramset nmos nmos2;
+ .level=2; .nfs=0.; .neff=1.; .delta=0.; .vto=0.; .gamma=0.; .phi=0.6; .tox=100.n; .uo=600.; .tpg=1; .tnom=NA( 27.); .fc=0.5; .pb=0.8; .cj=0.; .mj=0.5; .cjsw=0.; .mjsw=0.33; .is=10.E-15; .rsh=0.; .cgso=0.; .cgdo=0.; .cgbo=0.; .ld=0.;
+endparamset
+
+//*+(* vfb=-0.6 * kp= 20.71886u )
+paramset pmos pmos2;
+ .level=2; .nfs=0.; .neff=1.; .delta=0.; .vto=0.; .gamma=0.; .phi=0.6; .tox=100.n; .uo=600.; .tpg=1; .tnom=NA( 27.); .fc=0.5; .pb=0.8; .cj=0.; .mj=0.5; .cjsw=0.; .mjsw=0.33; .is=10.E-15; .rsh=0.; .cgso=0.; .cgdo=0.; .cgbo=0.; .ld=0.;
+endparamset
+
+//*+(* vfb=-0.6 * kp= 20.71886u )
+//'.option trace
+//'.print tran v(nodes) l(nodes)
+//'.tran 0 10 .05
+.end
+^ ? .end: no match
diff --git a/tests/==out/d_logic.3.ckt.out b/tests/==out/d_logic.3.ckt.out
index 5660a87d..ebb0cbb9 100644
--- a/tests/==out/d_logic.3.ckt.out
+++ b/tests/==out/d_logic.3.ckt.out
@@ -4,5 +4,5 @@
Gnucap System status
iterations: op=3, dc=0, tran=0, fourier=0, total=3
transient timesteps: accepted=0, rejected=0, total=0
-nodes: user=8, subckt=0, model=0, total=8
-dctran density=53.1%, ac density=53.1%
+nodes: user=8, subckt=6, model=0, total=14
+dctran density=56.1%, ac density=56.1%
diff --git a/tests/==out/d_logic.7.ckt.out b/tests/==out/d_logic.7.ckt.out
index 0b0fcf39..de4f5d35 100644
--- a/tests/==out/d_logic.7.ckt.out
+++ b/tests/==out/d_logic.7.ckt.out
@@ -9,12 +9,12 @@ U2: can't find subckt: mosinv1, forcing digital
27. 0. 5. 0. 5. 0. 5. 0. 5. 0.01 3. 0. 3. 0. 3. 0. 4.21
Vdd ( 8 0 ) DC 5.
V1 ( 1 0 ) generator scale= 1.
-U7 ( 7 0 8 8 6 ) mos inv
-U6 ( 6 0 8 8 5 ) mos inv
-U5 ( 5 0 8 8 4 ) mos inv
-U4 ( 4 0 8 8 3 ) mos inv
-U3 ( 3 0 8 8 2 ) mos inv
-U2 ( 2 0 8 8 1 ) mos inv
+U7 ( 7 6 ) mos inv
+U6 ( 6 5 ) mos inv
+U5 ( 5 4 ) mos inv
+U4 ( 4 3 ) mos inv
+U3 ( 3 2 ) mos inv
+U2 ( 2 1 ) mos inv
.model mos logic ( delay=1n vmax=5. vmin=0. unknown=NA( 2.5) rise=1n fall=1n rs=100. rw=1.G thh=0.75 thl=0.25 mr=5. mf=5. over=10k tnom=NA( 27.))
*'.option trace
*'.print tran v(nodes) l(nodes)
diff --git a/tests/==out/d_logic.evt.0.gc.out b/tests/==out/d_logic.evt.0.gc.out
index 53a3a410..b9d0ca7f 100644
--- a/tests/==out/d_logic.evt.0.gc.out
+++ b/tests/==out/d_logic.evt.0.gc.out
@@ -4,7 +4,7 @@
>>>>>.list
.model mos logic ( delay=NA( 1.n) vmax=NA( 5.) vmin=NA( 0.) unknown=NA( 2.5) rise=NA( 500.p) fall=NA( 500.p) rs=NA( 100.) rw=NA( 1.G) thh=NA( 0.75) thl=NA( 0.25) mr=NA( 5.) mf=NA( 5.) over=NA( 0.1) tnom=NA( 27.))
.model cross sw ( vt=2.5 vh=1.25 von=NA( 3.75) voff=NA( 1.25) ron=NA( 1.) roff=NA( 1.E+12) tnom=NA( 27.))
-U1 ( 2 0 0 0 1 ) mos inv
+U1 ( 2 1 ) mos inv
V1 ( 1 0 ) pulse iv= 0. pv= 5. delay= 0. rise= 500.p fall=NA( 0.) width=NA( Inf) period=NA( Inf)
S1 ( 0 0 1 0 ) cross
C1 ( 3 0 ) 100.f
diff --git a/tests/==out/d_logic.evt.1.gc.out b/tests/==out/d_logic.evt.1.gc.out
index a5c50401..eac1e2d9 100644
--- a/tests/==out/d_logic.evt.1.gc.out
+++ b/tests/==out/d_logic.evt.1.gc.out
@@ -5,8 +5,8 @@
>>>>>.list
.model mos logic ( delay=NA( 1.n) vmax=NA( 5.) vmin=NA( 0.) unknown=NA( 2.5) rise=NA( 500.p) fall=NA( 500.p) rs=NA( 100.) rw=NA( 1.G) thh=NA( 0.75) thl=NA( 0.25) mr=NA( 5.) mf=NA( 5.) over=NA( 0.1) tnom=NA( 27.))
.model cross sw ( vt=2.5 vh=1.25 von=NA( 3.75) voff=NA( 1.25) ron=NA( 1.) roff=NA( 1.E+12) tnom=NA( 27.))
-U1 ( 3 0 0 0 1 2 ) mos nor
-* U1 3 0 0 0 1 mos inv
+U1 ( 3 1 2 ) mos nor
+* U1 3 1 mos inv
V1 ( 1 0 ) pulse iv= 0. pv= 5. delay= 0. rise= 500.p fall=NA( 0.) width=NA( Inf) period=NA( Inf)
V2 ( 2 0 ) pulse iv= 0. pv= 5. delay= 300.p rise= 500.p fall=NA( 0.) width=NA( Inf) period=NA( Inf)
S1 ( 0 0 1 0 ) cross
diff --git a/tests/==out/d_logic_nand-dc.ckt.out b/tests/==out/d_logic_nand-dc.ckt.out
index 62bf3620..6a1de0ad 100644
--- a/tests/==out/d_logic_nand-dc.ckt.out
+++ b/tests/==out/d_logic_nand-dc.ckt.out
@@ -8,3 +8,8 @@ U1: can't find subckt: CMOSnor2, forcing digital
6. 6. 10. 0. 0. 0. 0.
8. 8. 10. 0. 0. 0. 0.
10. 10. 10. 0. 0. 0. 0.
+Gnucap System status
+iterations: op=0, dc=20, tran=0, fourier=0, total=20
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=5, subckt=0, model=0, total=5
+dctran density=20.0%, ac density=20.0%
diff --git a/tests/==out/d_logic_tr_ab1.ckt.out b/tests/==out/d_logic_tr_ab1.ckt.out
index d815534f..17c71815 100644
--- a/tests/==out/d_logic_tr_ab1.ckt.out
+++ b/tests/==out/d_logic_tr_ab1.ckt.out
@@ -215,5 +215,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1348, fourier=0, total=1567
transient timesteps: accepted=210, rejected=0, total=210
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_ab2.ckt.out b/tests/==out/d_logic_tr_ab2.ckt.out
index ec946395..c63d7d11 100644
--- a/tests/==out/d_logic_tr_ab2.ckt.out
+++ b/tests/==out/d_logic_tr_ab2.ckt.out
@@ -2,7 +2,7 @@
# v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
27. 0. 0.01 5. 3.01 66.926n 0.01 9. 0.
#Time v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
- 0. 2.5 1.41 2.4995 1.41 2.57 1.41 17. 1.
+ 0. 2.5 1.41 2.4995 1.41 2.5698 1.41 17. 1.
500.n 2.5079 1.41 2.4622 2.41 3.0399 1.41 9. 9.
1.u 2.5157 1.41 2.3909 2.41 3.3973 1.41 6. 6.
5.4545u 2.5857 1.41 1.7291 2.41 4.4962 3.31 8. 6.
@@ -215,5 +215,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1412, fourier=0, total=1631
transient timesteps: accepted=210, rejected=0, total=210
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_an1.ckt.out b/tests/==out/d_logic_tr_an1.ckt.out
index 610347a4..d45d780b 100644
--- a/tests/==out/d_logic_tr_an1.ckt.out
+++ b/tests/==out/d_logic_tr_an1.ckt.out
@@ -215,5 +215,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1348, fourier=0, total=1567
transient timesteps: accepted=210, rejected=0, total=210
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_an2.ckt.out b/tests/==out/d_logic_tr_an2.ckt.out
index de5efd1c..bda6a094 100644
--- a/tests/==out/d_logic_tr_an2.ckt.out
+++ b/tests/==out/d_logic_tr_an2.ckt.out
@@ -2,7 +2,7 @@
# v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
27. 0. 0.01 5. 3.01 66.926n 0.01 9. 0.
#Time v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
- 0. 2.5 1.41 2.4995 1.41 2.57 1.41 17. 1.
+ 0. 2.5 1.41 2.4995 1.41 2.5698 1.41 17. 1.
500.n 2.5079 1.41 2.4626 2.41 3.0373 1.41 9. 9.
1.u 2.5157 1.41 2.3913 2.41 3.3959 1.41 6. 6.
5.4545u 2.5857 1.41 1.7292 2.41 4.4961 3.31 8. 6.
@@ -215,5 +215,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1412, fourier=0, total=1631
transient timesteps: accepted=210, rejected=0, total=210
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_db1.ckt.out b/tests/==out/d_logic_tr_db1.ckt.out
index 2c04a4d0..8efa8aa4 100644
--- a/tests/==out/d_logic_tr_db1.ckt.out
+++ b/tests/==out/d_logic_tr_db1.ckt.out
@@ -229,5 +229,5 @@
Gnucap System status
iterations: op=3, dc=0, tran=672, fourier=0, total=899
transient timesteps: accepted=224, rejected=0, total=224
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_db2.ckt.out b/tests/==out/d_logic_tr_db2.ckt.out
index fad89dca..e29054fd 100644
--- a/tests/==out/d_logic_tr_db2.ckt.out
+++ b/tests/==out/d_logic_tr_db2.ckt.out
@@ -249,5 +249,5 @@
Gnucap System status
iterations: op=3, dc=0, tran=732, fourier=0, total=979
transient timesteps: accepted=244, rejected=0, total=244
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_dn1.ckt.out b/tests/==out/d_logic_tr_dn1.ckt.out
index 2c04a4d0..8efa8aa4 100644
--- a/tests/==out/d_logic_tr_dn1.ckt.out
+++ b/tests/==out/d_logic_tr_dn1.ckt.out
@@ -229,5 +229,5 @@
Gnucap System status
iterations: op=3, dc=0, tran=672, fourier=0, total=899
transient timesteps: accepted=224, rejected=0, total=224
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_dn2.ckt.out b/tests/==out/d_logic_tr_dn2.ckt.out
index fad89dca..e29054fd 100644
--- a/tests/==out/d_logic_tr_dn2.ckt.out
+++ b/tests/==out/d_logic_tr_dn2.ckt.out
@@ -249,5 +249,5 @@
Gnucap System status
iterations: op=3, dc=0, tran=732, fourier=0, total=979
transient timesteps: accepted=244, rejected=0, total=244
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_mb1a.ckt.out b/tests/==out/d_logic_tr_mb1a.ckt.out
index 8e427793..eed0276c 100644
--- a/tests/==out/d_logic_tr_mb1a.ckt.out
+++ b/tests/==out/d_logic_tr_mb1a.ckt.out
@@ -231,5 +231,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=822, fourier=0, total=1057
transient timesteps: accepted=226, rejected=0, total=226
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_mb1b.ckt.out b/tests/==out/d_logic_tr_mb1b.ckt.out
index d815534f..17c71815 100644
--- a/tests/==out/d_logic_tr_mb1b.ckt.out
+++ b/tests/==out/d_logic_tr_mb1b.ckt.out
@@ -215,5 +215,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1348, fourier=0, total=1567
transient timesteps: accepted=210, rejected=0, total=210
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_mb2a.ckt.out b/tests/==out/d_logic_tr_mb2a.ckt.out
index 9d9c8093..b5c00705 100644
--- a/tests/==out/d_logic_tr_mb2a.ckt.out
+++ b/tests/==out/d_logic_tr_mb2a.ckt.out
@@ -2,7 +2,7 @@
# v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
27. 0. 0.01 5. 3.01 66.926n 0.01 9. 0.
#Time v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
- 0. 2.5 1.41 2.4995 1.41 2.57 1.41 17. 1.
+ 0. 2.5 1.41 2.4995 1.41 2.5698 1.41 17. 1.
500.n 2.5079 1.41 2.4622 2.41 3.0399 3.31 9. 9.
1.u 2.5157 1.41 2.3909 2.41 3.3973 3.31 6. 6.
5.4545u 2.5857 1.41 1.7291 0.31 4.4962 3.31 8. 6.
@@ -247,5 +247,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=884, fourier=0, total=1135
transient timesteps: accepted=242, rejected=0, total=242
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_mb2b.ckt.out b/tests/==out/d_logic_tr_mb2b.ckt.out
index f08a5aa4..ece55642 100644
--- a/tests/==out/d_logic_tr_mb2b.ckt.out
+++ b/tests/==out/d_logic_tr_mb2b.ckt.out
@@ -2,7 +2,7 @@
# v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
27. 0. 0.01 5. 3.01 66.926n 0.01 9. 0.
#Time v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
- 0. 2.5 1.41 2.4995 1.41 2.57 1.41 17. 1.
+ 0. 2.5 1.41 2.4995 1.41 2.5698 1.41 17. 1.
500.n 2.5079 1.41 2.4622 2.41 3.0399 1.41 9. 9.
1.u 2.5157 1.41 2.3909 2.41 3.3973 1.41 6. 6.
5.4545u 2.5857 1.41 1.7291 2.41 4.4962 3.31 8. 6.
@@ -247,5 +247,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1490, fourier=0, total=1741
transient timesteps: accepted=242, rejected=0, total=242
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_mn1a.ckt.out b/tests/==out/d_logic_tr_mn1a.ckt.out
index 8e427793..eed0276c 100644
--- a/tests/==out/d_logic_tr_mn1a.ckt.out
+++ b/tests/==out/d_logic_tr_mn1a.ckt.out
@@ -231,5 +231,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=822, fourier=0, total=1057
transient timesteps: accepted=226, rejected=0, total=226
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_mn1b.ckt.out b/tests/==out/d_logic_tr_mn1b.ckt.out
index 610347a4..d45d780b 100644
--- a/tests/==out/d_logic_tr_mn1b.ckt.out
+++ b/tests/==out/d_logic_tr_mn1b.ckt.out
@@ -215,5 +215,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1348, fourier=0, total=1567
transient timesteps: accepted=210, rejected=0, total=210
-nodes: user=3, subckt=0, model=0, total=3
-dctran density=100.0%, ac density=100.0%
+nodes: user=3, subckt=1, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_logic_tr_mn2a.ckt.out b/tests/==out/d_logic_tr_mn2a.ckt.out
index 2ff39ed6..5420201e 100644
--- a/tests/==out/d_logic_tr_mn2a.ckt.out
+++ b/tests/==out/d_logic_tr_mn2a.ckt.out
@@ -2,7 +2,7 @@
# v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
27. 0. 0.01 5. 3.01 66.926n 0.01 9. 0.
#Time v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
- 0. 2.5 1.41 2.4995 1.41 2.57 1.41 17. 1.
+ 0. 2.5 1.41 2.4995 1.41 2.5698 1.41 17. 1.
500.n 2.5079 1.41 2.4626 2.41 3.0373 3.31 9. 9.
1.u 2.5157 1.41 2.3913 2.41 3.3959 3.31 6. 6.
5.4545u 2.5857 1.41 1.7292 0.31 4.4961 3.31 8. 6.
@@ -247,5 +247,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=884, fourier=0, total=1135
transient timesteps: accepted=242, rejected=0, total=242
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_logic_tr_mn2b.ckt.out b/tests/==out/d_logic_tr_mn2b.ckt.out
index 9d1b1d89..7a599ae2 100644
--- a/tests/==out/d_logic_tr_mn2b.ckt.out
+++ b/tests/==out/d_logic_tr_mn2b.ckt.out
@@ -2,7 +2,7 @@
# v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
27. 0. 0.01 5. 3.01 66.926n 0.01 9. 0.
#Time v(1) l(1) v(2) l(2) v(3) l(3) iter(0) control(0)
- 0. 2.5 1.41 2.4995 1.41 2.57 1.41 17. 1.
+ 0. 2.5 1.41 2.4995 1.41 2.5698 1.41 17. 1.
500.n 2.5079 1.41 2.4626 2.41 3.0373 1.41 9. 9.
1.u 2.5157 1.41 2.3913 2.41 3.3959 1.41 6. 6.
5.4545u 2.5857 1.41 1.7292 2.41 4.4961 3.31 8. 6.
@@ -247,5 +247,5 @@
Gnucap System status
iterations: op=9, dc=0, tran=1490, fourier=0, total=1741
transient timesteps: accepted=242, rejected=0, total=242
-nodes: user=4, subckt=0, model=0, total=4
-dctran density=87.5%, ac density=87.5%
+nodes: user=4, subckt=2, model=0, total=6
+dctran density=61.1%, ac density=61.1%
diff --git a/tests/==out/d_res.1a.gc.out b/tests/==out/d_res.1a.gc.out
new file mode 100644
index 00000000..5655d6b8
--- /dev/null
+++ b/tests/==out/d_res.1a.gc.out
@@ -0,0 +1,36 @@
+# v(1) v(2) v(3)
+r1: short circuit
+ 0. 0. 0. 0.
+r2: short circuit
+-1. 0.0097087 0.019417 0.99029
+r2: short circuit
+-2. 0.009803 0.0098973 0.9902
+r2: short circuit
+-3. 0.0098039 0.0098048 0.9902
+r2: short circuit
+-4. 0.0098039 0.0098039 0.9902
+r2: short circuit
+ 0. 0.0098039 0.0098039 0.9902
+# v(1) v(2) v(3) y(r1) y(r2) y(r0)
+r1: short circuit
+ 0. 0. 0. 0. 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-1. 0.0097087 0.019417 0.99029 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-2. 0.009803 0.0098973 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-3. 0.0098039 0.0098048 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-4. 0.0098039 0.0098039 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+ 0. 0.0098039 0.0098039 0.9902 100.K 100.K 1.K
+Gnucap System status
+iterations: op=0, dc=5, tran=0, fourier=0, total=10
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=3, subckt=0, model=0, total=3
+dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/d_res.1b.gc.out b/tests/==out/d_res.1b.gc.out
new file mode 100644
index 00000000..6cb8d50d
--- /dev/null
+++ b/tests/==out/d_res.1b.gc.out
@@ -0,0 +1,39 @@
+# v(1) v(2) v(3)
+ 0. 0. 0. 0.
+r1: short circuit
+r2: short circuit
+-1. 0.0097087 0.019417 0.99029
+r1: short circuit
+r2: short circuit
+-2. 0.009803 0.0098973 0.9902
+r1: short circuit
+r2: short circuit
+-3. 0.0098039 0.0098048 0.9902
+r1: short circuit
+r2: short circuit
+-4. 0.0098039 0.0098039 0.9902
+r1: short circuit
+r2: short circuit
+ 0. 0.0098039 0.0098039 0.9902
+# v(1) v(2) v(3) y(r1) y(r2) y(r0)
+ 0. 0. 0. 0. 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-1. 0.0097087 0.019417 0.99029 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-2. 0.009803 0.0098973 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-3. 0.0098039 0.0098048 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-4. 0.0098039 0.0098039 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+ 0. 0.0098039 0.0098039 0.9902 100.K 100.K 1.K
+Gnucap System status
+iterations: op=0, dc=5, tran=0, fourier=0, total=10
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=3, subckt=0, model=0, total=3
+dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/d_res.1c.gc.out b/tests/==out/d_res.1c.gc.out
new file mode 100644
index 00000000..542104f2
--- /dev/null
+++ b/tests/==out/d_res.1c.gc.out
@@ -0,0 +1,31 @@
+# v(1) v(2) v(3)
+r1: short circuit
+r2: short circuit
+ 0. 0. 0. 0.
+-1. 0.0097087 0.019417 0.99029
+-2. 0.0097087 0.019417 0.99029
+ 0. 0.0097087 0.019417 0.99029
+# v(1) v(2) v(3) y(r1) y(r2) y(r0)
+r1: short circuit
+r2: short circuit
+ 0. 0. 0. 0. 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-1. 0.0097087 0.019417 0.99029 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-2. 0.009803 0.0098973 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-3. 0.0098039 0.0098048 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+-4. 0.0098039 0.0098039 0.9902 100.K 100.K 1.K
+r1: short circuit
+r2: short circuit
+ 0. 0.0098039 0.0098039 0.9902 100.K 100.K 1.K
+Gnucap System status
+iterations: op=0, dc=5, tran=0, fourier=0, total=8
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=3, subckt=0, model=0, total=3
+dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/d_res.bug.0.gc.out b/tests/==out/d_res.bug.0.gc.out
new file mode 100644
index 00000000..fe60968f
--- /dev/null
+++ b/tests/==out/d_res.bug.0.gc.out
@@ -0,0 +1,24 @@
+r1 ( 1 0 ) r
+r2 ( 1 2 ) 1-r
+v1 ( 2 0 ) v
+# v(1) v(2) y(r1) y(r2)
+r2: short circuit
+r2: short circuit
+r2: short circuit
+r2: short circuit
+ 100.E-21 0.99998 0.99998 2. 100.K
+ 0.1 0.83332 0.99998 2. 10.
+ 0.2 0.71428 0.99999 2. 5.
+ 0.3 0.62499 0.99999 2. 3.3333
+ 0.4 0.55555 0.99999 2. 2.5
+ 0.5 0.5 0.99999 2. 2.
+ 0.6 0.45454 0.99999 2. 1.6667
+ 0.7 0.41666 0.99999 2. 1.4286
+ 0.8 0.38461 0.99999 2. 1.25
+ 0.9 0.35714 0.99999 2. 1.1111
+ 1. 0.33333 0.99999 2. 1.
+Gnucap System status
+iterations: op=0, dc=44, tran=0, fourier=0, total=44
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.bug.2.ckt.out b/tests/==out/d_res.bug.2.ckt.out
new file mode 100644
index 00000000..f7ed8f7a
--- /dev/null
+++ b/tests/==out/d_res.bug.2.ckt.out
@@ -0,0 +1,29 @@
+nonlinear res test
+# i(R1) vin(R1) i(V1) iter(0) f(R1) df(R1) in(R1) iof(R1)
+ 0. 0.099999 -999.99E-9 -0.099999 4. -999.99E-9 1.1111 0.099999 0.1
+ 1. 0.99999 0.99999 -0.99999 4. 0.99999 1.1111 0.99999 0.1
+ 2. 9.9991 1.9999 -9.9991 5. 1.9999 0.11111 9.9991 -8.
+ 3. 99.91 2.999 -99.91 5. 2.999 0.011111 99.91 -170.
+ 4. 991.08 3.9901 -991.08 5. 3.9901 0.0011111 991.08 -2.6E+3
+ 5. 9.1743E+3 4.9083 -9.1743E+3 5. 4.9083 111.11E-6 9.1743E+3 -35.E+3
+ 6. 52.632E+3 5.4737 -52.632E+3 5. 5.4737 11.111E-6 52.632E+3 -440.E+3
+did not converge
+ 7. 100.E+3 6. -100.E+3 124. 6. 11.111E-6 100.E+3 -440.E+3
+ 8. 190.01E+3 6.1006 -189.94E+3 10. 6.0999 10.E-6 189.94E+3 -420.05E+3
+ 9. 280.01E+3 6.2006 -279.94E+3 10. 6.1999 10.E-6 279.94E+3 -340.05E+3
+ 10. 370.01E+3 6.3006 -369.94E+3 10. 6.2999 10.E-6 369.94E+3 -260.05E+3
+ 9. 279.99E+3 6.1994 -280.06E+3 10. 6.2001 10.E-6 280.06E+3 -339.95E+3
+ 8. 189.99E+3 6.0994 -190.06E+3 10. 6.1001 10.E-6 190.06E+3 -419.95E+3
+ 7. 99.997E+3 5.9997 -100.03E+3 11. 6. 10.E-6 100.03E+3 -499.98E+3
+ 6. 52.632E+3 5.4737 -52.632E+3 4. 5.4737 11.111E-6 52.632E+3 -440.E+3
+ 5. 9.1743E+3 4.9083 -9.1743E+3 5. 4.9083 111.11E-6 9.1743E+3 -35.E+3
+ 4. 991.08 3.9901 -991.08 5. 3.9901 0.0011111 991.08 -2.6E+3
+ 3. 99.91 2.999 -99.91 5. 2.999 0.011111 99.91 -170.
+ 2. 9.9991 1.9999 -9.9991 4. 1.9999 0.11111 9.9991 -8.
+ 1. 0.99999 0.99999 -0.99999 4. 0.99999 1.1111 0.99999 0.1
+ 0. 0.099999 -999.99E-9 -0.099999 4. -999.99E-9 1.1111 0.099999 0.1
+Gnucap System status
+iterations: op=0, dc=249, tran=0, fourier=0, total=249
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.bug.2fit.ckt.out b/tests/==out/d_res.bug.2fit.ckt.out
new file mode 100644
index 00000000..b130c58d
--- /dev/null
+++ b/tests/==out/d_res.bug.2fit.ckt.out
@@ -0,0 +1,28 @@
+nonlinear res test
+# i(R1) vin(R1) i(V1) iter(0) f(R1) df(R1) in(R1) iof(R1)
+ 0. 0.1 -1.u -0.1 4. -1.u 2.0202 0.1 0.1
+ 1. 0.99995 0.99999 -0.99995 9. 0.99999 0.20212 0.99995 -3.9476
+ 2. 9.9951 1.9999 -9.9951 9. 1.9999 0.020302 9.9951 -88.514
+ 3. 99.519 2.999 -99.519 9. 2.999 0.0021174 99.519 -1.3169K
+ 4. 960.33 3.9904 -960.33 8. 3.9904 282.16u 960.33 -13.182K
+ 5. 8.0114K 4.9199 -8.0114K 7. 4.9199 60.374u 8.0114K -73.478K
+ 6. 43.569K 5.5643 -43.569K 6. 5.5643 13.42u 43.569K -371.05K
+ 7. 100.K 6.0002 -99.983K 9. 6. 10.u 99.983K -500.01K
+ 8. 183.78K 6.1625 -183.75K 10. 6.1622 10.u 183.75K -432.47K
+ 9. 268.78K 6.3131 -268.69K 9. 6.3122 10.u 268.69K -362.52K
+ 10. 355.05K 6.4506 -354.94K 9. 6.4495 10.u 354.94K -290.01K
+ 9. 268.76K 6.3115 -268.85K 9. 6.3124 10.u 268.85K -362.39K
+ 8. 183.77K 6.162 -183.8K 10. 6.1623 10.u 183.8K -432.42K
+ 7. 99.996K 5.9998 -100.02K 10. 6. 10.u 100.02K -499.98K
+ 6. 43.569K 5.5643 -43.569K 6. 5.5643 13.42u 43.569K -371.05K
+ 5. 8.0114K 4.9199 -8.0114K 9. 4.9199 60.374u 8.0114K -73.478K
+ 4. 960.33 3.9904 -960.33 12. 3.9904 282.16u 960.33 -13.182K
+ 3. 99.519 2.999 -99.519 12. 2.999 0.0021174 99.519 -1.3169K
+ 2. 9.9951 1.9999 -9.9951 11. 1.9999 0.020302 9.9951 -88.514
+ 1. 0.99995 0.99999 -0.99995 10. 0.99999 0.20212 0.99995 -3.9476
+ 0. 0.1 -1.u -0.1 5. -1.u 2.0202 0.1 0.1
+Gnucap System status
+iterations: op=0, dc=183, tran=0, fourier=0, total=183
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.neg.0.ckt.out b/tests/==out/d_res.neg.0.ckt.out
new file mode 100644
index 00000000..24deaab0
--- /dev/null
+++ b/tests/==out/d_res.neg.0.ckt.out
@@ -0,0 +1,25 @@
+nonlinear res test
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+did not converge
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+did not converge
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+R1: short circuit
+Gnucap System status
+iterations: op=0, dc=10403, tran=0, fourier=0, total=10403
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.restore.0.gc.out b/tests/==out/d_res.restore.0.gc.out
new file mode 100644
index 00000000..b5edabd8
--- /dev/null
+++ b/tests/==out/d_res.restore.0.gc.out
@@ -0,0 +1,27 @@
+#Time v(1)
+ 0. 0.
+ 0.011 0.069059
+ 0.022 0.13779
+ 0.039967 0.24848
+ 0.1283 0.72161
+ 0.21664 0.97809
+ 0.34283 0.83464
+ 0.46903 0.19337
+ 0.59522 -0.56323
+ 0.72142 -0.9839
+ 0.84761 -0.81773
+ 0.97381 -0.16384
+ 1.1 0.58777
+#Time eiv(r1) eiv(r2) v(1)
+ 1.1 0.58777 0.58777 0.58777
+ 1.109 0.63256 0.63256 0.63256
+ 1.2575 0.99887 0.99887 0.99887
+ 1.4431 0.34979 0.34979 0.34979
+ 1.6288 -0.72356 -0.72356 -0.72356
+ 1.8144 -0.91929 -0.91929 -0.91929
+ 2. 0. 0. 0.
+Gnucap System status
+iterations: op=0, dc=0, tran=26, fourier=0, total=97
+transient timesteps: accepted=20, rejected=0, total=20
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.short.0.gc.out b/tests/==out/d_res.short.0.gc.out
new file mode 100644
index 00000000..22e8f418
--- /dev/null
+++ b/tests/==out/d_res.short.0.gc.out
@@ -0,0 +1,78 @@
+#Time
+r1: short circuit
+r3: short circuit
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+-3.
+r2: short circuit
+ 0.
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+ 0.009
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+ 0.018
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+ 0.9
+#Time y(r1) y(r2) y(r3)
+ 0. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-1. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-2. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+ 0.9 100.K 100.K 100.K
+ 0. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-1. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-2. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+ 0.901 100.K 100.K 100.K
+ 0. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-1. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-2. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+ 1. 100.K 100.K 100.K
+Gnucap System status
+iterations: op=0, dc=0, tran=9, fourier=0, total=29
+transient timesteps: accepted=7, rejected=0, total=7
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.short.1.gc.out b/tests/==out/d_res.short.1.gc.out
new file mode 100644
index 00000000..22e8f418
--- /dev/null
+++ b/tests/==out/d_res.short.1.gc.out
@@ -0,0 +1,78 @@
+#Time
+r1: short circuit
+r3: short circuit
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+-3.
+r2: short circuit
+ 0.
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+ 0.009
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+ 0.018
+ 0.
+r2: short circuit
+-1.
+r2: short circuit
+-2.
+r2: short circuit
+ 0.9
+#Time y(r1) y(r2) y(r3)
+ 0. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-1. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-2. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+ 0.9 100.K 100.K 100.K
+ 0. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-1. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-2. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+ 0.901 100.K 100.K 100.K
+ 0. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-1. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+-2. 100.K 100.K 100.K
+r1: short circuit
+r2: short circuit
+r3: short circuit
+ 1. 100.K 100.K 100.K
+Gnucap System status
+iterations: op=0, dc=0, tran=9, fourier=0, total=29
+transient timesteps: accepted=7, rejected=0, total=7
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_res.short.2.gc.out b/tests/==out/d_res.short.2.gc.out
new file mode 100644
index 00000000..c6142d9e
--- /dev/null
+++ b/tests/==out/d_res.short.2.gc.out
@@ -0,0 +1,36 @@
+# v(1) v(2)
+r2: short circuit
+r2: short circuit
+r2: short circuit
+r2: short circuit
+ 0. 9.9998u 0.99999
+ 0.5 0.5 0.99999
+ 1. 0.99998 0.99999
+# v(1) v(2)
+ 1. 0.99998 0.99999
+ 0.5 0.5 0.99999
+r2: short circuit
+r2: short circuit
+r2: short circuit
+ 0. 9.9998u 0.99999
+# v(1) v(2) y(r1) y(r2) iter(0)
+r2: short circuit
+r2: short circuit
+r2: short circuit
+r2: short circuit
+ 0. 9.9998u 0.99999 1. 100.K 4.
+ 0.5 0.5 0.99999 2. 2. 3.
+r1: short circuit
+r1: short circuit
+r1: short circuit
+ 1. 0.99999 0.99999 100.K 1. 3.
+ 0.5 0.5 0.99999 2. 2. 3.
+r2: short circuit
+r2: short circuit
+r2: short circuit
+ 0. 9.9998u 0.99999 1. 100.K 3.
+Gnucap System status
+iterations: op=0, dc=16, tran=0, fourier=0, total=36
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/d_subckt.delete.0.ckt.out b/tests/==out/d_subckt.delete.0.ckt.out
new file mode 100644
index 00000000..b67f91ac
--- /dev/null
+++ b/tests/==out/d_subckt.delete.0.ckt.out
@@ -0,0 +1,6 @@
+spice
+>>>>>.subckt a 1 2
+>>>>>.parameter v=0;
+>>>>>.parameter d=0;
+>>>>>.print op v(nodes)
+X2: X1 is not a subckt proto
diff --git a/tests/==out/d_switch.c1.ckt.out b/tests/==out/d_switch.c1.ckt.out
index 533a5b5f..67ea67f1 100644
--- a/tests/==out/d_switch.c1.ckt.out
+++ b/tests/==out/d_switch.c1.ckt.out
@@ -79,7 +79,7 @@ Rprobe ( 7 8 ) 1.K
Vprobe ( 8 0 ) DC 0.
.model sss csw ( it=0. ih=.002 ion=NA( 0.002) ioff=NA(-0.002) ron=1.K roff=1.E+12 tnom=NA( 27.))
Gnucap System status
-iterations: op=0, dc=66, tran=138, fourier=0, total=261
-transient timesteps: accepted=46, rejected=9, total=55
+iterations: op=0, dc=84, tran=195, fourier=0, total=348
+transient timesteps: accepted=58, rejected=9, total=67
nodes: user=8, subckt=0, model=0, total=8
dctran density=25.0%, ac density=25.0%
diff --git a/tests/==out/d_switch.c1.inc.ckt.out b/tests/==out/d_switch.c1.inc.ckt.out
index 66d1a0b0..b91ede21 100644
--- a/tests/==out/d_switch.c1.inc.ckt.out
+++ b/tests/==out/d_switch.c1.inc.ckt.out
@@ -48,7 +48,11 @@ Vprobe ( 8 0 ) DC 0.
2. 1. 1. 1. 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 2. 2. Inf 0.002 0.002 -0.002 7.
2. 1. 1. 1. 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 2. 2. Inf 0.002 0.002 -0.002 7.
2. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.002 0.002 0.002 Inf Inf Inf 0.002 0.002 -0.002 7.
- 3. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.003 0.003 0.003 Inf Inf Inf 0.002 0.002 -0.002 1.
+ 2. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.002 0.002 0.002 Inf Inf Inf 0.002 0.002 -0.002 6.
+ 2.0002 0.5 0.5 1. 1.K 1.K 1.E+12 -0.0020002 0.0020002 0.0020002 Inf Inf Inf 0.002 0.002 -0.002 6.
+ 2.0019 0.5 0.5 1. 1.K 1.K 1.E+12 -0.0020019 0.0020019 0.0020019 Inf Inf Inf 0.0020002 0.0020002 -0.0020002 6.
+ 2.0453 0.5 0.5 1. 1.K 1.K 1.E+12 -0.0020453 0.0020453 0.0020453 Inf Inf Inf 0.0020019 0.0020019 -0.0020019 6.
+ 3. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.003 0.003 0.003 Inf Inf Inf 0.0020453 0.0020453 -0.0020453 1.
4. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.004 0.004 0.004 Inf Inf Inf 0.003 0.003 -0.003 1.
5. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.005 0.005 0.005 Inf Inf Inf 0.004 0.004 -0.004 1.
6. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.004 0.004 0.004 12. 12. 12. 0.005 0.005 -0.005 1.
@@ -64,7 +68,11 @@ Vprobe ( 8 0 ) DC 0.
12. 0.5 0.5 1. 1.K 1.K 1.E+12 0.002 -0.002 -0.002 12. 12. 12. -0.002 -0.002 0.002 7.
12. 0.5 0.5 0.5 1.K 1.K 1.K 0.002 -0.002 -0.002 12. 12. 12.275 -0.002 -0.002 0.002 7.
12. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 Inf Inf Inf -0.002 -0.002 0.002 7.
- 13. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 Inf Inf Inf -0.002 -0.002 0.002 1.
+ 12. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 Inf Inf Inf -0.002 -0.002 0.002 6.
+ 12. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.0020001 -0.0020001 -0.0020001 Inf Inf Inf -0.002 -0.002 0.002 6.
+ 12.001 1. 1. 0.5 1.E+12 1.E+12 1.K 0.0020014 -0.0020014 -0.0020014 Inf Inf Inf -0.0020001 -0.0020001 0.0020001 6.
+ 12.057 1. 1. 0.5 1.E+12 1.E+12 1.K 0.0020569 -0.0020569 -0.0020569 Inf Inf Inf -0.0020014 -0.0020014 0.0020014 6.
+ 13. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 Inf Inf Inf -0.0020569 -0.0020569 0.0020569 1.
14. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 Inf Inf Inf -0.003 -0.003 0.003 1.
15. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 Inf Inf Inf -0.004 -0.004 0.004 1.
16. 1. 1. 0.5 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 22. 22. 22. -0.005 -0.005 0.005 1.
@@ -80,7 +88,11 @@ Vprobe ( 8 0 ) DC 0.
22. 1. 1. 0.5 1.E+12 1.E+12 1.K -0.002 0.002 0.002 22. 22. 22. 0.002 0.002 -0.002 7.
22. 1. 1. 1. 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 22. 22. 22.275 0.002 0.002 -0.002 7.
22. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.002 0.002 0.002 Inf Inf Inf 0.002 0.002 -0.002 7.
- 23. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.003 0.003 0.003 Inf Inf Inf 0.002 0.002 -0.002 1.
+ 22. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.002 0.002 0.002 Inf Inf Inf 0.002 0.002 -0.002 6.
+ 22. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.0020001 0.0020001 0.0020001 Inf Inf Inf 0.002 0.002 -0.002 6.
+ 22.001 0.5 0.5 1. 1.K 1.K 1.E+12 -0.0020014 0.0020014 0.0020014 Inf Inf Inf 0.0020001 0.0020001 -0.0020001 6.
+ 22.057 0.5 0.5 1. 1.K 1.K 1.E+12 -0.0020569 0.0020569 0.0020569 Inf Inf Inf 0.0020014 0.0020014 -0.0020014 6.
+ 23. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.003 0.003 0.003 Inf Inf Inf 0.0020569 0.0020569 -0.0020569 1.
24. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.004 0.004 0.004 Inf Inf Inf 0.003 0.003 -0.003 1.
25. 0.5 0.5 1. 1.K 1.K 1.E+12 -0.005 0.005 0.005 Inf Inf Inf 0.004 0.004 -0.004 1.
#Freq v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8) ev(W1) ev(W2) ev(W3) i(Vsig) i(Rprobe) i(Vprobe)
@@ -99,7 +111,7 @@ Rprobe ( 7 8 ) 1.K
Vprobe ( 8 0 ) DC 0.
.model sss csw ( it=0. ih=.002 ion=NA( 0.002) ioff=NA(-0.002) ron=1.K roff=1.E+12 tnom=NA( 27.))
Gnucap System status
-iterations: op=0, dc=66, tran=138, fourier=0, total=261
-transient timesteps: accepted=46, rejected=9, total=55
+iterations: op=0, dc=84, tran=195, fourier=0, total=348
+transient timesteps: accepted=58, rejected=9, total=67
nodes: user=8, subckt=0, model=0, total=8
dctran density=25.0%, ac density=25.0%
diff --git a/tests/==out/d_switch.c1a.ckt.out b/tests/==out/d_switch.c1a.ckt.out
index cb0d7d61..512face6 100644
--- a/tests/==out/d_switch.c1a.ckt.out
+++ b/tests/==out/d_switch.c1a.ckt.out
@@ -14,26 +14,26 @@ Vprobe ( 8 0 ) DC 0.
.model sss csw ( it=0. ih=.002 ion=NA( 0.002) ioff=NA(-0.002) ron=1.K roff=1.E+12 tnom=NA( 27.))
# v(2) v(4) v(6) v(7) v(8) ev(W1) ev(W2) ev(W3) i(Vsig) i(Rprobe) i(Vprobe) iter(0)
-5. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 4.
--4. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 3.
--3. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 3.
--2. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 3.
--1. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 3.
- 0. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 3.
- 1. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 3.
- 2. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 3.
+-4. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 4.
+-3. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 4.
+-2. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 4.
+-1. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 4.
+ 0. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 4.
+ 1. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 4.
+ 2. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 4.
3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 4.
- 4. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
- 5. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 3.
- 4. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
- 3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
- 2. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 3.
- 1. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 3.
- 0. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 3.
--1. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 3.
--2. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 3.
+ 4. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 4.
+ 5. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 4.
+ 4. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 4.
+ 3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 4.
+ 2. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 4.
+ 1. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 4.
+ 0. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 4.
+-1. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 4.
+-2. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 4.
-3. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 4.
--4. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 3.
--5. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 3.
+-4. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 4.
+-5. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 4.
#Freq v(2) v(4) v(6) v(7) v(8) ev(W1) ev(W2) ev(W3) i(Vsig) i(Rprobe) i(Vprobe) iter(0)
1.K 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 0.
#Time v(2) v(4) v(6) v(7) v(8) ev(W1) ev(W2) ev(W3) i(Vsig) i(Rprobe) i(Vprobe) iter(0)
@@ -44,19 +44,23 @@ Vprobe ( 8 0 ) DC 0.
0. 1. 1. 1. 0. 0. 1.E+12 1.E+12 1.E+12 0. 0. 0. 0.
-1. 1. 1. 1. 0.01 100.p 1.E+12 1.E+12 1.E+12 -10.u 10.u 10.u 1.
-2. 1. 1. 1. 0.01 100.p 1.E+12 1.E+12 1.E+12 -10.u 10.u 10.u 2.
- 0.01 1. 1. 1. 0.01 100.p 1.E+12 1.E+12 1.E+12 -10.u 10.u 10.u 3.
+-3. 1. 1. 1. 0.01 100.p 1.E+12 1.E+12 1.E+12 -10.u 10.u 10.u 3.
+ 0.01 1. 1. 1. 0.01 100.p 1.E+12 1.E+12 1.E+12 -10.u 10.u 10.u 4.
0. 1. 1. 1. 0.01 100.p 1.E+12 1.E+12 1.E+12 -10.u 10.u 10.u 0.
-1. 1. 1. 1. 0.02 200.p 1.E+12 1.E+12 1.E+12 -20.u 20.u 20.u 1.
-2. 1. 1. 1. 0.02 200.p 1.E+12 1.E+12 1.E+12 -20.u 20.u 20.u 2.
- 0.02 1. 1. 1. 0.02 200.p 1.E+12 1.E+12 1.E+12 -20.u 20.u 20.u 3.
+-3. 1. 1. 1. 0.02 200.p 1.E+12 1.E+12 1.E+12 -20.u 20.u 20.u 3.
+ 0.02 1. 1. 1. 0.02 200.p 1.E+12 1.E+12 1.E+12 -20.u 20.u 20.u 4.
0. 1. 1. 1. 0.02 200.p 1.E+12 1.E+12 1.E+12 -20.u 20.u 20.u 0.
-1. 1. 1. 1. 1. 10.n 1.E+12 1.E+12 1.E+12 -0.001 0.001 0.001 1.
-2. 1. 1. 1. 1. 10.n 1.E+12 1.E+12 1.E+12 -0.001 0.001 0.001 2.
- 1. 1. 1. 1. 1. 10.n 1.E+12 1.E+12 1.E+12 -0.001 0.001 0.001 3.
+-3. 1. 1. 1. 1. 10.n 1.E+12 1.E+12 1.E+12 -0.001 0.001 0.001 3.
+ 1. 1. 1. 1. 1. 10.n 1.E+12 1.E+12 1.E+12 -0.001 0.001 0.001 4.
0. 1. 1. 1. 1. 10.n 1.E+12 1.E+12 1.E+12 -0.001 0.001 0.001 0.
-1. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 1.
-2. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 2.
- 2. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 3.
+-3. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 3.
+ 2. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 4.
0. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 0.
-1. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 1.
2. 1. 1. 1. 2. 20.n 1.E+12 1.E+12 1.E+12 -0.002 0.002 0.002 2.
@@ -85,45 +89,69 @@ Vprobe ( 8 0 ) DC 0.
-1. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 1.
2. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 2.
0. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 0.
+-1. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 1.
+ 2. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 2.
+ 0. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 0.
+-1. 0.5 0.5 1. 2.0002 20.002n 1.K 1.K 1.E+12 -0.0020002 0.0020002 0.0020002 1.
+ 2.0002 0.5 0.5 1. 2.0002 20.002n 1.K 1.K 1.E+12 -0.0020002 0.0020002 0.0020002 2.
+ 0. 0.5 0.5 1. 2.0002 20.002n 1.K 1.K 1.E+12 -0.0020002 0.0020002 0.0020002 0.
+-1. 0.5 0.5 1. 2.0019 20.019n 1.K 1.K 1.E+12 -0.0020019 0.0020019 0.0020019 1.
+ 2.0019 0.5 0.5 1. 2.0019 20.019n 1.K 1.K 1.E+12 -0.0020019 0.0020019 0.0020019 2.
+ 0. 0.5 0.5 1. 2.0019 20.019n 1.K 1.K 1.E+12 -0.0020019 0.0020019 0.0020019 0.
+-1. 0.5 0.5 1. 2.0453 20.453n 1.K 1.K 1.E+12 -0.0020453 0.0020453 0.0020453 1.
+-2. 0.5 0.5 1. 2.0453 20.453n 1.K 1.K 1.E+12 -0.0020453 0.0020453 0.0020453 2.
+-3. 0.5 0.5 1. 2.0453 20.453n 1.K 1.K 1.E+12 -0.0020453 0.0020453 0.0020453 3.
+ 2.0453 0.5 0.5 1. 2.0453 20.453n 1.K 1.K 1.E+12 -0.0020453 0.0020453 0.0020453 4.
+ 0. 0.5 0.5 1. 2.0453 20.453n 1.K 1.K 1.E+12 -0.0020453 0.0020453 0.0020453 0.
-1. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 1.
-2. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 2.
- 3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
+-3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
+ 3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 4.
0. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 0.
-1. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 1.
-2. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 2.
- 4. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
+-3. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
+ 4. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 4.
0. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 0.
-1. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 1.
-2. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 2.
- 5. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 3.
+-3. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 3.
+ 5. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 4.
0. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 0.
-1. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 1.
-2. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 2.
- 6. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
+-3. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
+ 6. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 4.
0. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 0.
-1. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 1.
-2. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 2.
- 7. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
+-3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
+ 7. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 4.
0. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 0.
-1. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 1.
-2. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 2.
- 8. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 3.
+-3. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 3.
+ 8. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 4.
0. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 0.
-1. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 1.
-2. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 2.
- 9. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 3.
+-3. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 3.
+ 9. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 4.
0. 0.5 0.5 1. 1. 10.n 1.K 1.K 1.E+12 -0.001 0.001 0.001 0.
-1. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 1.
-2. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 2.
- 10. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 3.
+-3. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 3.
+ 10. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 4.
0. 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 0.
-1. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 1.
-2. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 2.
- 11. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 3.
+-3. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 3.
+ 11. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 4.
0. 0.5 0.5 1. -1. -10.n 1.K 1.K 1.E+12 0.001 -0.001 -0.001 0.
-1. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 1.
-2. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 2.
- 12. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 3.
+-3. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 3.
+ 12. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 4.
0. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 0.
-1. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 1.
12. 0.5 0.5 1. -2. -20.n 1.K 1.K 1.E+12 0.002 -0.002 -0.002 2.
@@ -152,45 +180,69 @@ Vprobe ( 8 0 ) DC 0.
-1. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 1.
12. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 2.
0. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 0.
+-1. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 1.
+ 12. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 2.
+ 0. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 0.
+-1. 1. 1. 0.5 -2.0001 -20.001n 1.E+12 1.E+12 1.K 0.0020001 -0.0020001 -0.0020001 1.
+ 12. 1. 1. 0.5 -2.0001 -20.001n 1.E+12 1.E+12 1.K 0.0020001 -0.0020001 -0.0020001 2.
+ 0. 1. 1. 0.5 -2.0001 -20.001n 1.E+12 1.E+12 1.K 0.0020001 -0.0020001 -0.0020001 0.
+-1. 1. 1. 0.5 -2.0014 -20.014n 1.E+12 1.E+12 1.K 0.0020014 -0.0020014 -0.0020014 1.
+ 12.001 1. 1. 0.5 -2.0014 -20.014n 1.E+12 1.E+12 1.K 0.0020014 -0.0020014 -0.0020014 2.
+ 0. 1. 1. 0.5 -2.0014 -20.014n 1.E+12 1.E+12 1.K 0.0020014 -0.0020014 -0.0020014 0.
+-1. 1. 1. 0.5 -2.0569 -20.569n 1.E+12 1.E+12 1.K 0.0020569 -0.0020569 -0.0020569 1.
+-2. 1. 1. 0.5 -2.0569 -20.569n 1.E+12 1.E+12 1.K 0.0020569 -0.0020569 -0.0020569 2.
+-3. 1. 1. 0.5 -2.0569 -20.569n 1.E+12 1.E+12 1.K 0.0020569 -0.0020569 -0.0020569 3.
+ 12.057 1. 1. 0.5 -2.0569 -20.569n 1.E+12 1.E+12 1.K 0.0020569 -0.0020569 -0.0020569 4.
+ 0. 1. 1. 0.5 -2.0569 -20.569n 1.E+12 1.E+12 1.K 0.0020569 -0.0020569 -0.0020569 0.
-1. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 1.
-2. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 2.
- 13. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 3.
+-3. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 3.
+ 13. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 4.
0. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 0.
-1. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 1.
-2. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 2.
- 14. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 3.
+-3. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 3.
+ 14. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 4.
0. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 0.
-1. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 1.
-2. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 2.
- 15. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 3.
+-3. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 3.
+ 15. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 4.
0. 1. 1. 0.5 -5. -50.n 1.E+12 1.E+12 1.K 0.005 -0.005 -0.005 0.
-1. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 1.
-2. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 2.
- 16. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 3.
+-3. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 3.
+ 16. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 4.
0. 1. 1. 0.5 -4. -40.n 1.E+12 1.E+12 1.K 0.004 -0.004 -0.004 0.
-1. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 1.
-2. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 2.
- 17. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 3.
+-3. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 3.
+ 17. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 4.
0. 1. 1. 0.5 -3. -30.n 1.E+12 1.E+12 1.K 0.003 -0.003 -0.003 0.
-1. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 1.
-2. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 2.
- 18. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 3.
+-3. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 3.
+ 18. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 4.
0. 1. 1. 0.5 -2. -20.n 1.E+12 1.E+12 1.K 0.002 -0.002 -0.002 0.
-1. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 1.
-2. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 2.
- 19. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 3.
+-3. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 3.
+ 19. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 4.
0. 1. 1. 0.5 -1. -10.n 1.E+12 1.E+12 1.K 0.001 -0.001 -0.001 0.
-1. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 1.
-2. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 2.
- 20. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 3.
+-3. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 3.
+ 20. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 4.
0. 1. 1. 0.5 0. 0. 1.E+12 1.E+12 1.K 0. 0. 0. 0.
-1. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 1.
-2. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 2.
- 21. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 3.
+-3. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 3.
+ 21. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 4.
0. 1. 1. 0.5 1. 10.n 1.E+12 1.E+12 1.K -0.001 0.001 0.001 0.
-1. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 1.
-2. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 2.
- 22. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 3.
+-3. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 3.
+ 22. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 4.
0. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 0.
-1. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 1.
22. 1. 1. 0.5 2. 20.n 1.E+12 1.E+12 1.K -0.002 0.002 0.002 2.
@@ -219,17 +271,34 @@ Vprobe ( 8 0 ) DC 0.
-1. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 1.
22. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 2.
0. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 0.
+-1. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 1.
+ 22. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 2.
+ 0. 0.5 0.5 1. 2. 20.n 1.K 1.K 1.E+12 -0.002 0.002 0.002 0.
+-1. 0.5 0.5 1. 2.0001 20.001n 1.K 1.K 1.E+12 -0.0020001 0.0020001 0.0020001 1.
+ 22. 0.5 0.5 1. 2.0001 20.001n 1.K 1.K 1.E+12 -0.0020001 0.0020001 0.0020001 2.
+ 0. 0.5 0.5 1. 2.0001 20.001n 1.K 1.K 1.E+12 -0.0020001 0.0020001 0.0020001 0.
+-1. 0.5 0.5 1. 2.0014 20.014n 1.K 1.K 1.E+12 -0.0020014 0.0020014 0.0020014 1.
+ 22.001 0.5 0.5 1. 2.0014 20.014n 1.K 1.K 1.E+12 -0.0020014 0.0020014 0.0020014 2.
+ 0. 0.5 0.5 1. 2.0014 20.014n 1.K 1.K 1.E+12 -0.0020014 0.0020014 0.0020014 0.
+-1. 0.5 0.5 1. 2.0569 20.569n 1.K 1.K 1.E+12 -0.0020569 0.0020569 0.0020569 1.
+-2. 0.5 0.5 1. 2.0569 20.569n 1.K 1.K 1.E+12 -0.0020569 0.0020569 0.0020569 2.
+-3. 0.5 0.5 1. 2.0569 20.569n 1.K 1.K 1.E+12 -0.0020569 0.0020569 0.0020569 3.
+ 22.057 0.5 0.5 1. 2.0569 20.569n 1.K 1.K 1.E+12 -0.0020569 0.0020569 0.0020569 4.
+ 0. 0.5 0.5 1. 2.0569 20.569n 1.K 1.K 1.E+12 -0.0020569 0.0020569 0.0020569 0.
-1. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 1.
-2. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 2.
- 23. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
+-3. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 3.
+ 23. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 4.
0. 0.5 0.5 1. 3. 30.n 1.K 1.K 1.E+12 -0.003 0.003 0.003 0.
-1. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 1.
-2. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 2.
- 24. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
+-3. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 3.
+ 24. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 4.
0. 0.5 0.5 1. 4. 40.n 1.K 1.K 1.E+12 -0.004 0.004 0.004 0.
-1. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 1.
-2. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 2.
- 25. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 3.
+-3. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 3.
+ 25. 0.5 0.5 1. 5. 50.n 1.K 1.K 1.E+12 -0.005 0.005 0.005 4.
#Freq v(2) v(4) v(6) v(7) v(8) ev(W1) ev(W2) ev(W3) i(Vsig) i(Rprobe) i(Vprobe) iter(0)
1.K 0.5 0.5 1. 0. 0. 1.K 1.K 1.E+12 0. 0. 0. 0.
V1 ( 1 0 ) DC 1. AC 1.
@@ -246,7 +315,7 @@ Rprobe ( 7 8 ) 1.K
Vprobe ( 8 0 ) DC 0.
.model sss csw ( it=0. ih=.002 ion=NA( 0.002) ioff=NA(-0.002) ron=1.K roff=1.E+12 tnom=NA( 27.))
Gnucap System status
-iterations: op=0, dc=66, tran=138, fourier=0, total=261
-transient timesteps: accepted=46, rejected=9, total=55
+iterations: op=0, dc=84, tran=195, fourier=0, total=348
+transient timesteps: accepted=58, rejected=9, total=67
nodes: user=8, subckt=0, model=0, total=8
dctran density=25.0%, ac density=25.0%
diff --git a/tests/==out/d_vcvs.1.ckt.out b/tests/==out/d_vcvs.1.ckt.out
index b3f3bc70..9311b84d 100644
--- a/tests/==out/d_vcvs.1.ckt.out
+++ b/tests/==out/d_vcvs.1.ckt.out
@@ -18,3 +18,8 @@ r3 ( 4 0 ) 1.K
1.K 2. 0.5 0.002 -0.004 ?? ??
#Freq vo(v1) vin(v1) i(v1) p(v1) pd(v1) ps(v1)
1.K 1. 0. 500.u -500.u ?? ??
+Gnucap System status
+iterations: op=3, dc=0, tran=0, fourier=0, total=13
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=4, subckt=0, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/d_vcvs.2.ckt.out b/tests/==out/d_vcvs.2.ckt.out
index b22076d2..632a0696 100644
--- a/tests/==out/d_vcvs.2.ckt.out
+++ b/tests/==out/d_vcvs.2.ckt.out
@@ -18,3 +18,8 @@ r3 ( 0 4 ) 1.K
1.K 2. 0.5 0.002 -0.004 ?? ??
#Freq vo(v1) vin(v1) i(v1) p(v1) pd(v1) ps(v1)
1.K 1. 0. 500.u -500.u ?? ??
+Gnucap System status
+iterations: op=3, dc=0, tran=0, fourier=0, total=13
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=4, subckt=0, model=0, total=4
+dctran density=62.5%, ac density=62.5%
diff --git a/tests/==out/dc_temp.gc.out b/tests/==out/dc_temp.gc.out
index 3b346a6a..b4992680 100644
--- a/tests/==out/dc_temp.gc.out
+++ b/tests/==out/dc_temp.gc.out
@@ -28,3 +28,8 @@ rt3= 15.5
rt1= 21.
rt2= 42.
rt3= 100.5
+Gnucap System status
+iterations: op=0, dc=3, tran=0, fourier=0, total=18
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/insensitive.0.gc.out b/tests/==out/insensitive.0.gc.out
new file mode 100644
index 00000000..0656edec
--- /dev/null
+++ b/tests/==out/insensitive.0.gc.out
@@ -0,0 +1,15 @@
+module aaa (1,2);
+vsource #(.dc(0)) vs (.p(1),.n(2));
+endmodule // aaa
+
+module AAA (1,2);
+vsource #(.dc(1)) vs (.p(1),.n(2));
+endmodule // AAA
+
+module bbb (1,2);
+AAA #() vs (.1(1),.2(2));
+endmodule // bbb
+
+bbb #() b (.1(1),.2(0));
+# v(1)
+ 0. 1.
diff --git a/tests/==out/lang_verilog.1.gc.out b/tests/==out/lang_verilog.1.gc.out
index 4815dfc1..0b3b57fb 100644
--- a/tests/==out/lang_verilog.1.gc.out
+++ b/tests/==out/lang_verilog.1.gc.out
@@ -1,6 +1,6 @@
-paramset zz npn;\
- .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);\
-endparmset
+paramset zz npn;
+ .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);
+endparamset
module dumb_resistor (a,b);
resistor #(.r(r)) R1 (.p(a),.n(b));
diff --git a/tests/==out/lang_verilog.1a.gc.out b/tests/==out/lang_verilog.1a.gc.out
index 4815dfc1..0b3b57fb 100644
--- a/tests/==out/lang_verilog.1a.gc.out
+++ b/tests/==out/lang_verilog.1a.gc.out
@@ -1,6 +1,6 @@
-paramset zz npn;\
- .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);\
-endparmset
+paramset zz npn;
+ .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);
+endparamset
module dumb_resistor (a,b);
resistor #(.r(r)) R1 (.p(a),.n(b));
diff --git a/tests/==out/lang_verilog.2.gc.out b/tests/==out/lang_verilog.2.gc.out
index ab3bd3b3..1c515724 100644
--- a/tests/==out/lang_verilog.2.gc.out
+++ b/tests/==out/lang_verilog.2.gc.out
@@ -6,9 +6,9 @@ resistor # ... k)) Rin (in 0 vcc);
^ ? too many: requested=3 max=2
resistor # ... 00k)) Rout (out);
^ ? need 1 more nodes, grounding
-paramset zz npn;\
- .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);\
-endparmset
+paramset zz npn;
+ .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);
+endparamset
module dumb_resistor (a,b);
resistor #(.r(r)) R1 (.p(a),.n(b));
diff --git a/tests/==out/lang_verilog.3.gc.out b/tests/==out/lang_verilog.3.gc.out
index cc9ae2c0..a45cdf02 100644
--- a/tests/==out/lang_verilog.3.gc.out
+++ b/tests/==out/lang_verilog.3.gc.out
@@ -1,6 +1,6 @@
-paramset zz npn;\
- .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);\
-endparmset
+paramset zz npn;
+ .level=1; .kf=NA( 0.); .af=NA( 1.); .bf=150; .br=NA( 1.); .is=NA( 100.E-18); .nf=NA( 1.); .nr=NA( 1.); .c4=NA( 0.); .nc=NA( 2.); .c2=NA( 0.); .ne=NA( 1.5); .rb=NA( 0.); .re=NA( 0.); .rc=NA( 0.); .cjc=NA( 0.); .cje=NA( 0.); .cjs=NA( 0.); .mjc=NA( 0.33); .mje=NA( 0.33); .mjs=NA( 0.); .vjc=NA( 0.75); .vje=NA( 0.75); .vjs=NA( 0.75); .xcjc=NA( 1.); .itf=NA( 0.); .ptf=NA( 0.); .tf=NA( 0.); .tr=NA( 0.); .xtf=NA( 0.); .xtb=NA( 0.); .xti=NA( 3.); .eg=NA( 1.11);
+endparamset
module dumb_resistor (a,b);
resistor #(.r(r)) R1 (.p(a),.n(b));
diff --git a/tests/==out/ll1.ckt.out b/tests/==out/ll1.ckt.out
index a2c5bf30..7e8982e0 100644
--- a/tests/==out/ll1.ckt.out
+++ b/tests/==out/ll1.ckt.out
@@ -21,8 +21,9 @@ C6 ( 3 0 ) 0.1
27.745p 4. 1. 277.45p 277.45p 277.45p 277.45p 6.
766.72n 4. 1. 7.6672u 7.6672u 7.6672u 7.6672u 6.
14.732u 4. 1. 147.31u 147.31u 147.31u 147.31u 6.
- 0.0020118 4. 1. 0.019917 0.019917 0.019917 0.019917 6.
- 0.01 4. 1. 0.095202 0.095202 0.095202 0.095202 1.
+ 56.511u 4. 1. 564.96u 564.96u 564.96u 564.96u 6.
+ 0.0020452 4. 1. 0.020245 0.020245 0.020245 0.020245 6.
+ 0.01 4. 1. 0.095201 0.095201 0.095201 0.095201 1.
0.02 4. 1. 0.18137 0.18137 0.18137 0.18137 1.
0.03 4. 1. 0.25934 0.25934 0.25934 0.25934 1.
0.04 4. 1. 0.32988 0.32988 0.32988 0.32988 1.
@@ -50,7 +51,7 @@ R4 ( 2 0 ) 1.
R5 ( 1 3 ) 1.
C6 ( 3 0 ) 0.1
Gnucap System status
-iterations: op=0, dc=0, tran=91, fourier=0, total=125
-transient timesteps: accepted=16, rejected=7, total=23
+iterations: op=0, dc=0, tran=95, fourier=0, total=130
+transient timesteps: accepted=17, rejected=7, total=24
nodes: user=3, subckt=0, model=0, total=3
dctran density=77.8%, ac density=77.8%
diff --git a/tests/==out/m_expr.array.0.gc.out b/tests/==out/m_expr.array.0.gc.out
new file mode 100644
index 00000000..82fa730a
--- /dev/null
+++ b/tests/==out/m_expr.array.0.gc.out
@@ -0,0 +1,5 @@
+b='{1, 2, 1.}
+c='{ 2.71828182845905, 2, 2.71828182845905}
+ a= 1. b= '{1,2,a} c= '{exp(1),2,exp(a)} y= 1.
+d='{1, 2, 1., '{ 2.71828182845905, 1., exp(z)}, 0.}
+e='{1, 2, '{1, 2, 1.}, '{'{1, 2, 1.}, '{1, 2, 1.}}, 0.}
diff --git a/tests/==out/m_expr.error.0.gc.out b/tests/==out/m_expr.error.0.gc.out
new file mode 100644
index 00000000..adb76c18
--- /dev/null
+++ b/tests/==out/m_expr.error.0.gc.out
@@ -0,0 +1,5 @@
+"param a3={<test + stuff} "
+"eval a3 "
+<test + stuff
+ ^ ? need >
+a3=<test + stuff>
diff --git a/tests/==out/m_expr.error.0a.gc.out b/tests/==out/m_expr.error.0a.gc.out
new file mode 100644
index 00000000..38dbb89e
--- /dev/null
+++ b/tests/==out/m_expr.error.0a.gc.out
@@ -0,0 +1,22 @@
+"param a3={<test>} "
+"verilog "
+"capacitor #(a3) r1(1,0); "
+"capacitor #(.c(<aaa>)) r1(1,0); "
+"capacitor #(" <test> + 4 ") r1(1,0); "
+capacitor #(" <test> + 4 ") r1(1,0);
+ ^ ? '(' required (parse ports) (grounding)
+capacitor #(" <test> + 4 ") r1(1,0);
+ ^ ? p: port unconnected, grounding
+capacitor #(" <test> + 4 ") r1(1,0);
+ ^ ? n: port unconnected, grounding
+capacitor #(" <test> + 4 ") r1(1,0);
+ ^ ? what's this?
+"list "
+capacitor #(.c(a3)) r1 (.p(1),.n(0));
+capacitor #(.c(<aaa>)) r1 (.p(1),.n(0));
+capacitor #() <test> + 4 (.p(0),.n(0));
+"dc "
+parameter a3 not specified, using default
+parameter <aaa> not specified, using default
+#
+ 0.
diff --git a/tests/==out/m_expression.0.gc.out b/tests/==out/m_expression.0.gc.out
new file mode 100644
index 00000000..3c0288da
--- /dev/null
+++ b/tests/==out/m_expression.0.gc.out
@@ -0,0 +1,52 @@
+"eval "string" "
+"string"="string"
+"param a="aaa" "
+"eval a "
+a=aaa
+"param b={"aaa" + "bbb"} "
+"eval b "
+b=("bbb" + "aaa")
+"param c={"aaa" == "bbb"} "
+"eval c "
+c= 0.
+"param d={"aaa" == a} "
+"eval d "
+d= 1.
+"param e={exp("0.")} "
+"eval e "
+e=exp("0.")
+"param f={exp(1.+"0.")} "
+"eval f "
+f=exp(("0." + 1.))
+"param g={exp("aaa" == 0.)} "
+"eval g "
+g=exp(("aaa" == 0.))
+"param h={exp(0. == "aaa")} "
+"eval h "
+h=exp((0. == "aaa"))
+"param i={exp(a == "aaa")} "
+"eval i "
+i= 2.71828182845905
+"param j={exp(0. != 0.)} "
+"eval j "
+j= 1.
+"param k={"aaa bbb"} "
+"eval k "
+k="aaa bbb"
+"* //BUG// does not work with spice get_line "
+"param l={"aaa\"bbb"} "
+"eval l "
+l="aaa"
+"* //BUG// totally does not work with spice get_line "
+"* param m=exp("aaa\"bbb") "
+"* eval m "
+"options nag "
+"param n={"missing quote} "
+>>>>>param n={"missing quote}
+"eval n "
+>>>>>eval n
+"missing quote
+ ^ ? end of file in quoted string
+"missing quote
+^ ? string begins here
+n="missing quote"
diff --git a/tests/==out/m_expression.1.gc.out b/tests/==out/m_expression.1.gc.out
new file mode 100644
index 00000000..328c42f8
--- /dev/null
+++ b/tests/==out/m_expression.1.gc.out
@@ -0,0 +1,49 @@
+"param a={1?2:3} "
+"eval a "
+a= 2.
+"param b={0?2:3} "
+"eval b "
+b= 3.
+"param c={x?2:3} "
+"eval c "
+c=(x)? (2):(3)
+"param d={exp(4)?2:3} "
+"eval d "
+d= 2.
+"param e={1-1?2:3} "
+"eval e "
+e= 3.
+"param f={(exp(0)-1)?2:3} "
+"eval f "
+f= 3.
+"param g={(exp(0)>0)?2:3} "
+"eval g "
+g= 2.
+"param h={(exp(0)>=1)?2:3*0} "
+"eval h "
+h= 2.
+"param i={(1)?1:0&&0} "
+"eval i "
+i= 1.
+"param j={(1)?0:0||1} "
+"eval j "
+j= 0.
+"param k={(0?0:0)||1} "
+"eval k "
+k= 1.
+"param l={0?0:(0||1)} "
+"eval l "
+l= 1.
+"param m={0?1:1+0?2:3} "
+"eval m "
+m= 2.
+"param n={(xx==0)?1/2:1/3} "
+"eval n "
+n=((xx == 0))? ( 0.5):( 0.333333333333333)
+"param o={ (QEpercent != 0) ? QEpercent*Lambda/1.2398e5:Responsivity } "
+"eval o "
+o=((QEpercent != 0))? (((Lambda * QEpercent) / 1.2398e5)):(Responsivity)
+"param p={0?1:1+0?2} "
+"eval p "
+eval p
+ ^ ? missing colon (ternary)
diff --git a/tests/==out/m_expression.2.gc.out b/tests/==out/m_expression.2.gc.out
new file mode 100644
index 00000000..c2b675da
--- /dev/null
+++ b/tests/==out/m_expression.2.gc.out
@@ -0,0 +1,18 @@
+"param a1={2%3} "
+"eval a1 "
+a1= 2.
+"param a2={2%3+1} "
+"eval a2 "
+a2= 3.
+"param a3={c+2%3+b} "
+"eval a3 "
+a3=((c + 2.) + b)
+"param a4={(c+2)%3+b} "
+"eval a4 "
+a4=(((c + 2) % 3) + b)
+"param a5={12*3%4*2.} "
+"eval a5 "
+a5= 0.
+"param a6={exp(12*3%4*2.)} "
+"eval a6 "
+a6= 1.
diff --git a/tests/==out/m_expression.3.gc.out b/tests/==out/m_expression.3.gc.out
new file mode 100644
index 00000000..acae1df5
--- /dev/null
+++ b/tests/==out/m_expression.3.gc.out
@@ -0,0 +1,25 @@
+"param a1=b[4] "
+"eval a1 "
+a1=b[4]
+"param a2="_[b]4" "
+"eval a2 "
+a2=_[b]4
+"param a3="b]x]y]z]w" "
+"eval a3 "
+a3=b
+"param a4=_]b[3 "
+"eval a4 "
+a4=_
+"param a5=_$b[3 "
+"eval a5 "
+_$b[3
+ ^ ? missing ]?
+a5=_$b[3
+"param a6=yy[[3] "
+"eval a6 "
+yy[[3]
+ ^ ? missing ]?
+a6=yy[[3]
+"param a7=yy[3]] "
+"eval a7 "
+a7=yy[3]
diff --git a/tests/==out/m_expression.4.gc.out b/tests/==out/m_expression.4.gc.out
new file mode 100644
index 00000000..4a5e7c17
--- /dev/null
+++ b/tests/==out/m_expression.4.gc.out
@@ -0,0 +1,12 @@
+"param a1={<test> + 2} "
+"eval a1 "
+a1=(<test> + 2)
+"param a2={test2# + stuff} "
+"eval a2 "
+a2=test2
+"param a3={<test2>bla + stuff} "
+"eval a3 "
+a3=<test2>
+"param a4={exp(<test2>) * 17.} "
+"eval a4 "
+a4=(exp(<test2>) * 17.)
diff --git a/tests/==out/m_expression.7.gc.out b/tests/==out/m_expression.7.gc.out
new file mode 100644
index 00000000..01420a8e
--- /dev/null
+++ b/tests/==out/m_expression.7.gc.out
@@ -0,0 +1,19 @@
+"param a2=ln(3) "
+"param a1=log(3) "
+"param a3=log10(3) "
+"param "
+ a1=log(3) a2=ln(3) a3=log10(3)
+"eval a1 "
+a1= 1.09861228866811
+"eval a2 "
+a2= 1.09861228866811
+"eval a3 "
+a3= 0.477121254719662
+"option debug "
+"eval a1 "
+log(3): Ambiguous. Use 'ln', or 'log10'
+a1= 1.09861228866811
+"eval a2 "
+a2= 1.09861228866811
+"eval a3 "
+a3= 0.477121254719662
diff --git a/tests/==out/m_expression.error.1.ckt.out b/tests/==out/m_expression.error.1.ckt.out
index 859d10a5..1dfc5437 100644
--- a/tests/==out/m_expression.error.1.ckt.out
+++ b/tests/==out/m_expression.error.1.ckt.out
@@ -1,2 +1,3 @@
# expression error
-no match: foo
+.eval foo(3)
+ ^ ? no match: foo
diff --git a/tests/==out/param.8.ckt.out b/tests/==out/param.8.ckt.out
index 225a4787..30b79686 100644
--- a/tests/==out/param.8.ckt.out
+++ b/tests/==out/param.8.ckt.out
@@ -1,10 +1,15 @@
'parameter test
a= 1. b= 2. c= 3.
parameter d not specified, using default
-# v(1) v(2)
+# v(1) v(2) iter(0)
parameter d not specified, using default
r2: short circuit
r2: short circuit
r2: short circuit
r2: short circuit
- 27. 1. 0.
+ 27. 1. 3.3333u 4.
+Gnucap System status
+iterations: op=4, dc=0, tran=0, fourier=0, total=4
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/param.dollar.gc.out b/tests/==out/param.dollar.gc.out
new file mode 100644
index 00000000..a622eb26
--- /dev/null
+++ b/tests/==out/param.dollar.gc.out
@@ -0,0 +1,2 @@
+ dollar=dol$lar
+dol$lar=dol$lar
diff --git a/tests/==out/s_dc.admit.gc.out b/tests/==out/s_dc.admit.gc.out
new file mode 100644
index 00000000..c67e0c0c
--- /dev/null
+++ b/tests/==out/s_dc.admit.gc.out
@@ -0,0 +1,22 @@
+v1 ( 1 0 ) v
+y1 ( 0 1 ) 1/r
+v2 ( 2 0 ) v
+y2 ( 0 2 ) 1/r
+# i(v1) i(v2)
+ 1. 0.99999 0.99999
+ 2. 0.5 0.5
+# i(v1) i(v2)
+ 1. 0.99999 0.99999
+ 2. 2. 0.99999
+# i(v1) i(v2)
+ 1. 0.99999 0.99999
+ 2. 0.5 0.5
+# i(v1) i(v2)
+ 1. 0.99999 0.99999
+ 2. 2. 0.99999
+# i(y1) i(y2)
+ 1. 0.99999 0.99999
+ 2. 0.5 0.5
+# i(y1) i(y2)
+ 1. 0.99999 0.99999
+ 2. 2. 0.99999
diff --git a/tests/==out/s_dc.bin1.ckt.out b/tests/==out/s_dc.bin1.ckt.out
new file mode 100644
index 00000000..b9f575cb
--- /dev/null
+++ b/tests/==out/s_dc.bin1.ckt.out
@@ -0,0 +1,9 @@
+bug, some models don't complain when parameters move out of range
+#
+ 0.
+#
+ 0.
+#
+ 1.u
+ 2.u
+ 3.u
diff --git a/tests/==out/s_dc.bug0.gc.out b/tests/==out/s_dc.bug0.gc.out
new file mode 100644
index 00000000..9b851042
--- /dev/null
+++ b/tests/==out/s_dc.bug0.gc.out
@@ -0,0 +1,14 @@
+v1 ( 1 0 ) v
+r1 ( 0 1 ) 1/g
+# i(r1)
+ 1. 0.99999
+ 2. 0.5
+# i(r1)
+ 1. -0.99999
+ 2. -2.
+# i(v1)
+ 1. 0.99999
+ 2. 0.5
+# i(v1)
+ 1. -0.99999
+ 2. -2.
diff --git a/tests/==out/s_dc.cccs0.gc.out b/tests/==out/s_dc.cccs0.gc.out
new file mode 100644
index 00000000..c95ed572
--- /dev/null
+++ b/tests/==out/s_dc.cccs0.gc.out
@@ -0,0 +1,4 @@
+# v(in) v(out)
+ 0. 0.99999 0.
+ 1. 0.99999 0.99999
+ 2. 0.99999 2.
diff --git a/tests/==out/s_dc.res0.gc.out b/tests/==out/s_dc.res0.gc.out
new file mode 100644
index 00000000..3704c7ca
--- /dev/null
+++ b/tests/==out/s_dc.res0.gc.out
@@ -0,0 +1,21 @@
+r1 ( 1 0 ) r
+i1 ( 0 1 ) i
+v1 ( 2 0 ) v
+# v(1) v(2)
+ 0. 1. 1.
+# v(1) v(2)
+ 1. 1. 1.
+ 2. 2. 1.
+# v(1) v(2)
+ 0. 0. 1.
+ 1. 1. 1.
+ 2. 2. 1.
+# v(1) v(2)
+ 0. 1. 0.
+ 1. 1. 1.
+ 2. 1. 2.
+Gnucap System status
+iterations: op=0, dc=10, tran=0, fourier=0, total=32
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=50.0%, ac density=50.0%
diff --git a/tests/==out/s_dc.sqrt.0.gc.out b/tests/==out/s_dc.sqrt.0.gc.out
new file mode 100644
index 00000000..f24ac3b8
--- /dev/null
+++ b/tests/==out/s_dc.sqrt.0.gc.out
@@ -0,0 +1,11 @@
+# v(2)
+ 0. 0.
+ 0.5 0.70711
+ 1. 1.
+ 1.5 1.2247
+ 2. 1.4142
+Gnucap System status
+iterations: op=0, dc=14, tran=0, fourier=0, total=14
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/s_dc.sweep.1.gc.out b/tests/==out/s_dc.sweep.1.gc.out
new file mode 100644
index 00000000..b87d0f20
--- /dev/null
+++ b/tests/==out/s_dc.sweep.1.gc.out
@@ -0,0 +1,34 @@
+r1 ( 1 0 ) r
+i1 ( 0 1 ) i
+v1 ( 2 0 ) v
+# v(1) v(2)
+ 0. 1. 1.
+# v(1) v(2)
+ 1. 1. 1.
+ 2. 2. 1.
+# v(1) v(2)
+ 1. 1. 1.
+ 2. 2. 1.
+ 3. 3. 1.
+# v(1) v(2)
+ 0. 1. 0.
+ 1. 1. 1.
+ 2. 1. 2.
+# v(r1) v(i1) v(v1)
+ 27. 1. -1. 1.
+# v(r1) v(i1) v(v1)
+ 1. 1. -1. 1.
+ 2. 2. -2. 1.
+# v(r1) v(i1) v(v1)
+ 1. 1. -1. 1.
+ 2. 2. -2. 1.
+ 3. 3. -3. 1.
+# v(r1) v(i1) v(v1)
+ 0. 1. -1. 0.
+ 1. 1. -1. 1.
+ 2. 1. -1. 2.
+Gnucap System status
+iterations: op=4, dc=10, tran=0, fourier=0, total=66
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=50.0%, ac density=50.0%
diff --git a/tests/==out/s_dc.sweep.2.gc.out b/tests/==out/s_dc.sweep.2.gc.out
new file mode 100644
index 00000000..5b2a0f39
--- /dev/null
+++ b/tests/==out/s_dc.sweep.2.gc.out
@@ -0,0 +1,27 @@
+*// qucs style component macros.
+.subckt Idc ( 1 2 )
+dev ( 2 1 ) isource I
+.ends Idc
+.subckt Vdc ( p n )
+dev ( p n ) vsource U
+.ends Vdc
+.subckt R ( p n )
+*// local?
+dev ( p n ) resistor R * (1. + dT*(Tc1 + dT*Tc2))
+.ends R
+i1 ( 1 0 ) Idc I=ii
+r1 ( 1 0 ) R R=rr
+v1 ( 2 0 ) Vdc U=vv
+# v(1) v(2)
+ 0. 1. 1.
+# v(1) v(2)
+ 1. 1. 1.
+ 2. 2. 1.
+# v(1) v(2)
+ 0. 0. 1.
+ 1. 1. 1.
+ 2. 2. 1.
+# v(1) v(2)
+ 0. 1. 0.
+ 1. 1. 1.
+ 2. 1. 2.
diff --git a/tests/==out/s_dc.sweep.3.gc.out b/tests/==out/s_dc.sweep.3.gc.out
new file mode 100644
index 00000000..249bb9f0
--- /dev/null
+++ b/tests/==out/s_dc.sweep.3.gc.out
@@ -0,0 +1,7 @@
+* parameter vs element sweep
+* (elements take precedence)
+v1 ( 1 0 ) DC 2*v1
+# v(1)
+ 0. 0.
+ 1. 1.
+ 2. 2.
diff --git a/tests/==out/s_dc.vcg0.gc.out b/tests/==out/s_dc.vcg0.gc.out
new file mode 100644
index 00000000..b924d118
--- /dev/null
+++ b/tests/==out/s_dc.vcg0.gc.out
@@ -0,0 +1,4 @@
+# v(in) v(out)
+ 1. 1. 1.
+ 2. 1. 0.5
+ 3. 1. 0.33333
diff --git a/tests/==out/s_dc.vcvs0.gc.out b/tests/==out/s_dc.vcvs0.gc.out
new file mode 100644
index 00000000..5c8a8365
--- /dev/null
+++ b/tests/==out/s_dc.vcvs0.gc.out
@@ -0,0 +1,4 @@
+# v(in) v(out)
+ 0. 1.5 0.
+ 1. 1.5 1.5
+ 2. 1.5 3.
diff --git a/tests/==out/s_dc.vcvs1.gc.out b/tests/==out/s_dc.vcvs1.gc.out
new file mode 100644
index 00000000..5c8a8365
--- /dev/null
+++ b/tests/==out/s_dc.vcvs1.gc.out
@@ -0,0 +1,4 @@
+# v(in) v(out)
+ 0. 1.5 0.
+ 1. 1.5 1.5
+ 2. 1.5 3.
diff --git a/tests/==out/s_dc.vs0.gc.out b/tests/==out/s_dc.vs0.gc.out
new file mode 100644
index 00000000..03f9ca99
--- /dev/null
+++ b/tests/==out/s_dc.vs0.gc.out
@@ -0,0 +1,4 @@
+# i(r1)
+ 0. 0.
+ 1. 0.99999
+ 2. 2.
diff --git a/tests/==out/s_dc.vs1.gc.out b/tests/==out/s_dc.vs1.gc.out
new file mode 100644
index 00000000..03f9ca99
--- /dev/null
+++ b/tests/==out/s_dc.vs1.gc.out
@@ -0,0 +1,4 @@
+# i(r1)
+ 0. 0.
+ 1. 0.99999
+ 2. 2.
diff --git a/tests/==out/s_dc_noprint.gc.out b/tests/==out/s_dc_noprint.gc.out
new file mode 100644
index 00000000..3c4d3768
--- /dev/null
+++ b/tests/==out/s_dc_noprint.gc.out
@@ -0,0 +1,9 @@
+vsource #(.dc(1)) v (.p(30),.n(0));
+#
+ 0.
+ 1.
+Gnucap System status
+iterations: op=0, dc=6, tran=0, fourier=0, total=6
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
diff --git a/tests/==out/temp.1.gc.out b/tests/==out/temp.1.gc.out
index 41f8e2df..e66f54cd 100644
--- a/tests/==out/temp.1.gc.out
+++ b/tests/==out/temp.1.gc.out
@@ -154,4 +154,10 @@
".ac 1 "
#Freq r(R1) temp(0)
1. 3.946 1.K
+".status notime "
+Gnucap System status
+iterations: op=33, dc=23, tran=13, fourier=0, total=217
+transient timesteps: accepted=20, rejected=0, total=20
+nodes: user=1, subckt=0, model=0, total=1
+dctran density=100.0%, ac density=100.0%
".end "
diff --git a/tests/==out/trcurve.ckt.out b/tests/==out/trcurve.ckt.out
index 6e410b67..15e2333e 100644
--- a/tests/==out/trcurve.ckt.out
+++ b/tests/==out/trcurve.ckt.out
@@ -628,3 +628,8 @@ TRANSFER curve tracer, ig-spice
4. 4. -5. 2.0883n 100.48u -2.0883n 100.48u
4.5 4.5 -5. 17.193p 141.41u -17.193p 141.41u
5. 5. -5. 13.872p 186.13u -13.872p 186.13u
+Gnucap System status
+iterations: op=0, dc=318, tran=0, fourier=0, total=2903
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=6, subckt=0, model=4, total=10
+dctran density=76.0%, ac density=76.0%
diff --git a/tests/==out/trcurve2.ckt.out b/tests/==out/trcurve2.ckt.out
index 27e85845..0d0d60f0 100644
--- a/tests/==out/trcurve2.ckt.out
+++ b/tests/==out/trcurve2.ckt.out
@@ -75,3 +75,8 @@ TRANSFER curve tracer, ig-spice
3. 3. -5. 12.899u 31.998u -12.899u 31.998u 5.
4. 4. -5. 2.0883n 100.77u -2.0883n 100.77u 4.
5. 5. -5. 13.872p 186.73u -13.872p 186.73u 4.
+Gnucap System status
+iterations: op=5, dc=167, tran=0, fourier=0, total=327
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=6, subckt=0, model=0, total=6
+dctran density=88.9%, ac density=88.9%
diff --git a/tests/==out/trcurves.ckt.out b/tests/==out/trcurves.ckt.out
index 679dcb94..da7d3c34 100644
--- a/tests/==out/trcurves.ckt.out
+++ b/tests/==out/trcurves.ckt.out
@@ -70,3 +70,8 @@ TRANSFER curve tracer, ig-spice
4. 4. -5. 323.37p 86.212u -323.37p 86.212u
4.5 4.5 -5. 14.394p 135.86u -14.394p 135.86u
5. 5. -5. 13.867p 191.53u -13.867p 191.53u
+Gnucap System status
+iterations: op=0, dc=346, tran=0, fourier=0, total=353
+transient timesteps: accepted=0, rejected=0, total=0
+nodes: user=6, subckt=0, model=4, total=10
+dctran density=76.0%, ac density=76.0%
diff --git a/tests/==out/u_attrib.1.gc.out b/tests/==out/u_attrib.1.gc.out
new file mode 100644
index 00000000..1714bde2
--- /dev/null
+++ b/tests/==out/u_attrib.1.gc.out
@@ -0,0 +1,53 @@
+"verilog "
+"(* a *) module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"endmodule; "
+"(* h *) module bbb (e,f); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"aaa a1(a,b); "
+"(* e *) aaa a2(a,b); "
+"a1 a3(a,b); "
+"a2 a4(a,b); "
+"(* f *) a1 a5(a,b); "
+"(* g *) a2 a6(a,b); "
+"(* i *)(* j *) a1 a7(a,b); "
+"(* k *)(* l *) a2 a8(a,b); "
+"endmodule; "
+"list "
+(* a *) module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+(* h *) module bbb (e,f);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+(* e *) aaa #() a2 (.c(a),.d(b));
+a1 #() a3 (.c(a),.d(b));
+a2 #() a4 (.c(a),.d(b));
+(* f *) a1 #() a5 (.c(a),.d(b));
+(* g *) a2 #() a6 (.c(a),.d(b));
+(* i, j *) a1 #() a7 (.c(a),.d(b));
+(* k, l *) a2 #() a8 (.c(a),.d(b));
+endmodule // bbb
+
+"end "
diff --git a/tests/==out/u_attrib.2.gc.out b/tests/==out/u_attrib.2.gc.out
new file mode 100644
index 00000000..7715cc87
--- /dev/null
+++ b/tests/==out/u_attrib.2.gc.out
@@ -0,0 +1,47 @@
+"verilog "
+"module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"resistor #((*r*)200,(*m*)2) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"r1 r5(a,b); "
+"r2 r6(a,b); "
+"endmodule; "
+"module bbb ((*b*)e,f); "
+"resistor #((*a*)100) r1(a,b); "
+"resistor #((*d*).m(2),.r(200)) r2(a,b); "
+"resistor #(.m(2),(*d*).r(200)) r2a(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"r1 r5(a,b); "
+"r2 r6(a,b); "
+"aaa a1(a,b); "
+"aaa a2(.d(a),.c(b)); "
+"aaa a3(a,(*u*)b); "
+"aaa a4((*u*).d(a),.c(b)); "
+"endmodule; "
+"list "
+module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+resistor #((* r *) .r(200),(* m *) .m(2)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200),.m(2)) r4 (.p(a),.n(b));
+resistor #(.r(100)) r5 (.p(a),.n(b));
+resistor #(.r(200),.m(2)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+module bbb ((* b *) e,f);
+resistor #((* a *) .r(100)) r1 (.p(a),.n(b));
+resistor #(.r(200),(* d *) .m(2)) r2 (.p(a),.n(b));
+resistor #((* d *) .r(200),.m(2)) r2a (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200),.m(2)) r4 (.p(a),.n(b));
+resistor #(.r(100)) r5 (.p(a),.n(b));
+resistor #(.r(200),.m(2)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+aaa #() a2 (.c(b),.d(a));
+aaa #() a3 (.c(a),(* u *) .d(b));
+aaa #() a4 (.c(b),(* u *) .d(a));
+endmodule // bbb
+
+"end "
diff --git a/tests/==out/u_attrib.3.gc.out b/tests/==out/u_attrib.3.gc.out
new file mode 100644
index 00000000..55c20a82
--- /dev/null
+++ b/tests/==out/u_attrib.3.gc.out
@@ -0,0 +1,107 @@
+"verilog "
+"(* a *) module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"endmodule; "
+"(* h *) module bbb (e,f); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"aaa a1(a,b); "
+"(* e *) aaa a2(a,b); "
+"a1 a3(a,b); "
+"a2 a4(a,b); "
+"(* f *) a1 a5(a,b); "
+"(* g *) a2 a6(a,b); "
+"(* i *)(* j *) a1 a7(a,b); "
+"(* k *)(* l *) a2 a8(a,b); "
+"endmodule; "
+"list "
+(* a *) module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+(* h *) module bbb (e,f);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+(* e *) aaa #() a2 (.c(a),.d(b));
+a1 #() a3 (.c(a),.d(b));
+a2 #() a4 (.c(a),.d(b));
+(* f *) a1 #() a5 (.c(a),.d(b));
+(* g *) a2 #() a6 (.c(a),.d(b));
+(* i, j *) a1 #() a7 (.c(a),.d(b));
+(* k, l *) a2 #() a8 (.c(a),.d(b));
+endmodule // bbb
+
+"clear "
+"option list "
+"verilog "
+"(* a *) module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"endmodule; "
+"(* h *) module bbb (e,f); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"aaa a1(a,b); "
+"(* e *) aaa a2(a,b); "
+"a1 a3(a,b); "
+"a2 a4(a,b); "
+"(* f *) a1 a5(a,b); "
+"(* g *) a2 a6(a,b); "
+"(* i *)(* j *) a1 a7(a,b); "
+"(* k *)(* l *) a2 a8(a,b); "
+"endmodule; "
+"list "
+(* a *) module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+(* h *) module bbb (e,f);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+(* e *) aaa #() a2 (.c(a),.d(b));
+a1 #() a3 (.c(a),.d(b));
+a2 #() a4 (.c(a),.d(b));
+(* f *) a1 #() a5 (.c(a),.d(b));
+(* g *) a2 #() a6 (.c(a),.d(b));
+(* i, j *) a1 #() a7 (.c(a),.d(b));
+(* k, l *) a2 #() a8 (.c(a),.d(b));
+endmodule // bbb
+
+"end "
diff --git a/tests/==out/u_attrib.4.gc.out b/tests/==out/u_attrib.4.gc.out
new file mode 100644
index 00000000..5cab62f4
--- /dev/null
+++ b/tests/==out/u_attrib.4.gc.out
@@ -0,0 +1,163 @@
+"verilog "
+"(* a *) module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"endmodule; "
+"(* h *) module bbb (e,f); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"aaa a1(a,b); "
+"(* e *) aaa a2(a,b); "
+"a1 a3(a,b); "
+"a2 a4(a,b); "
+"(* f *) a1 a5(a,b); "
+"(* g *) a2 a6(a,b); "
+"(* i *)(* j *) a1 a7(a,b); "
+"(* k *)(* l *) a2 a8(a,b); "
+"endmodule; "
+"list "
+(* a *) module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+(* h *) module bbb (e,f);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+(* e *) aaa #() a2 (.c(a),.d(b));
+a1 #() a3 (.c(a),.d(b));
+a2 #() a4 (.c(a),.d(b));
+(* f *) a1 #() a5 (.c(a),.d(b));
+(* g *) a2 #() a6 (.c(a),.d(b));
+(* i, j *) a1 #() a7 (.c(a),.d(b));
+(* k, l *) a2 #() a8 (.c(a),.d(b));
+endmodule // bbb
+
+"clear "
+"option list "
+"verilog "
+"(* a *) module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"endmodule; "
+"(* h *) module bbb (e,f); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"aaa a1(a,b); "
+"(* e *) aaa a2(a,b); "
+"a1 a3(a,b); "
+"a2 a4(a,b); "
+"(* f *) a1 a5(a,b); "
+"(* g *) a2 a6(a,b); "
+"(* i *)(* j *) a1 a7(a,b); "
+"(* k *)(* l *) a2 a8(a,b); "
+"endmodule; "
+"list "
+(* a *) module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+(* h *) module bbb (e,f);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+(* e *) aaa #() a2 (.c(a),.d(b));
+a1 #() a3 (.c(a),.d(b));
+a2 #() a4 (.c(a),.d(b));
+(* f *) a1 #() a5 (.c(a),.d(b));
+(* g *) a2 #() a6 (.c(a),.d(b));
+(* i, j *) a1 #() a7 (.c(a),.d(b));
+(* k, l *) a2 #() a8 (.c(a),.d(b));
+endmodule // bbb
+
+"clear "
+"option list "
+"verilog "
+"(* a *) module aaa (c,d); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"endmodule; "
+"(* h *) module bbb (e,f); "
+"resistor #(100) r1(a,b); "
+"(* b *) resistor #(200) r2(a,b); "
+"r1 r3(a,b); "
+"r2 r4(a,b); "
+"(* c *) r1 r5(a,b); "
+"(* d *) r2 r6(a,b); "
+"aaa a1(a,b); "
+"(* e *) aaa a2(a,b); "
+"a1 a3(a,b); "
+"a2 a4(a,b); "
+"(* f *) a1 a5(a,b); "
+"(* g *) a2 a6(a,b); "
+"(* i *)(* j *) a1 a7(a,b); "
+"(* k *)(* l *) a2 a8(a,b); "
+"endmodule; "
+"list "
+(* a *) module aaa (c,d);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+endmodule // aaa
+
+(* h *) module bbb (e,f);
+resistor #(.r(100)) r1 (.p(a),.n(b));
+(* b *) resistor #(.r(200)) r2 (.p(a),.n(b));
+resistor #(.r(100)) r3 (.p(a),.n(b));
+resistor #(.r(200)) r4 (.p(a),.n(b));
+(* c *) resistor #(.r(100)) r5 (.p(a),.n(b));
+(* d *) resistor #(.r(200)) r6 (.p(a),.n(b));
+aaa #() a1 (.c(a),.d(b));
+(* e *) aaa #() a2 (.c(a),.d(b));
+a1 #() a3 (.c(a),.d(b));
+a2 #() a4 (.c(a),.d(b));
+(* f *) a1 #() a5 (.c(a),.d(b));
+(* g *) a2 #() a6 (.c(a),.d(b));
+(* i, j *) a1 #() a7 (.c(a),.d(b));
+(* k, l *) a2 #() a8 (.c(a),.d(b));
+endmodule // bbb
+
+"clear "
+"list "
+"end "
diff --git a/tests/bm_fit.0.1.ckt b/tests/bm_fit.0.1.ckt
index daf7a78c..c01399da 100644
--- a/tests/bm_fit.0.1.ckt
+++ b/tests/bm_fit.0.1.ckt
@@ -13,4 +13,5 @@ r4 4 0 10k
.dc v1 -10 10 1
.dc v1 1 100 decade 5
.dc v1 32 68 9
+*>.status notime
.end
diff --git a/tests/bm_fit.1.1.ckt b/tests/bm_fit.1.1.ckt
index 9e65209e..2a6ad147 100644
--- a/tests/bm_fit.1.1.ckt
+++ b/tests/bm_fit.1.1.ckt
@@ -13,4 +13,5 @@ r4 4 0 10k
.dc v1 -10 10 1
.dc v1 1 100 decade 5
.dc v1 32 68 9
+*>.status notime
.end
diff --git a/tests/bm_fit.2.1.ckt b/tests/bm_fit.2.1.ckt
index fc80a890..b03ad5e0 100644
--- a/tests/bm_fit.2.1.ckt
+++ b/tests/bm_fit.2.1.ckt
@@ -12,4 +12,5 @@ e1 4 0 5 1 FIT 0,0 1,1 4,2 9,3 16,4 25,5 order=2
.op
.print dc v(1 2 3 4 5 6 7)
.dc v1 -10 10 .25
+*>.status notime
.end
diff --git a/tests/bm_fit.2.2.ckt b/tests/bm_fit.2.2.ckt
index a02afbae..cc9eea4e 100644
--- a/tests/bm_fit.2.2.ckt
+++ b/tests/bm_fit.2.2.ckt
@@ -12,4 +12,5 @@ e1 4 0 5 1 FIT 0,0 1,1 4,2 9,3 16,4 25,5 order=2 below=1.56984
.op
.print dc v(1 2 3 4 5 6 7)
.dc v1 -10 10 .25
+*>.status notime
.end
diff --git a/tests/bm_fit.2.3.ckt b/tests/bm_fit.2.3.ckt
index 64caa81e..7a2db00b 100644
--- a/tests/bm_fit.2.3.ckt
+++ b/tests/bm_fit.2.3.ckt
@@ -12,4 +12,5 @@ e1 4 0 5 1 FIT 0,0 1,1 4,2 9,3 16,4 25,5 order=2 above=.1
.op
.print dc v(1 2 3 4 5 6 7)
.dc v1 -10 10 .25
+*>.status notime
.end
diff --git a/tests/bm_fit.3.3.ckt b/tests/bm_fit.3.3.ckt
index b57fb446..78617d46 100644
--- a/tests/bm_fit.3.3.ckt
+++ b/tests/bm_fit.3.3.ckt
@@ -3,4 +3,5 @@ v1 1 0 fit 1n,3 2n,3.5 3n,4 4n,4.5 5n,5 6n,5 7n,5 8n,5 9n,5
+ order=3 below=0 above=0
.print tran v(nodes)
.tran 0 10n .1n trace all
+*>.status notime
.end
diff --git a/tests/bm_table.1.1.ckt b/tests/bm_table.1.1.ckt
index 88fdd4f3..815566dc 100644
--- a/tests/bm_table.1.1.ckt
+++ b/tests/bm_table.1.1.ckt
@@ -14,4 +14,5 @@ r4 4 0 10k
.dc v1 -10 10 1
.dc v1 1 100 decade 5
.dc v1 32 68 9
+*>.status notime
.end
diff --git a/tests/bm_table.2.1.ckt b/tests/bm_table.2.1.ckt
index 81c14da4..3a1180d5 100644
--- a/tests/bm_table.2.1.ckt
+++ b/tests/bm_table.2.1.ckt
@@ -14,4 +14,5 @@ e1 4 0 5 1 t2
.op
.print dc v(1 2 3 4 5 6 7)
.dc v1 -10 10 .25
+*>.status notime
.end
diff --git a/tests/bm_table.2.3.ckt b/tests/bm_table.2.3.ckt
index ee84d6ba..7f1e1169 100644
--- a/tests/bm_table.2.3.ckt
+++ b/tests/bm_table.2.3.ckt
@@ -14,4 +14,5 @@ e1 4 0 5 1 t2
.op
.print dc v(1 2 3 4 5 6 7)
.dc v1 -10 10 .25
+*>.status notime
.end
diff --git a/tests/bm_table.2.4.ckt b/tests/bm_table.2.4.ckt
index d6a35311..882f5bf3 100644
--- a/tests/bm_table.2.4.ckt
+++ b/tests/bm_table.2.4.ckt
@@ -14,4 +14,5 @@ e1 4 0 5 1 t2
.op
.print dc v(1 2 3 4 5 6 7)
.dc v1 -10 10 .25
+*>.status notime
.end
diff --git a/tests/bm_table.3.1.ckt b/tests/bm_table.3.1.ckt
index a04b6c2d..4b41db5c 100644
--- a/tests/bm_table.3.1.ckt
+++ b/tests/bm_table.3.1.ckt
@@ -13,4 +13,5 @@ r4 4 0 10k
.dc v1 -10 10 .5
.dc v1 1 1000 decade 5
.dc v1 16 68 4.5
+*>.status notime
.end
diff --git a/tests/bm_table.3.2.ckt b/tests/bm_table.3.2.ckt
index 365387fc..cb86c2b9 100644
--- a/tests/bm_table.3.2.ckt
+++ b/tests/bm_table.3.2.ckt
@@ -13,4 +13,5 @@ r4 4 0 10k
.dc v1 -10 10 .5
.dc v1 1 1000 decade 5
.dc v1 16 68 4.5
+*>.status notime
.end
diff --git a/tests/bm_table.3.3.ckt b/tests/bm_table.3.3.ckt
index 19ec2d73..cf4ed3b2 100644
--- a/tests/bm_table.3.3.ckt
+++ b/tests/bm_table.3.3.ckt
@@ -4,4 +4,5 @@ v1 1 0 t1
+ order=3 below=0 above=0
.print tran v(nodes)
.tran 0 10n .1n trace all
+*>.status notime
.end
diff --git a/tests/bm_tanh.1.ckt b/tests/bm_tanh.1.ckt
index e9bdc83d..22db95c2 100644
--- a/tests/bm_tanh.1.ckt
+++ b/tests/bm_tanh.1.ckt
@@ -14,4 +14,5 @@ e3 4 0 1 0 tanh 4 3
.dc 1000
.ac
.list
+*>.status notime
.end
diff --git a/tests/bm_tanh.2.ckt b/tests/bm_tanh.2.ckt
index 1ec472fa..dca7fafd 100644
--- a/tests/bm_tanh.2.ckt
+++ b/tests/bm_tanh.2.ckt
@@ -18,4 +18,5 @@ E1 2 0 1 0 TANH gain= 100. limit= 0.01
.dc v1 -100k 100k 10k
.dc v1 -1000k 1000k 100k
.dc v1 -10000k 10000k 1000k
+*>.status notime
.end
diff --git a/tests/bmm_res.4.ckt b/tests/bmm_res.4.ckt
index 20bb4f72..1a5d0f82 100644
--- a/tests/bmm_res.4.ckt
+++ b/tests/bmm_res.4.ckt
@@ -3,9 +3,10 @@ v1 1 0 dc 2 ac 5
r1 1 2 1k
r2 2 0 t1 (w=2u l=1u)
.model t1 r rsh=1k narrow=1u
-.print op v(nodes) r(r*)
+.print op v(nodes) r(r*) iter(0)
.print ac v(nodes)
.op
.ac
.list
+.status notime
.end
diff --git a/tests/bmm_res.4p.ckt b/tests/bmm_res.4p.ckt
index 1df9b963..c488811c 100644
--- a/tests/bmm_res.4p.ckt
+++ b/tests/bmm_res.4p.ckt
@@ -4,9 +4,10 @@ v1 1 0 dc 2 ac 5
r1 1 2 1k
r2 2 0 t1 (w=pw l=pl)
.model t1 r rsh=1k narrow=1u
-.print op v(nodes) r(r*)
+.print op v(nodes) r(r*) iter(0)
.print ac v(nodes)
.op
.ac
.list
+.status notime
.end
diff --git a/tests/c_eval.2.ckt b/tests/c_eval.2.ckt
new file mode 100644
index 00000000..ce126416
--- /dev/null
+++ b/tests/c_eval.2.ckt
@@ -0,0 +1,10 @@
+* unknown parameter check
+.options trace
+.param x='3+a+1+1+exp(b-17)-3'
+.param a = sqrt(b)
+.eval x
+.eval 3+a+1+1+exp(b-17)-3
+.param a={2+b}
+.eval x
+.eval 3+a+1+1
+.end
diff --git a/tests/c_eval.3.ckt b/tests/c_eval.3.ckt
new file mode 100644
index 00000000..888952d5
--- /dev/null
+++ b/tests/c_eval.3.ckt
@@ -0,0 +1,17 @@
+* unknown parameter check
+.param x='max(a,2)'
+.param y='min(a,2)'
+.eval x
+.eval y
+.param zz
+.param z=zz+3
+.eval z
+.eval max(a,2)
+.eval min(a,2)
+.eval min(exp(-1),exp(-2))
+.eval min(exp(a),exp(b))
+.param a=2
+.eval x
+.eval max(a,2)
+.eval min(exp(a),exp(b+a))
+.end
diff --git a/tests/c_eval.error.0.ckt b/tests/c_eval.error.0.ckt
new file mode 100644
index 00000000..b5df2f99
--- /dev/null
+++ b/tests/c_eval.error.0.ckt
@@ -0,0 +1,8 @@
+* unknown parameter check
+.param zz=zz
+.param a=1
+.param z=zz+3
+.eval z
+.eval z
+.eval z
+.eval a
diff --git a/tests/d_bjt-diffpair-dc.ckt b/tests/d_bjt-diffpair-dc.ckt
index 3c5ea58d..47955961 100644
--- a/tests/d_bjt-diffpair-dc.ckt
+++ b/tests/d_bjt-diffpair-dc.ckt
@@ -76,4 +76,5 @@ rbias 7 8 20k
*>.op
*>.print op p(v*)
.op
+*>.status notime
.end
diff --git a/tests/d_ccvs.1.ckt b/tests/d_ccvs.1.ckt
index f962ed6c..a98ab1cd 100644
--- a/tests/d_ccvs.1.ckt
+++ b/tests/d_ccvs.1.ckt
@@ -37,4 +37,5 @@ rh7 20 0 10
.tran 0 .1 .05
.print ac v(nodes) i(v7)
.ac 1k
+*>.status notime
.end
diff --git a/tests/d_ccvs.2.ckt b/tests/d_ccvs.2.ckt
index 35e0215d..0f330adf 100644
--- a/tests/d_ccvs.2.ckt
+++ b/tests/d_ccvs.2.ckt
@@ -53,4 +53,5 @@ rh8 22 0 10
.tran 0 .1 .05
.print ac v(nodes) i(v7) i(v8)
.ac 1k
+*>.status notime
.end
diff --git a/tests/d_diode.2.ckt b/tests/d_diode.2.ckt
index f68f345e..b1c0ebf7 100644
--- a/tests/d_diode.2.ckt
+++ b/tests/d_diode.2.ckt
@@ -6,4 +6,5 @@ D1 2 0 ddd 1.
+ eg= 1.11 xti= 3. kf= 0. af= 1. fc= 0.5 )
.print op v(1 2)
.op
+*>.status notime
.end
diff --git a/tests/d_logic.01.critclock.gc b/tests/d_logic.01.critclock.gc
index 4e1fb6dd..0c4c5c8b 100644
--- a/tests/d_logic.01.critclock.gc
+++ b/tests/d_logic.01.critclock.gc
@@ -2,7 +2,7 @@ spice
Vdd 8 0 dc 5.
V1 1 0 pulse iv=0 pv=5 rise=1n width=1n fall=1n period=5n
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 2n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
diff --git a/tests/d_logic.01.overclock.gc b/tests/d_logic.01.overclock.gc
index bf80a524..07ea6cf0 100644
--- a/tests/d_logic.01.overclock.gc
+++ b/tests/d_logic.01.overclock.gc
@@ -2,7 +2,7 @@ spice
Vdd 8 0 dc 5.
V1 1 0 pulse iv=0 pv=5 rise=1n width=1n fall=1n period=5n
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 3n rise= 2n fall= 2n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
diff --git a/tests/d_logic.01.underclock.gc b/tests/d_logic.01.underclock.gc
index 2fff96bb..89e832f9 100644
--- a/tests/d_logic.01.underclock.gc
+++ b/tests/d_logic.01.underclock.gc
@@ -2,7 +2,7 @@ spice
Vdd 8 0 dc 5.
V1 1 0 pulse iv=0 pv=5 rise=10n width=10n fall=10n period=50n
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 2n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
diff --git a/tests/d_logic.02.critclock.gc b/tests/d_logic.02.critclock.gc
index 60fb4d76..08694c14 100644
--- a/tests/d_logic.02.critclock.gc
+++ b/tests/d_logic.02.critclock.gc
@@ -2,7 +2,7 @@ spice
Vdd 8 0 dc 5.
V1 1 0 pulse iv=0 pv=5 rise=1n width=1n fall=1n period=5n
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 2n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
diff --git a/tests/d_logic.02.overclock.gc b/tests/d_logic.02.overclock.gc
index 9b0fb771..679230b8 100644
--- a/tests/d_logic.02.overclock.gc
+++ b/tests/d_logic.02.overclock.gc
@@ -2,7 +2,7 @@ spice
Vdd 8 0 dc 5.
V1 1 0 pulse iv=0 pv=5 rise=1n width=1n fall=1n period=5n
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 3n rise= 2n fall= 2n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
diff --git a/tests/d_logic.02.underclock.gc b/tests/d_logic.02.underclock.gc
index bc5ab4c7..1ba983f0 100644
--- a/tests/d_logic.02.underclock.gc
+++ b/tests/d_logic.02.underclock.gc
@@ -2,7 +2,7 @@ spice
Vdd 8 0 dc 5.
V1 1 0 pulse iv=0 pv=5 rise=10n width=10n fall=10n period=50n
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 2n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
diff --git a/tests/d_logic.1.ckt b/tests/d_logic.1.ckt
index a1314aa8..7ce67b02 100644
--- a/tests/d_logic.1.ckt
+++ b/tests/d_logic.1.ckt
@@ -2,16 +2,17 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
-U4 4 0 8 8 3 mos inv
-U5 5 0 8 8 4 mos inv
-U6 6 0 8 8 5 mos inv
-U7 7 0 8 8 6 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+U6 6 5 mos inv
+U7 7 6 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic.1.gc b/tests/d_logic.1.gc
index 7c0819e4..1ea8a272 100644
--- a/tests/d_logic.1.gc
+++ b/tests/d_logic.1.gc
@@ -1,21 +1,39 @@
-verilog
-
-// does not work yet. logic "model" is inaccessible from verilog
-// paramset must support COMPONENTS...
-paramset mos logic;
- .delay= 1n;
- .rise= 1n;
- .fall= 1n;
- .rs= 100.;
- .rw= 1.G ;
- .thh= 0.75;
- .thl= 0.25;
- .mr= 5.;
- .mf= 5.;
- .over=10k;
- .vmax= 5.;
- .vmin= 0.;
-endparamset
-
-list
-end
+//'6 inverters as gates
+spice
+.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
++ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
+.gen freq=1 offset=2.5 init=2.5 ampl=2.5
+Vdd 8 0 dc 5.
+V1 1 0 generator( 1. )
+.verilog
+inv #(.model(mos)) U2 (2 1);
+inv #(.model(mos)) U3 (3 2);
+inv #(.model(mos)) U4 (4 3);
+inv #(.model(mos)) U5 (5 4);
+inv #(.model(mos)) U6 (6 5);
+inv #(.model(mos)) U7 (7 6);
+spice
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.ends
+*+ends mosinv1
+.model nmos nmos ( level=2 vto= 0. gamma= 0. phi= 0.6 is= 10.E-15 pb= 0.8
++ cgso= 0. cgdo= 0. cgbo= 0. rsh= 0. cj= 0. mj= 0.5 cjsw= 0. mjsw= 0.33
++ tox= 100.n nfs= 0. tpg=1 ld= 0. uo= 600. neff= 1. fc= 0.5 delta= 0.
++)
+*+(* vfb=-0.6 * kp= 20.71886u )
+.model pmos pmos ( level=2 vto= 0. gamma= 0. phi= 0.6 is= 10.E-15 pb= 0.8
++ cgso= 0. cgdo= 0. cgbo= 0. rsh= 0. cj= 0. mj= 0.5 cjsw= 0. mjsw= 0.33
++ tox= 100.n nfs= 0. tpg=1 ld= 0. uo= 600. neff= 1. fc= 0.5 delta= 0.
++)
+*+(* vfb=-0.6 * kp= 20.71886u )
+.option mode=mixed vmax=5.1 vmin=-.1
+.print op v(1 2 3 4 5 6 7 8) logic(1 2 3 4 5 6 7 8)
+.op
+'.option trace
+'.print tran v(nodes) l(nodes)
+'.tran 0 10 .05
+.stat notime
+.end
diff --git a/tests/d_logic.2.ckt b/tests/d_logic.2.ckt
index 8774d9cd..343c1d59 100644
--- a/tests/d_logic.2.ckt
+++ b/tests/d_logic.2.ckt
@@ -2,16 +2,17 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
-U4 4 0 8 8 3 mos inv
-U5 5 0 8 8 4 mos inv
-U6 6 0 8 8 5 mos inv
-U7 7 0 8 8 6 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+U6 6 5 mos inv
+U7 7 6 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic.2.gc b/tests/d_logic.2.gc
new file mode 100644
index 00000000..5b1383b5
--- /dev/null
+++ b/tests/d_logic.2.gc
@@ -0,0 +1,42 @@
+//'6 inverters as gates
+spice
+.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
++ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
+.gen freq=1 offset=2.5 init=2.5 ampl=2.5
+Vdd 8 0 dc 5.
+V1 1 0 generator( 1. )
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+.verilog
+inv #(.model(mos)) U6 (6 5);
+inv #(.model(mos)) U7 (7 6);
+spice
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.ends
+*+ends mosinv1
+.model nmos nmos ( level=2 vto= 0. gamma= 0. phi= 0.6 is= 10.E-15 pb= 0.8
++ cgso= 0. cgdo= 0. cgbo= 0. rsh= 0. cj= 0. mj= 0.5 cjsw= 0. mjsw= 0.33
++ tox= 100.n nfs= 0. tpg=1 ld= 0. uo= 600. neff= 1. fc= 0.5 delta= 0.
++)
+*+(* vfb=-0.6 * kp= 20.71886u )
+.model pmos pmos ( level=2 vto= 0. gamma= 0. phi= 0.6 is= 10.E-15 pb= 0.8
++ cgso= 0. cgdo= 0. cgbo= 0. rsh= 0. cj= 0. mj= 0.5 cjsw= 0. mjsw= 0.33
++ tox= 100.n nfs= 0. tpg=1 ld= 0. uo= 600. neff= 1. fc= 0.5 delta= 0.
++)
+*+(* vfb=-0.6 * kp= 20.71886u )
+.option mode=mixed vmax=5.1 vmin=-.1
+.print op v(1 2 3 4 5 6 7 8) logic(1 2 3 4 5 6 7 8)
+.op
+'.option trace
+'.print tran v(nodes) l(nodes)
+'.tran 0 10 .05
+.stat notime
+.list
+.verilog
+list
+.end
diff --git a/tests/d_logic.3.ckt b/tests/d_logic.3.ckt
index 76e967b0..b0641636 100644
--- a/tests/d_logic.3.ckt
+++ b/tests/d_logic.3.ckt
@@ -2,16 +2,17 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
-U4 4 0 8 8 3 mos inv
-U5 5 0 8 8 4 mos inv
-U6 6 0 8 8 5 mos inv
-U7 7 0 8 8 6 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+U6 6 5 mos inv
+U7 7 6 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic.4.ckt b/tests/d_logic.4.ckt
index ec3a29e1..8fc777f5 100644
--- a/tests/d_logic.4.ckt
+++ b/tests/d_logic.4.ckt
@@ -2,12 +2,12 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
-U4 4 0 8 8 3 mos inv
-U5 5 0 8 8 4 mos inv
-U6 6 0 8 8 5 mos inv
-U7 7 0 8 8 6 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+U6 6 5 mos inv
+U7 7 6 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
.option mode=mixed vmax=5.1 vmin=-.1
diff --git a/tests/d_logic.5.ckt b/tests/d_logic.5.ckt
index 836a6643..ea595c46 100644
--- a/tests/d_logic.5.ckt
+++ b/tests/d_logic.5.ckt
@@ -2,12 +2,12 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
-U4 4 0 8 8 3 mos inv
-U5 5 0 8 8 4 mos inv
-U6 6 0 8 8 5 mos inv
-U7 7 0 8 8 6 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+U6 6 5 mos inv
+U7 7 6 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
.option mode=analog vmax=5.1 vmin=-.1
diff --git a/tests/d_logic.6.ckt b/tests/d_logic.6.ckt
index 82d2d44c..96759542 100644
--- a/tests/d_logic.6.ckt
+++ b/tests/d_logic.6.ckt
@@ -2,12 +2,12 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
-U4 4 0 8 8 3 mos inv
-U5 5 0 8 8 4 mos inv
-U6 6 0 8 8 5 mos inv
-U7 7 0 8 8 6 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
+U4 4 3 mos inv
+U5 5 4 mos inv
+U6 6 5 mos inv
+U7 7 6 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
.option mode=digital vmax=5.1 vmin=-.1
diff --git a/tests/d_logic.7.ckt b/tests/d_logic.7.ckt
index 8a268743..75dae166 100644
--- a/tests/d_logic.7.ckt
+++ b/tests/d_logic.7.ckt
@@ -2,12 +2,12 @@
.gen freq=1 offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U7 7 0 8 8 6 mos inv
-U6 6 0 8 8 5 mos inv
-U5 5 0 8 8 4 mos inv
-U4 4 0 8 8 3 mos inv
-U3 3 0 8 8 2 mos inv
-U2 2 0 8 8 1 mos inv
+U7 7 6 mos inv
+U6 6 5 mos inv
+U5 5 4 mos inv
+U4 4 3 mos inv
+U3 3 2 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 5. mf= 5. over=10k vmax= 5. vmin= 0. )
.option mode=digital vmax=5.1 vmin=-.1
diff --git a/tests/d_logic.evt.0.gc b/tests/d_logic.evt.0.gc
index 49a55ae7..2fc048a2 100644
--- a/tests/d_logic.evt.0.gc
+++ b/tests/d_logic.evt.0.gc
@@ -4,7 +4,7 @@ spice
.model mos logic
.model cross sw vt=2.5 vh=1.25
-U1 2 0 0 0 1 mos inv
+U1 2 1 mos inv
V1 1 0 pulse iv=0 pv=5 delay=0 rise=500p
S1 0 0 1 0 cross
diff --git a/tests/d_logic.evt.1.gc b/tests/d_logic.evt.1.gc
index aab86c7c..85b50779 100644
--- a/tests/d_logic.evt.1.gc
+++ b/tests/d_logic.evt.1.gc
@@ -5,8 +5,8 @@ spice
.model mos logic
.model cross sw vt=2.5 vh=1.25
-U1 3 0 0 0 1 2 mos nor
-* U1 3 0 0 0 1 mos inv
+U1 3 1 2 mos nor
+* U1 3 1 mos inv
V1 1 0 pulse iv=0 pv=5 delay=0 rise=500p
V2 2 0 pulse iv=0 pv=5 delay=300p rise=500p
S1 0 0 1 0 cross
diff --git a/tests/d_logic_nand-dc.ckt b/tests/d_logic_nand-dc.ckt
index 04464337..ef007636 100644
--- a/tests/d_logic_nand-dc.ckt
+++ b/tests/d_logic_nand-dc.ckt
@@ -1,10 +1,11 @@
* nor-test
V2 1 0 10V
V1 4 0 10V
-U2 2 0 4 4 3 5 CMOS NOR
+U2 2 3 5 CMOS NOR
V3 5 0 10V
-U1 3 0 4 4 1 2 CMOS NOR
+U1 3 1 2 CMOS NOR
.model CMOS LOGIC
.print dc V(V2) V(V3) V(U1) V(U2) logic(u*)
.dc V2 0 10 2
+.status notime
.END
diff --git a/tests/d_logic_tr_ab1.ckt b/tests/d_logic_tr_ab1.ckt
index 9ae4dce1..af51491a 100644
--- a/tests/d_logic_tr_ab1.ckt
+++ b/tests/d_logic_tr_ab1.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 1n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_ab2.ckt b/tests/d_logic_tr_ab2.ckt
index 36eba5dc..e44e376a 100644
--- a/tests/d_logic_tr_ab2.ckt
+++ b/tests/d_logic_tr_ab2.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 1n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_an1.ckt b/tests/d_logic_tr_an1.ckt
index 6a74a6e9..a9135ab1 100644
--- a/tests/d_logic_tr_an1.ckt
+++ b/tests/d_logic_tr_an1.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 1n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_an2.ckt b/tests/d_logic_tr_an2.ckt
index ce6f7877..a30c475a 100644
--- a/tests/d_logic_tr_an2.ckt
+++ b/tests/d_logic_tr_an2.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 1n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_db1.ckt b/tests/d_logic_tr_db1.ckt
index a20ba51e..18581c5e 100644
--- a/tests/d_logic_tr_db1.ckt
+++ b/tests/d_logic_tr_db1.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_db2.ckt b/tests/d_logic_tr_db2.ckt
index aba50257..d966a613 100644
--- a/tests/d_logic_tr_db2.ckt
+++ b/tests/d_logic_tr_db2.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_dn1.ckt b/tests/d_logic_tr_dn1.ckt
index 98c07390..f9e7f74c 100644
--- a/tests/d_logic_tr_dn1.ckt
+++ b/tests/d_logic_tr_dn1.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_dn2.ckt b/tests/d_logic_tr_dn2.ckt
index 1437c416..5d75706c 100644
--- a/tests/d_logic_tr_dn2.ckt
+++ b/tests/d_logic_tr_dn2.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mb1a.ckt b/tests/d_logic_tr_mb1a.ckt
index 4bb9d102..fbabb1cf 100644
--- a/tests/d_logic_tr_mb1a.ckt
+++ b/tests/d_logic_tr_mb1a.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.6 thl= 0.4 mr= 200000. mf= 200000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mb1b.ckt b/tests/d_logic_tr_mb1b.ckt
index 1dafa2fa..521a64ef 100644
--- a/tests/d_logic_tr_mb1b.ckt
+++ b/tests/d_logic_tr_mb1b.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mb2a.ckt b/tests/d_logic_tr_mb2a.ckt
index 9059fa43..9062ba0d 100644
--- a/tests/d_logic_tr_mb2a.ckt
+++ b/tests/d_logic_tr_mb2a.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.6 thl= 0.4 mr= 200000. mf= 200000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mb2b.ckt b/tests/d_logic_tr_mb2b.ckt
index 7440837e..8a8d7254 100644
--- a/tests/d_logic_tr_mb2b.ckt
+++ b/tests/d_logic_tr_mb2b.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mn1a.ckt b/tests/d_logic_tr_mn1a.ckt
index 03c64fd6..413f48e1 100644
--- a/tests/d_logic_tr_mn1a.ckt
+++ b/tests/d_logic_tr_mn1a.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.6 thl= 0.4 mr= 200000. mf= 200000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mn1b.ckt b/tests/d_logic_tr_mn1b.ckt
index e1120c31..873e0377 100644
--- a/tests/d_logic_tr_mn1b.ckt
+++ b/tests/d_logic_tr_mn1b.ckt
@@ -2,11 +2,12 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
+U2 2 1 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mn2a.ckt b/tests/d_logic_tr_mn2a.ckt
index 2865087a..feae438a 100644
--- a/tests/d_logic_tr_mn2a.ckt
+++ b/tests/d_logic_tr_mn2a.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.6 thl= 0.4 mr= 200000. mf= 200000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_logic_tr_mn2b.ckt b/tests/d_logic_tr_mn2b.ckt
index 8aa59cb4..07a102b5 100644
--- a/tests/d_logic_tr_mn2b.ckt
+++ b/tests/d_logic_tr_mn2b.ckt
@@ -2,12 +2,13 @@
.gen freq=1k offset=2.5 init=2.5 ampl=2.5
Vdd 8 0 dc 5.
V1 1 0 generator( 1. )
-U2 2 0 8 8 1 mos inv
-U3 3 0 8 8 2 mos inv
+U2 2 1 mos inv
+U3 3 2 mos inv
.model mos logic ( delay= 100n rise= 100n fall= 100n rs= 100. rw= 1.G
+ thh= 0.75 thl= 0.25 mr= 2000. mf= 2000. over=10k vmax= 5. vmin= 0. )
-.subckt mosinv1 2 4 1 5 3
-M1 2 3 4 4 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
+.subckt mosinv1 2 3
+Vdd 1 0 dc 5.
+M1 2 3 0 0 nmos l= 100.u w= 100.u nrd= 1. nrs= 1.
M2 2 3 1 1 pmos l= 100.u w= 100.u nrd= 1. nrs= 1.
.ends
*+ends mosinv1
diff --git a/tests/d_res.1a.gc b/tests/d_res.1a.gc
new file mode 100644
index 00000000..ba64939e
--- /dev/null
+++ b/tests/d_res.1a.gc
@@ -0,0 +1,18 @@
+spice
+
+.param r=0
+
+* bug: r2 has a common, r1 doesn't
+r1 1 0 {r}
+r2 1 2 r
+
+r0 3 2 1m
+v1 3 0 1
+
+.print dc v(nodes)
+.dc trace=i
+.print dc v(nodes) y(r*)
+.dc trace=i
+
+.status notime
+.end
diff --git a/tests/d_res.1b.gc b/tests/d_res.1b.gc
new file mode 100644
index 00000000..9bb723b5
--- /dev/null
+++ b/tests/d_res.1b.gc
@@ -0,0 +1,17 @@
+spice
+
+.param r=0
+
+r1 1 0 r
+r2 1 2 r
+
+r0 2 3 1m
+v1 3 0 1
+
+.print dc v(nodes)
+.dc trace=i
+.print dc v(nodes) y(r*)
+.dc trace=i
+
+.status notime
+.end
diff --git a/tests/d_res.1c.gc b/tests/d_res.1c.gc
new file mode 100644
index 00000000..faff2509
--- /dev/null
+++ b/tests/d_res.1c.gc
@@ -0,0 +1,17 @@
+spice
+
+.param r=0
+
+r1 1 0 {r}
+r2 1 2 {r}
+
+r0 3 2 1m
+v1 3 0 1
+
+.print dc v(nodes)
+.dc trace=i
+.print dc v(nodes) y(r*)
+.dc trace=i
+
+.status notime
+.end
diff --git a/tests/d_res.bug.0.gc b/tests/d_res.bug.0.gc
new file mode 100644
index 00000000..ecdce477
--- /dev/null
+++ b/tests/d_res.bug.0.gc
@@ -0,0 +1,17 @@
+spice
+
+r1 1 0 r
+r2 1 2 {1-r}
+v1 2 0 v
+
+.param r=.5
+.param v=1
+
+.list
+
+.print dc v(nodes) y(r*)
+
+.dc r2 1e-19 1 .1 trace=n
+
+.status notime
+.end
diff --git a/tests/d_res.bug.2.ckt b/tests/d_res.bug.2.ckt
new file mode 100644
index 00000000..50d119a4
--- /dev/null
+++ b/tests/d_res.bug.2.ckt
@@ -0,0 +1,11 @@
+nonlinear res test
+
+V1 1 0 1.
+R1 1 0 PWL 0.1,0 1,1 10,2 100,3
++ 1000,4 10000,5 100000,6 1000000,7
++ 10000000,8 100000000,9 1000000000,10
+
+.options nopicky
+.print dc i(R1) vin(r1) i(v1) iter(0) f(R1) df(R1) in(R1) iof(R1)
+.dc v1 0 10 1 loop trace n basic
+.stat notime
diff --git a/tests/d_res.bug.2fit.ckt b/tests/d_res.bug.2fit.ckt
new file mode 100644
index 00000000..f9b8f148
--- /dev/null
+++ b/tests/d_res.bug.2fit.ckt
@@ -0,0 +1,12 @@
+nonlinear res test
+
+V1 1 0 1.
+R1 1 0 FIT 0.1,0 1,1 10,2 100,3
++ 1000,4 10000,5 100000,6 1000000,7
++ 10000000,8 100000000,9 1000000000,10 order=2
+
+.options nopicky
+.options short 1e-5
+.print dc i(R1) vin(r1) i(v1) iter(0) f(R1) df(R1) in(R1) iof(R1)
+.dc v1 0 10 1 trace n loop
+.stat notime
diff --git a/tests/d_res.neg.0.ckt b/tests/d_res.neg.0.ckt
new file mode 100644
index 00000000..40588eb3
--- /dev/null
+++ b/tests/d_res.neg.0.ckt
@@ -0,0 +1,35 @@
+nonlinear res test
+
+V1 1 0 1.
+R1 1 0 PWL
++-102400,-1.1
++ -51200,-1.0
++ -25600, -.9
++ -12800, -.8
++ -6400, -.7
++ -3200, -.6
++ -1600, -.5
++ -800, -.4
++ -400, -.3
++ -200, -.2
++ -100, -.1
++ -.500, -.05
++ 0, .0
++ .500, .05
++ 100, .1
++ 200, .2
++ 400, .3
++ 800, .4
++ 1600, .5
++ 3200, .6
++ 6400, .7
++ 12800, .8
++ 25600, .9
++ 51200, 1.0
++102400, 1.1
+
+*.options nopicky
+.options short 1e-5
+.print dc i(R1) vin(r1) i(v1) iter(0) f(R1) df(R1) in(R1) iof(R1)
+.dc v1 -1 1 0.1 loop trace n basic > res.out
+.stat notime
diff --git a/tests/d_res.restore.0.gc b/tests/d_res.restore.0.gc
new file mode 100644
index 00000000..005dcf95
--- /dev/null
+++ b/tests/d_res.restore.0.gc
@@ -0,0 +1,16 @@
+spice
+
+.param r=1
+
+v1 1 0 sin amplitude=1 frequency=1
+r1 1 0 r
+r2 1 0 {r}
+
+.print tran v(1)
+.tran 1.1 trace=n
+
+.print tran eiv(r*) v(1)
+.tran 2 trace=a
+
+.status notime
+.end
diff --git a/tests/d_res.short.0.gc b/tests/d_res.short.0.gc
new file mode 100644
index 00000000..95bf7a04
--- /dev/null
+++ b/tests/d_res.short.0.gc
@@ -0,0 +1,16 @@
+spice
+
+.param r=0
+
+r1 1 0 {r}
+r2 1 0 r
+r3 1 0 0
+v1 1 0 1
+
+.tran 0.9 trace=i
+
+.print tran y(r*)
+.tran 1 trace=i
+
+.status notime
+.end
diff --git a/tests/d_res.short.1.gc b/tests/d_res.short.1.gc
new file mode 100644
index 00000000..0ac0509d
--- /dev/null
+++ b/tests/d_res.short.1.gc
@@ -0,0 +1,15 @@
+spice
+
+.param r=1e-7
+r1 1 0 {r}
+r2 1 0 r
+r3 1 0 1e-7
+v1 1 0 1
+
+.tran 0.9 trace=i
+
+.print tran y(r*)
+.tran 1 trace=i
+
+.status notime
+.end
diff --git a/tests/d_res.short.2.gc b/tests/d_res.short.2.gc
new file mode 100644
index 00000000..bd83d6d8
--- /dev/null
+++ b/tests/d_res.short.2.gc
@@ -0,0 +1,16 @@
+spice
+
+.param r=0
+r1 1 2 {1-r}
+r2 1 0 r
+v1 2 0 1
+
+.print dc v(nodes)
+.dc r 0 1 .5
+.dc r 1 0 -.5
+
+.print dc v(nodes) y(r*) iter(0)
+.dc r 0 1 .5 loop
+
+.status notime
+.end
diff --git a/tests/d_vcvs.1.ckt b/tests/d_vcvs.1.ckt
index 2548eff9..3e6d23d9 100644
--- a/tests/d_vcvs.1.ckt
+++ b/tests/d_vcvs.1.ckt
@@ -19,4 +19,5 @@ r3 4 0 1k
.ac 1k
.print ac vo(v1) vin(v1) i(v1) p(v1) pd(v1) ps(v1)
.ac 1k
+*>.status notime
.end
diff --git a/tests/d_vcvs.2.ckt b/tests/d_vcvs.2.ckt
index df5b749b..d7b9e329 100644
--- a/tests/d_vcvs.2.ckt
+++ b/tests/d_vcvs.2.ckt
@@ -19,4 +19,5 @@ r3 0 4 1k
.ac 1k
.print ac vo(v1) vin(v1) i(v1) p(v1) pd(v1) ps(v1)
.ac 1k
+*>.status notime
.end
diff --git a/tests/dc_temp.gc b/tests/dc_temp.gc
index b36fac1d..c07c337f 100644
--- a/tests/dc_temp.gc
+++ b/tests/dc_temp.gc
@@ -30,4 +30,5 @@ rtemp3 2 0 t2 (.5)
.measure rt2 at(probe="r(rtemp2)")
.measure rt3 at(probe="r(rtemp3)")
+.status notime
.end
diff --git a/tests/insensitive.0.gc b/tests/insensitive.0.gc
new file mode 100644
index 00000000..c5a461d1
--- /dev/null
+++ b/tests/insensitive.0.gc
@@ -0,0 +1,20 @@
+verilog
+
+module aaa(1 2);
+vsource #(0) vs(1 2)
+endmodule
+
+module AAA(1 2);
+vsource #(1) vs(1 2)
+endmodule
+
+module bbb(1 2);
+AAA vs(1 2)
+endmodule
+
+bbb b(1 0)
+
+list
+
+print dc v(nodes)
+dc
diff --git a/tests/m_expr.array.0.gc b/tests/m_expr.array.0.gc
new file mode 100644
index 00000000..e222de95
--- /dev/null
+++ b/tests/m_expr.array.0.gc
@@ -0,0 +1,12 @@
+
+param a=1.
+param y=1.
+param b={ '{1,2,a} }
+eval b
+param c={ '{exp(1),2,exp(a)} }
+eval c
+param
+param d=" '{1,2,a, '{exp(a),y,exp(z)}, 0. } "
+eval d
+param e=" '{1,2,b, '{b,b}, 0. } "
+eval e
diff --git a/tests/m_expr.error.0.gc b/tests/m_expr.error.0.gc
new file mode 100644
index 00000000..df761509
--- /dev/null
+++ b/tests/m_expr.error.0.gc
@@ -0,0 +1,3 @@
+option list
+param a3={<test + stuff}
+eval a3
diff --git a/tests/m_expr.error.0a.gc b/tests/m_expr.error.0a.gc
new file mode 100644
index 00000000..d368fd23
--- /dev/null
+++ b/tests/m_expr.error.0a.gc
@@ -0,0 +1,10 @@
+option list
+param a3={<test>}
+
+verilog
+capacitor #(a3) r1(1,0);
+capacitor #(.c(<aaa>)) r1(1,0);
+capacitor #(" <test> + 4 ") r1(1,0);
+
+list
+dc
diff --git a/tests/m_expression.0.gc b/tests/m_expression.0.gc
new file mode 100644
index 00000000..5301a966
--- /dev/null
+++ b/tests/m_expression.0.gc
@@ -0,0 +1,33 @@
+option list
+eval "string"
+param a="aaa"
+eval a
+param b={"aaa" + "bbb"}
+eval b
+param c={"aaa" == "bbb"}
+eval c
+param d={"aaa" == a}
+eval d
+param e={exp("0.")}
+eval e
+param f={exp(1.+"0.")}
+eval f
+param g={exp("aaa" == 0.)}
+eval g
+param h={exp(0. == "aaa")}
+eval h
+param i={exp(a == "aaa")}
+eval i
+param j={exp(0. != 0.)}
+eval j
+param k={"aaa bbb"}
+eval k
+* //BUG// does not work with spice get_line
+param l={"aaa\"bbb"}
+eval l
+* //BUG// totally does not work with spice get_line
+* param m=exp("aaa\"bbb")
+* eval m
+options nag
+param n={"missing quote}
+eval n
diff --git a/tests/m_expression.1.gc b/tests/m_expression.1.gc
new file mode 100644
index 00000000..a09807af
--- /dev/null
+++ b/tests/m_expression.1.gc
@@ -0,0 +1,33 @@
+option list
+param a={1?2:3}
+eval a
+param b={0?2:3}
+eval b
+param c={x?2:3}
+eval c
+param d={exp(4)?2:3}
+eval d
+param e={1-1?2:3}
+eval e
+param f={(exp(0)-1)?2:3}
+eval f
+param g={(exp(0)>0)?2:3}
+eval g
+param h={(exp(0)>=1)?2:3*0}
+eval h
+param i={(1)?1:0&&0}
+eval i
+param j={(1)?0:0||1}
+eval j
+param k={(0?0:0)||1}
+eval k
+param l={0?0:(0||1)}
+eval l
+param m={0?1:1+0?2:3}
+eval m
+param n={(xx==0)?1/2:1/3}
+eval n
+param o={ (QEpercent != 0) ? QEpercent*Lambda/1.2398e5:Responsivity }
+eval o
+param p={0?1:1+0?2}
+eval p
diff --git a/tests/m_expression.2.gc b/tests/m_expression.2.gc
new file mode 100644
index 00000000..45db21d7
--- /dev/null
+++ b/tests/m_expression.2.gc
@@ -0,0 +1,13 @@
+option list
+param a1={2%3}
+eval a1
+param a2={2%3+1}
+eval a2
+param a3={c+2%3+b}
+eval a3
+param a4={(c+2)%3+b}
+eval a4
+param a5={12*3%4*2.}
+eval a5
+param a6={exp(12*3%4*2.)}
+eval a6
diff --git a/tests/m_expression.3.gc b/tests/m_expression.3.gc
new file mode 100644
index 00000000..7cc8a475
--- /dev/null
+++ b/tests/m_expression.3.gc
@@ -0,0 +1,15 @@
+option list
+param a1=b[4]
+eval a1
+param a2="_[b]4"
+eval a2
+param a3="b]x]y]z]w"
+eval a3
+param a4=_]b[3
+eval a4
+param a5=_$b[3
+eval a5
+param a6=yy[[3]
+eval a6
+param a7=yy[3]]
+eval a7
diff --git a/tests/m_expression.4.gc b/tests/m_expression.4.gc
new file mode 100644
index 00000000..a9bb7084
--- /dev/null
+++ b/tests/m_expression.4.gc
@@ -0,0 +1,9 @@
+option list
+param a1={<test> + 2}
+eval a1
+param a2={test2# + stuff}
+eval a2
+param a3={<test2>bla + stuff}
+eval a3
+param a4={exp(<test2>) * 17.}
+eval a4
diff --git a/tests/m_expression.7.gc b/tests/m_expression.7.gc
new file mode 100644
index 00000000..58fbd71f
--- /dev/null
+++ b/tests/m_expression.7.gc
@@ -0,0 +1,12 @@
+option list
+param a2=ln(3)
+param a1=log(3)
+param a3=log10(3)
+param
+eval a1
+eval a2
+eval a3
+option debug
+eval a1
+eval a2
+eval a3
diff --git a/tests/param.8.ckt b/tests/param.8.ckt
index 97124044..b0a8ca50 100644
--- a/tests/param.8.ckt
+++ b/tests/param.8.ckt
@@ -4,6 +4,7 @@ r1 1 2 c
r2 2 0 d
.param a=1 b=2 c=3
.param
-.print op v(nodes)
+.print op v(nodes) iter(0)
.op
+.status notime
.end
diff --git a/tests/param.dollar.gc b/tests/param.dollar.gc
new file mode 100644
index 00000000..a86c0ce9
--- /dev/null
+++ b/tests/param.dollar.gc
@@ -0,0 +1,6 @@
+
+param dollar=dol$lar
+
+param
+
+eval dol$lar
diff --git a/tests/s_dc.admit.gc b/tests/s_dc.admit.gc
new file mode 100644
index 00000000..3fedc9e2
--- /dev/null
+++ b/tests/s_dc.admit.gc
@@ -0,0 +1,25 @@
+spice
+
+v1 1 0 v
+y1 0 1 {1/r}
+
+v2 2 0 v
+y2 0 2 {1/r}
+
+.param v=-1
+.param r=1
+
+.list
+
+.print dc i(v*)
+.dc r 1 2 1
+.dc y1 1 2 1
+
+.dc r 1 2 1
+.dc y1 1 2 1
+
+.print dc i(y*)
+.dc r 1 2 1
+.dc y1 1 2 1
+
+.end
diff --git a/tests/s_dc.bin1.ckt b/tests/s_dc.bin1.ckt
new file mode 100644
index 00000000..32ef4e96
--- /dev/null
+++ b/tests/s_dc.bin1.ckt
@@ -0,0 +1,13 @@
+bug, some models don't complain when parameters move out of range
+
+.model nmos.1 nmos level=1 vto=0.7 lmin=1e-6 lmax=2e-6
+
+Mn1 3 2 0 0 NMOS W=8e-6 L=L
+
+.parameter L=1e-6
+.dc
+.parameter L=5e-6
+.dc
+.dc L 1e-6 3e-6 1e-6
+
+.end
diff --git a/tests/s_dc.bug0.gc b/tests/s_dc.bug0.gc
new file mode 100644
index 00000000..b5973051
--- /dev/null
+++ b/tests/s_dc.bug0.gc
@@ -0,0 +1,19 @@
+spice
+
+v1 1 0 v
+r1 0 1 {1/g}
+
+.param v=-1
+.param g=1
+
+.list
+
+.print dc i(r1)
+.dc r1 1 2 1
+.dc v1 1 2 1
+
+.print dc i(v1)
+.dc r1 1 2 1
+.dc v1 1 2 1
+
+.end
diff --git a/tests/s_dc.cccs0.gc b/tests/s_dc.cccs0.gc
new file mode 100644
index 00000000..a38f84b8
--- /dev/null
+++ b/tests/s_dc.cccs0.gc
@@ -0,0 +1,16 @@
+verilog
+
+cccs #(ee) F1(out, 0, Vin);
+* F1 out 0 vin ee
+
+spice
+.options noinsensitive
+
+.param ee 3
+Rout out 0 1
+
+Vin in 0 1
+Rin in 0 1
+
+.print dc v(nodes)
+.dc ee 0 2 1
diff --git a/tests/s_dc.res0.gc b/tests/s_dc.res0.gc
new file mode 100644
index 00000000..e26d9550
--- /dev/null
+++ b/tests/s_dc.res0.gc
@@ -0,0 +1,21 @@
+spice
+
+r1 1 0 r
+i1 0 1 i
+v1 2 0 v
+
+.param r=1
+.param i=1
+.param v=1
+
+.list
+
+.print dc v(nodes)
+
+.dc
+.dc r1 1 2 1
+.dc i1 0 2 1
+.dc v1 0 2 1
+*
+.status notime
+.end
diff --git a/tests/s_dc.sqrt.0.gc b/tests/s_dc.sqrt.0.gc
new file mode 100644
index 00000000..9189f11c
--- /dev/null
+++ b/tests/s_dc.sqrt.0.gc
@@ -0,0 +1,13 @@
+spice
+
+v1 2 0 v
+
+.print dc v(nodes)
+.parameter s=1
+.parameter v=sqrt(s)
+
+.dc s 0 2 .5
+
+.status notime
+
+.end
diff --git a/tests/s_dc.sweep.1.gc b/tests/s_dc.sweep.1.gc
new file mode 100644
index 00000000..cb559870
--- /dev/null
+++ b/tests/s_dc.sweep.1.gc
@@ -0,0 +1,31 @@
+spice
+
+r1 1 0 r
+i1 0 1 i
+v1 2 0 v
+
+.param r=1
+.param i=1
+.param v=1
+
+.list
+
+.print dc v(nodes)
+
+.dc
+.dc r 1 2 1
+.dc i 1 3 1
+.dc v 0 2 1
+
+* same again. bt now devices have probes.
+.print op v(?1)
+.print dc v(?1)
+
+.op
+.dc r 1 2 1
+.dc i 1 3 1
+.dc v 0 2 1
+
+.status notime
+
+.end
diff --git a/tests/s_dc.sweep.2.gc b/tests/s_dc.sweep.2.gc
new file mode 100644
index 00000000..446fef41
--- /dev/null
+++ b/tests/s_dc.sweep.2.gc
@@ -0,0 +1,51 @@
+simulator language=verilog
+
+// qucs style component macros.
+
+module Idc(1 2);
+parameter I=1m
+isource #(.dc(I)) dev(2 1);
+endmodule
+
+module Vdc(p n);
+ parameter U=1m
+ parameter Temp
+ vsource #(.dc(U)) dev(p n);
+endmodule
+
+module R(p, n);
+ parameter R
+ parameter Temp=26.85
+ parameter Tnom=26.85
+ parameter Tc1=0
+ parameter Tc2=0
+
+ // local?
+ parameter dT={Temp-Tnom}
+
+ resistor #(.r(R * (1. + dT*(Tc1 + dT*Tc2)))) dev(p, n);
+endmodule // R
+
+Idc #(.I(ii)) i1(1 0)
+R #(.R(rr) r1(1 0)
+Vdc #(.U(vv)) v1(2 0)
+
+spice
+.options noinsensitive
+
+
+.param rr=1
+.param ii=1
+.param vv=1
+
+.list
+
+.print dc v(nodes)
+* i(i1.dev)
+
+.dc
+.dc rr 1 2 1
+.dc ii 0 2 1
+.dc vv 0 2 1
+
+.end
diff --git a/tests/s_dc.sweep.3.gc b/tests/s_dc.sweep.3.gc
new file mode 100644
index 00000000..45f450ea
--- /dev/null
+++ b/tests/s_dc.sweep.3.gc
@@ -0,0 +1,15 @@
+spice
+* parameter vs element sweep
+* (elements take precedence)
+
+v1 1 0 {2*v1}
+
+.param v1=1
+
+.list
+
+.print dc v(nodes)
+
+.dc v1 0 2 1
+
+.end
diff --git a/tests/s_dc.vcg0.gc b/tests/s_dc.vcg0.gc
new file mode 100644
index 00000000..05f31cbe
--- /dev/null
+++ b/tests/s_dc.vcg0.gc
@@ -0,0 +1,15 @@
+verilog
+
+vcg #(ee) vv(out, 0, in, 0);
+* F1 out 0 vin ee
+
+spice
+.options noinsensitive
+
+.param ee 3
+Iout 0 out 1
+
+Vin in 0 1
+
+.print dc v(nodes)
+.dc ee 1 3 1
diff --git a/tests/s_dc.vcvs0.gc b/tests/s_dc.vcvs0.gc
new file mode 100644
index 00000000..c572a875
--- /dev/null
+++ b/tests/s_dc.vcvs0.gc
@@ -0,0 +1,7 @@
+spice
+
+E1 out 0 in 0 3
+v1 in 0 1.5
+
+.print dc v(nodes)
+.dc E1 0 2 1
diff --git a/tests/s_dc.vcvs1.gc b/tests/s_dc.vcvs1.gc
new file mode 100644
index 00000000..6afdc404
--- /dev/null
+++ b/tests/s_dc.vcvs1.gc
@@ -0,0 +1,14 @@
+spice
+
+.param ee 3
+
+.subckt vcvs 1 2 3 4
+.param ee 3
+E1 1 2 3 4 ee
+.ends
+
+x1 out 0 in 0 vcvs ee=ee
+v1 in 0 1.5
+
+.print dc v(nodes)
+.dc ee 0 2 1
diff --git a/tests/s_dc.vs0.gc b/tests/s_dc.vs0.gc
new file mode 100644
index 00000000..4fabffa3
--- /dev/null
+++ b/tests/s_dc.vs0.gc
@@ -0,0 +1,15 @@
+spice
+
+.param ee 3
+
+.subckt vsrc 1 2
+.param ee 3
+v1 1 2 ee
+.ends
+
+x1 in 0 vsrc ee=ee
+
+r1 in 0 1
+
+.print dc i(r1)
+.dc ee 0 2 1
diff --git a/tests/s_dc.vs1.gc b/tests/s_dc.vs1.gc
new file mode 100644
index 00000000..bef8c638
--- /dev/null
+++ b/tests/s_dc.vs1.gc
@@ -0,0 +1,12 @@
+verilog
+
+param ee 3
+
+vsource #(ee) vv(in 0);
+
+spice
+
+r1 in 0 1
+
+.print dc i(r1)
+.dc ee 0 2 1
diff --git a/tests/s_dc_noprint.gc b/tests/s_dc_noprint.gc
new file mode 100644
index 00000000..ba472256
--- /dev/null
+++ b/tests/s_dc_noprint.gc
@@ -0,0 +1,6 @@
+verilog
+
+vsource #(1) v(30,0);
+list
+dc v 0 1 1
+status notime
diff --git a/tests/temp.1.gc b/tests/temp.1.gc
index 4fc442a7..26b55ec4 100644
--- a/tests/temp.1.gc
+++ b/tests/temp.1.gc
@@ -39,4 +39,5 @@ R1 1 0 TESTR(w=2, l=4)
.ac 1
.op
.ac 1
+.status notime
.end
diff --git a/tests/trcurve.ckt b/tests/trcurve.ckt
index 8c9e2118..1eedc53f 100644
--- a/tests/trcurve.ckt
+++ b/tests/trcurve.ckt
@@ -41,4 +41,5 @@ MPD 4 1 0 6 CMOSN L=3U W=3U AD=9P AS=9P PD=12U PS=12U
.DC VDD 0 5 .1 VIN 0 5 .5
.print DC V(1) V(6) I(VPU) I(VPD) id(MPU) id(MPD)
.DC VIN 0 5 .5 VBACK 0 5 1
+*>.status notime
.END
diff --git a/tests/trcurve2.ckt b/tests/trcurve2.ckt
index 5642c054..fdead409 100644
--- a/tests/trcurve2.ckt
+++ b/tests/trcurve2.ckt
@@ -42,4 +42,5 @@ MPD 4 1 0 6 CMOSN L=3U W=3U AD=9P AS=9P PD=12U PS=12U
.op
.DC VDD 0 5 1 VIN 0 5 1
.DC VIN 0 5 1 VBACK 0 5 1
+*>.status notime
.END
diff --git a/tests/trcurves.ckt b/tests/trcurves.ckt
index eb68c982..6ff176ed 100644
--- a/tests/trcurves.ckt
+++ b/tests/trcurves.ckt
@@ -41,4 +41,5 @@ MPD 4 1 0 6 CMOSN L=10U W=10U AD=30P AS=30P PD=26U PS=26U
.DC VOUT 0 5 .1 VIN 0 5 .5
.print DC V(1) V(6) I(VPU) I(VPD) id(M*)
.DC VIN 0 5 .5 VBACK 0 5 1
+*>.status notime
.END
diff --git a/tests/u_attrib.1.gc b/tests/u_attrib.1.gc
new file mode 100644
index 00000000..6e0cd265
--- /dev/null
+++ b/tests/u_attrib.1.gc
@@ -0,0 +1,32 @@
+
+option list
+verilog
+(* a *) module aaa (c,d);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ endmodule;
+
+(* h *) module bbb (e,f);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ aaa a1(a,b);
+(* e *) aaa a2(a,b);
+ a1 a3(a,b);
+ a2 a4(a,b);
+(* f *) a1 a5(a,b);
+(* g *) a2 a6(a,b);
+(* i *)(* j *) a1 a7(a,b);
+(* k *)(* l *) a2 a8(a,b);
+ endmodule;
+
+list
+
+end
diff --git a/tests/u_attrib.2.gc b/tests/u_attrib.2.gc
new file mode 100644
index 00000000..c81c73a1
--- /dev/null
+++ b/tests/u_attrib.2.gc
@@ -0,0 +1,29 @@
+
+option list
+verilog
+module aaa (c,d);
+ resistor #(100) r1(a,b);
+ resistor #((*r*)200,(*m*)2) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+ r1 r5(a,b);
+ r2 r6(a,b);
+endmodule;
+
+module bbb ((*b*)e,f);
+ resistor #((*a*)100) r1(a,b);
+ resistor #((*d*).m(2),.r(200)) r2(a,b);
+ resistor #(.m(2),(*d*).r(200)) r2a(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+ r1 r5(a,b);
+ r2 r6(a,b);
+ aaa a1(a,b);
+ aaa a2(.d(a),.c(b));
+ aaa a3(a,(*u*)b);
+ aaa a4((*u*).d(a),.c(b));
+endmodule;
+
+list
+
+end
diff --git a/tests/u_attrib.3.gc b/tests/u_attrib.3.gc
new file mode 100644
index 00000000..acfab845
--- /dev/null
+++ b/tests/u_attrib.3.gc
@@ -0,0 +1,64 @@
+
+option list
+verilog
+(* a *) module aaa (c,d);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ endmodule;
+
+(* h *) module bbb (e,f);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ aaa a1(a,b);
+(* e *) aaa a2(a,b);
+ a1 a3(a,b);
+ a2 a4(a,b);
+(* f *) a1 a5(a,b);
+(* g *) a2 a6(a,b);
+(* i *)(* j *) a1 a7(a,b);
+(* k *)(* l *) a2 a8(a,b);
+ endmodule;
+
+list
+
+clear
+
+option list
+verilog
+(* a *) module aaa (c,d);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ endmodule;
+
+(* h *) module bbb (e,f);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ aaa a1(a,b);
+(* e *) aaa a2(a,b);
+ a1 a3(a,b);
+ a2 a4(a,b);
+(* f *) a1 a5(a,b);
+(* g *) a2 a6(a,b);
+(* i *)(* j *) a1 a7(a,b);
+(* k *)(* l *) a2 a8(a,b);
+ endmodule;
+
+list
+
+end \ No newline at end of file
diff --git a/tests/u_attrib.4.gc b/tests/u_attrib.4.gc
new file mode 100644
index 00000000..27069553
--- /dev/null
+++ b/tests/u_attrib.4.gc
@@ -0,0 +1,100 @@
+
+option list
+verilog
+(* a *) module aaa (c,d);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ endmodule;
+
+(* h *) module bbb (e,f);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ aaa a1(a,b);
+(* e *) aaa a2(a,b);
+ a1 a3(a,b);
+ a2 a4(a,b);
+(* f *) a1 a5(a,b);
+(* g *) a2 a6(a,b);
+(* i *)(* j *) a1 a7(a,b);
+(* k *)(* l *) a2 a8(a,b);
+ endmodule;
+
+list
+
+clear
+
+option list
+verilog
+(* a *) module aaa (c,d);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ endmodule;
+
+(* h *) module bbb (e,f);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ aaa a1(a,b);
+(* e *) aaa a2(a,b);
+ a1 a3(a,b);
+ a2 a4(a,b);
+(* f *) a1 a5(a,b);
+(* g *) a2 a6(a,b);
+(* i *)(* j *) a1 a7(a,b);
+(* k *)(* l *) a2 a8(a,b);
+ endmodule;
+
+list
+
+clear
+
+option list
+verilog
+(* a *) module aaa (c,d);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ endmodule;
+
+(* h *) module bbb (e,f);
+ resistor #(100) r1(a,b);
+(* b *) resistor #(200) r2(a,b);
+ r1 r3(a,b);
+ r2 r4(a,b);
+(* c *) r1 r5(a,b);
+(* d *) r2 r6(a,b);
+ aaa a1(a,b);
+(* e *) aaa a2(a,b);
+ a1 a3(a,b);
+ a2 a4(a,b);
+(* f *) a1 a5(a,b);
+(* g *) a2 a6(a,b);
+(* i *)(* j *) a1 a7(a,b);
+(* k *)(* l *) a2 a8(a,b);
+ endmodule;
+
+list
+
+clear
+
+list
+
+end