Looks like we all got an early Christmas present from Mike Engelhardt and Qorvo with QSPICE. www.qorvo.com/.../qspice
I am still just learning how to use some of the new features in QSpice that differentiate it from other spice based circuit simulators.
One of the new differentiating features is the ability to define spice components in c++ or Verilog.
I followed the recommended procedure in the help manual for an Ø(.dll) device:
I made a simple test schematic for a 2-bit counter:
Here is the source code of a counter in a spice schematic!
There is a lot of extra boilerplate code, but that gets generated for you if you follow the recommending procedure in the help file.
The code increments an internal count variable on the rising edge of the input clock pin.
Press f5 to run, and tada!
C++ code running in a spice simulator, love it!