コード例 #1
0
            //NETLIB_CONSTRUCTOR(solver)
            //detail.family_setter_t m_famsetter;
            //template <class CLASS>
            public nld_solver(object owner, string name)
                : base(owner, name)
            {
                m_fb_step = new logic_input_t(this, "FB_step");
                m_Q_step  = new logic_output_t(this, "Q_step");
                m_freq    = new param_double_t(this, "FREQ", 48000.0);

                /* iteration parameters */
                m_gs_sor   = new param_double_t(this, "SOR_FACTOR", 1.059);
                m_method   = new param_str_t(this, "METHOD", "MAT_CR");
                m_accuracy = new param_double_t(this, "ACCURACY", 1e-7);
                m_gs_loops = new param_int_t(this, "GS_LOOPS", 9);              // Gauss-Seidel loops

                /* general parameters */
                m_gmin            = new param_double_t(this, "GMIN", nl_config_global.NETLIST_GMIN_DEFAULT);
                m_pivot           = new param_logic_t(this, "PIVOT", false /*0*/);                                            // use pivoting - on supported solvers
                m_nr_loops        = new param_int_t(this, "NR_LOOPS", 250);                                                   // Newton-Raphson loops
                m_nr_recalc_delay = new param_double_t(this, "NR_RECALC_DELAY", netlist_time.NLTIME_FROM_NS(10).as_double()); // Delay to next solve attempt if nr loops exceeded
                m_parallel        = new param_int_t(this, "PARALLEL", 0);

                /* automatic time step */
                m_dynamic_ts     = new param_logic_t(this, "DYNAMIC_TS", false /*0*/);
                m_dynamic_lte    = new param_double_t(this, "DYNAMIC_LTE", 1e-5);          // diff/timestep
                m_dynamic_min_ts = new param_double_t(this, "DYNAMIC_MIN_TIMESTEP", 1e-6); // nl_double timestep resolution

                m_log_stats = new param_logic_t(this, "LOG_STATS", true);                  // log statistics on shutdown
                m_params    = new solver_parameters_t();


                // internal staff

                connect(m_fb_step, m_Q_step);
            }
コード例 #2
0
        nld_power_pins m_supply;  //NETLIB_NAME(power_pins) m_supply;


        //NETLIB_CONSTRUCTOR(logic_input)
        //detail.family_setter_t m_famsetter;
        //template <class CLASS>
        public nld_logic_input(object owner, string name)
            : base(owner, name)
        {
            m_Q      = new logic_output_t(this, "Q");
            m_IN     = new param_logic_t(this, "IN", false);
            m_supply = new nld_power_pins(this);
        }
コード例 #3
0
            //NETLIB_CONSTRUCTOR(mainclock)
            //detail.family_setter_t m_famsetter;
            //template <class CLASS>
            nld_mainclock(object owner, string name)
                : base(owner, name)
            {
                m_Q    = new logic_output_t(this, "Q");
                m_freq = new param_double_t(this, "FREQ", 7159000.0 * 5);


                m_inc = netlist_time.from_double(1.0 / (m_freq.op() * 2.0));
            }
コード例 #4
0
            //NETLIB_CONSTRUCTOR(mainclock)
            public nld_mainclock(object owner, string name)
                : base(owner, name)
            {
                m_Q    = new logic_output_t(this, "Q");
                m_freq = new param_fp_t(this, "FREQ", nlconst.magic(7159000.0 * 5));


                m_inc = netlist_time.from_fp(plib.pg.reciprocal(m_freq.op() * nlconst.two()));
            }
コード例 #5
0
ファイル: nlid_proxy.cs プロジェクト: kwanboy/mcs
            //analog_output_t m_GNDHack;  // FIXME: Long term, we need to connect proxy gnd to device gnd
            //analog::NETLIB_SUB(twoterm) m_RV;
            //state_var<int> m_last_state;
            //bool m_is_timestep;


            public nld_d_to_a_proxy(netlist_base_t anetlist, string name, logic_output_t out_proxied)
                : base(anetlist, name, out_proxied, null)  //m_RV.m_P)
            {
                throw new emu_unimplemented();


                // TODO - add this code after initialization
                // set proxy_term after variable is initialized
                //proxy_term_prop = m_RV.m_p;
            }
