XSPICE is an extension to SPICE (also listed on this Free Circuit Simulation Software page) that includes the ability to use code modelling ("modeling") as well as simulate of digital components through an embedded event driven algorithm. Its code model library includes functional blocks like multipliers, summers, integrators, magnetics models, limiters, S-domain transfer functions, digital gates, etc. The program is provided in source code form, and is released into the public domain.
XSpice