Exemple #1
0
            void step(netlist_time delta)
            {
                nl_double dd = delta.as_double();

                for (int k = 0; k < m_step_devices.size(); k++)
                {
                    m_step_devices[k].timestep(dd);
                }
            }
Exemple #2
0
            /* after every call to solve, update inputs must be called.
             * this can be done as well as a batch to ease parallel processing.
             */
            public netlist_time solve()
            {
                netlist_time now   = exec().time();
                netlist_time delta = now - m_last_step.op;

                // We are already up to date. Avoid oscillations.
                // FIXME: Make this a parameter!
                if (delta < netlist_time.quantum())
                {
                    return(netlist_time.zero());
                }

                /* update all terminals for new time step */
                m_last_step.op = now;
                step(delta);
                solve_base();
                netlist_time next_time_step = compute_next_timestep(delta.as_double());

                return(next_time_step);
            }