コード例 #6
0
 //NETLIB_CONSTRUCTOR(7450)
 public nld_7450(object owner, string name)
     : base(owner, name)
 {
     m_A          = new logic_input_t(this, "A", inputs);
     m_B          = new logic_input_t(this, "B", inputs);
     m_C          = new logic_input_t(this, "C", inputs);
     m_D          = new logic_input_t(this, "D", inputs);
     m_Q          = new logic_output_t(this, "Q");
     m_power_pins = new nld_power_pins(this);
 }
コード例 #7
0
 //NETLIB_CONSTRUCTOR(74153)
 public nld_74153(object owner, string name)
     : base(owner, name)
 {
     m_C          = new object_array_t_logic_input_t <u64_const_4>(this, new logic_input_t(this, "C0", sub), new logic_input_t(this, "C1", sub), new logic_input_t(this, "C2", sub), new logic_input_t(this, "C3", sub));
     m_G          = new logic_input_t(this, "G", sub);
     m_Y          = new logic_output_t(this, "AY"); //FIXME: Change netlists
     m_chan       = new state_var <unsigned>(this, "m_chan", 0);
     m_A          = new logic_input_t(this, "A", other);
     m_B          = new logic_input_t(this, "B", other);
     m_power_pins = new nld_power_pins(this);
 }
コード例 #8
0
            //NETLIB_CONSTRUCTOR(logic_input)
            //detail.family_setter_t m_famsetter;
            //template <class CLASS>
            public nld_logic_input(object owner, string name)
                : base(owner, name)
            {
                m_Q  = new logic_output_t(this, "Q");
                m_IN = new param_logic_t(this, "IN", false /*0*/);
                /* make sure we get the family first */
                m_FAMILY = new param_model_t(this, "FAMILY", "FAMILY(TYPE=TTL)");


                set_logic_family(setup().family_from_model(m_FAMILY.op()));
            }
コード例 #9
0
 //NETLIB_CONSTRUCTOR(7474)
 public nld_7474(object owner, string name)
     : base(owner, name)
 {
     m_D          = new logic_input_t(this, "D", inputs);
     m_CLRQ       = new logic_input_t(this, "CLRQ", inputs);
     m_PREQ       = new logic_input_t(this, "PREQ", inputs);
     m_CLK        = new logic_input_t(this, "CLK", clk);
     m_Q          = new logic_output_t(this, "Q");
     m_QQ         = new logic_output_t(this, "QQ");
     m_nextD      = new state_var <netlist_sig_t>(this, "m_nextD", 0);
     m_power_pins = new nld_power_pins(this);
 }
コード例 #10
0
 //NETLIB_CONSTRUCTOR(7493)
 public nld_7493(object owner, string name)
     : base(owner, name)
 {
     m_CLKA       = new logic_input_t(this, "CLKA", updA);
     m_CLKB       = new logic_input_t(this, "CLKB", updB);
     m_QA         = new logic_output_t(this, "QA");
     m_QB         = new object_array_t_logic_output_t <u64_const_3>(this, new logic_output_t(this, "QB"), new logic_output_t(this, "QC"), new logic_output_t(this, "QD"));
     m_a          = new state_var <unsigned>(this, "m_a", 0);
     m_bcd        = new state_var <unsigned>(this, "m_b", 0);
     m_R1         = new logic_input_t(this, "R1", inputs);
     m_R2         = new logic_input_t(this, "R2", inputs);
     m_power_pins = new nld_power_pins(this);
 }
コード例 #11
0
        //NETLIB_CONSTRUCTOR(clock)
        //detail.family_setter_t m_famsetter;
        //template <class CLASS>
        public nld_clock(object owner, string name)
            : base(owner, name)
        {
            m_feedback = new logic_input_t(this, "FB", fb);
            m_Q        = new logic_output_t(this, "Q");
            m_freq     = new param_fp_t(this, "FREQ", nlconst.magic(7159000.0 * 5.0));
            m_supply   = new nld_power_pins(this);


            m_inc = netlist_time.from_fp(plib.pg.reciprocal(m_freq.op() * nlconst.two()));

            connect("FB", "Q");
        }
