Circuit elements

Elements provided

Spice compatible:
	Resistor (R)	(v = f(i,t), i = f(v,t), r = constant or f(t))
	Capacitor (C)	(q = f(v,t), c = f(v,t), c = constant or f(t))
	Inductor (L)	(flux = f(i,t), L = f(i,t), L = constant or f(t))
	VCVS (E)	(Vout = f(Vin,t))
	VCCS (G)	(Iout = f(Vin,t))
	Isource (I)	(I = constant or f(t))
	Vsource (V)	(V = constant or f(t))
	Diode (D)	(basic diode, subset of Spice parameters)
	Subckt (X)	(used for submodel, driver schedule)
Extended, Spice like (available in some Spice's):
	Voltage controlled Resistance (VCR)	(defines R = f(Vc,t))
	Voltage controlled Admittance (VCG)	(defines Y = f(Vc,t))
	Voltage controlled Capacitance (VCCAP)	(defines C = f(Vc,t))
	Uncoupled transmission line
	Coupled transmission line
Extended, behavioral blocks beyond Spice:
	Trigger	(activates anything time dependent)
	Alarm	(sends a notice when something happens)
	Driver	(a complex device for backward compatibility)
	Reshape	(generates a digital pulse, reshaped from its input)
	Delay	(out = in, but delayed.)
	Voltage controlled delay
Possible extended elements, need discussion
	Behavioral voltage source	(Spice "B" element)
	Behavioral current source	(Spice "B" element)
	Integrator block
	Differentiator block
	Behavioral integrator
	Behavioral differentiator


Netlist form

Basic syntax for simple elements:
	<label> (<connections>) <value>
   or	<type> <label> (<connections>) <value>

Extended elements are specified by a "dot" line, which is optional for 
the basic lines, and allowed to provide a consistent syntax.

Example:
	R12 (2 4) 10k
	.resistor R12 (2 4) R=10k

The value can take on several forms:
	1. simple value (10k)
	2. scalar symbolic value (C_comp)
	3. built-in symbolic value (VT)
	4. 1d table symbolic (I=Pullup[V])
	5. 2d table symbolic (I=Pullup[V,T] or I=Series_mosfet[Vc,Vo])
	6. Expressions made of combinations of above.
		Operators are: +, -, *, /, || with usual bindings

Expressions (form 6 above) must be simple enough to be evaluated once
when the file is read, producing a result which is one of the first 5
above.  Although the symbolic forms look like they could take
arbitrary arguments, only a few are allowed, depending on the basic
type of the element.  For example, a capacitor will always be either
Q=something or C=something, and the expression can only depend on its
own voltage (V) or time(T).  Time could be the actual simulation time
or relative to a "trigger".

The or operator ( || ) allows multiple values to be specified, using
the first one that is valid and ignoring the rest.  This too is
evaluated once when the file is read.  The purpose is to handle
optional keywords.

A subexpression is considered to be "true" if it can be successfully
evaluated, which usually means if all of the symbols are defined.  If
a symbolic name is not defined, that section evaluates to false.  The
actual result is not a truth value, but a value that is used as a
table or number.  The first section that can be successfully evaluated
becomes the value.  It is an error if no sections can be successfully
evaluated.

At least one section must be accepted (as defined) at compile time.

Certain values are used as flags:
  open: remove this component, leaving it open.
  short: remove this component, combining the out (first 2) nodes into 
a single node.

Example:
  TTpower * POWER_Clamp[-V] / VT || open
TTpower and VT are scalars.  POWER_Clamp is a table.  At compile
time, a new table is produced keeping the independent variable, and
substituting the result of evaluating the math expression for all
dependent variable entries.  The resulting table is the same size as
the POWER_Clamp table, and uses -V as the independent variable.


Background

The intent is to make it as Spice-like as practical, but limit it to
avoid the need for proprietary models, and extend it to provide some
behavioral modeling.

Since the new behavioral elements do not map readily to the one letter 
keys, add a device type key before each element.  To allow the old
syntax to me used, I have extended the "dot-card" convention to
identify the new keys.

With node names, it can be confusing without punctuation, so the
connection list can be set off by parenthesis.


Questions

Should the parentheses around the connections be required?  I think
so.  It is more readable that way.
