Rob,
I will need to create a model of a semiconductor device based upon its
physics -- that is, based upon the constituitive relations,
depletion lengths, Fermi levels, and all that other junk you find in
Sze. I am probably going to do it using an XSpice codemodel.
I am kind of confused about how I can model the C(V) behavior
of the device, because as far as I know the IOs provided by a
codemodel only allow you to input/output voltages and/or currents,
and I don't know how to put in time information (i.e. to support
the differentiating behavior of the cap).
It's probably much easier to just write this type of spice device
without using xspice. That's been my experience anyway. Integration
of the general non-linear capacitance isn't too hard to figure
out. LTspice has an arbitrary capacitance device that is useful for
rapid prototyping new charge models. I'm not much of a fan of xspice
and I have not seen it used by the major SPICE programs like LTspice,
PSpice, hspice, or Spectre.
Is anybody here aware of a good text-book which would illuminate
the internal workings of SPICE, and provide a guide to extending it
using XSpice codemodels? I have looked at a few on-line theses and
such, but I need something more like "codemodels for dummies".
There's various books on how SPICE works, the 2nd edition of the one
JT suggests is one I always recommend and you will need, but doesn't
address SPICE internals. A good one there is the one by Pillage and
Rohrer. I've been thinking of writing one myself, but until then
you should just get every one you can find if you want to get involved
in this. It's a interesting endeavor. You'll find yourself in club
smaller than the number of people that walked on the moon.
--Mike