コード例 #12
0
        //NETLIB_CONSTRUCTOR(74107_base)
        public nld_74107_base(object owner, string name, desc_base desc)
            : base(owner, name)
        {
            D = desc;

            m_clk        = new logic_input_t(this, "CLK", clk);
            m_J          = new logic_input_t(this, "J", other);
            m_K          = new logic_input_t(this, "K", other);
            m_clrQ       = new logic_input_t(this, "CLRQ", other);
            m_Q          = new logic_output_t(this, "Q");
            m_QQ         = new logic_output_t(this, "QQ");
            m_power_pins = new nld_power_pins(this);
        }
コード例 #13
0
            //NETLIB_CONSTRUCTOR(solver)
            //detail.family_setter_t m_famsetter;
            //template <class CLASS>
            //NETLIB_CONSTRUCTOR(solver)
            public nld_solver(object owner, string name)
                : base(owner, name)
            {
                m_fb_step = new logic_input_t(this, "FB_step", fb_step <bool_const_false>);  //, m_fb_step(*this, "FB_step", NETLIB_DELEGATE(fb_step<false>))
                m_Q_step  = new logic_output_t(this, "Q_step");
                m_params  = new solver.solver_parameters_t(this, "", solver.solver_parameter_defaults.get_instance());
                m_queue   = new nld_solver_queue_type(config.MAX_SOLVER_QUEUE_SIZE,
                                                      get_solver_id, //queue_type::id_delegate(&NETLIB_NAME(solver).get_solver_id, this),
                                                      solver_by_id); //queue_type::obj_delegate(&NETLIB_NAME(solver).solver_by_id, this));


                // internal stuff
                state().save(this, (plib.state_manager_t.callback_t)m_queue, this.name(), "m_queue");

                connect("FB_step", "Q_step");
            }
コード例 #14
0
        public nld_d_to_a_proxy(netlist_state_t anetlist, string name, logic_output_t out_proxied)
            : base(anetlist, name, out_proxied)
        {
            m_I          = new logic_input_t(this, "I", input);
            m_RP         = new analog.nld_twoterm(this, "RP");
            m_RN         = new analog.nld_twoterm(this, "RN");
            m_last_state = new state_var <netlist_sig_t>(this, "m_last_var", terminal_t.OUT_TRISTATE());


            register_subalias("Q", "RN.1");

            connect(m_RN.N(), m_tn);
            connect(m_RP.P(), m_tp);

            connect(m_RN.P(), m_RP.N());
        }
コード例 #15
0
        //NETLIB_CONSTRUCTOR(buffered_param_setter)
        protected nld_buffered_param_setter(object owner, string name)
            : base(owner, name)
        {
            m_sample_time  = netlist_time.zero();
            m_feedback     = new logic_input_t(this, "FB", feedback); // clock part
            m_Q            = new logic_output_t(this, "Q");
            m_pos          = 0;
            m_samples      = 0;
            m_param_name   = new param_str_t(this, "CHAN", "");
            m_param_mult   = new param_fp_t(this, "MULT", 1.0);
            m_param_offset = new param_fp_t(this, "OFFSET", 0.0);
            m_param        = null;
            m_id           = new param_num_t <size_t, param_num_t_operators_size_t>(this, "ID", 0);


            connect("FB", "Q");
            m_buffer = default;
        }
コード例 #16
0
            // ----------------------------------------------------------------------------------------
            // matrix_solver
            // ----------------------------------------------------------------------------------------
            protected matrix_solver_t(netlist_base_t anetlist, string name, eSortType sort, solver_parameters_t params_)
                : base(anetlist, name)
            {
                m_params              = params_;
                m_stat_calculations   = new state_var <int>(this, "m_stat_calculations", 0);
                m_stat_newton_raphson = new state_var <int>(this, "m_stat_newton_raphson", 0);
                m_stat_vsolver_calls  = new state_var <int>(this, "m_stat_vsolver_calls", 0);
                m_iterative_fail      = new state_var <int>(this, "m_iterative_fail", 0);
                m_iterative_total     = new state_var <int>(this, "m_iterative_total", 0);
                m_last_step           = new state_var <netlist_time>(this, "m_last_step", netlist_time.zero());
                m_fb_sync             = new logic_input_t(this, "FB_sync");
                m_Q_sync              = new logic_output_t(this, "Q_sync");
                m_ops  = 0;
                m_sort = sort;


                connect_post_start(m_fb_sync, m_Q_sync);
            }
コード例 #17
0
        //NETLIB_CONSTRUCTOR(9316_base)
        public nld_9316_base(object owner, string name, desc_base desc)
            : base(owner, name)
        {
            D = desc;

            m_CLK        = new logic_input_t(this, "CLK", clk);
            m_ENT        = new logic_input_t(this, "ENT", other);
            m_LOADQ      = new logic_input_t(this, "LOADQ", other);
            m_ENP        = new logic_input_t(this, "ENP", other);
            m_CLRQ       = new logic_input_t(this, "CLRQ", other);
            m_ABCD       = new object_array_t_logic_input_t <u64_const_4>(this, new logic_input_t(this, "A", abcd), new logic_input_t(this, "B", abcd), new logic_input_t(this, "C", abcd), new logic_input_t(this, "D", abcd));
            m_RC         = new logic_output_t(this, "RC");
            m_Q          = new object_array_t_logic_output_t <u64_const_4>(this, new logic_output_t(this, "QA"), new logic_output_t(this, "QB"), new logic_output_t(this, "QC"), new logic_output_t(this, "QD"));
            m_cnt        = new state_var <unsigned>(this, "m_cnt", 0);
            m_abcd       = new state_var <unsigned>(this, "m_abcd", 0);
            m_loadq      = new state_var <unsigned>(this, "m_loadq", 0);
            m_ent        = new state_var <unsigned>(this, "m_ent", 0);
            m_power_pins = new nld_power_pins(this);
        }
コード例 #18
0
 //NETLIB_CONSTRUCTOR(7483)
 public nld_7483(object owner, string name)
     : base(owner, name)
 {
     m_C0         = new logic_input_t(this, "C0", c0);
     m_A1         = new logic_input_t(this, "A1", upd_a);
     m_A2         = new logic_input_t(this, "A2", upd_a);
     m_A3         = new logic_input_t(this, "A3", upd_a);
     m_A4         = new logic_input_t(this, "A4", upd_a);
     m_B1         = new logic_input_t(this, "B1", upd_b);
     m_B2         = new logic_input_t(this, "B2", upd_b);
     m_B3         = new logic_input_t(this, "B3", upd_b);
     m_B4         = new logic_input_t(this, "B4", upd_b);
     m_a          = new state_var_u8(this, "m_a", 0);
     m_b          = new state_var_u8(this, "m_b", 0);
     m_lastr      = new state_var_u8(this, "m_lastr", 0);
     m_S1         = new logic_output_t(this, "S1");
     m_S2         = new logic_output_t(this, "S2");
     m_S3         = new logic_output_t(this, "S3");
     m_S4         = new logic_output_t(this, "S4");
     m_C4         = new logic_output_t(this, "C4");
     m_power_pins = new nld_power_pins(this);
 }
コード例 #19
0
 protected nld_base_d_to_a_proxy(netlist_state_t anetlist, string name, logic_output_t out_proxied)
     : base(anetlist, name, out_proxied)
 {
 }
コード例 #20
0
ファイル: nlid_proxy.cs プロジェクト: kwanboy/mcs
 protected nld_base_a_to_d_proxy(netlist_base_t anetlist, string name, logic_input_t in_proxied, detail.core_terminal_t in_proxy)
     : base(anetlist, name, in_proxied, in_proxy)
 {
     m_Q = new logic_output_t(this, "Q");
 }
コード例 #21
0
 public nld_a_to_d_proxy(netlist_state_t anetlist, string name, logic_input_t in_proxied)
     : base(anetlist, name, in_proxied)
 {
     m_Q = new logic_output_t(this, "Q");
     m_I = new analog_input_t(this, "I", input);
 }
コード例 #22
0
ファイル: nlid_proxy.cs プロジェクト: kwanboy/mcs
 protected nld_base_d_to_a_proxy(netlist_base_t anetlist, string name, logic_output_t out_proxied, detail.core_terminal_t proxy_out)
     : base(anetlist, name, out_proxied, proxy_out)
 {
     m_I = new logic_input_t(this, "I");
 }