diff options
| author | 2015-06-24 07:36:50 +0200 | |
|---|---|---|
| committer | 2015-06-24 07:36:50 +0200 | |
| commit | d1583b9850d9fb45470648a515eb734e05fd926f (patch) | |
| tree | 33a4d9934bd2ff6c41526abe0ba06c1d1ea73eb6 /src/emu/netlist | |
| parent | 03a5bfa56fa4af400f6b9fb07a5e1333aa8fa52f (diff) | |
Cleanups and version bumpmame0163
Diffstat (limited to 'src/emu/netlist')
| -rw-r--r-- | src/emu/netlist/devices/net_lib.c | 2 | ||||
| -rw-r--r-- | src/emu/netlist/devices/nld_system.h | 2 | ||||
| -rw-r--r-- | src/emu/netlist/devices/nld_truthtable.c | 6 | ||||
| -rw-r--r-- | src/emu/netlist/nl_base.c | 1 | ||||
| -rw-r--r-- | src/emu/netlist/nl_base.h | 9 | ||||
| -rw-r--r-- | src/emu/netlist/nl_config.h | 46 | ||||
| -rw-r--r-- | src/emu/netlist/nl_factory.c | 1 | ||||
| -rw-r--r-- | src/emu/netlist/nl_factory.h | 1 | ||||
| -rw-r--r-- | src/emu/netlist/nl_lists.h | 1 | ||||
| -rw-r--r-- | src/emu/netlist/nl_parser.h | 1 | ||||
| -rw-r--r-- | src/emu/netlist/nl_setup.c | 1 | ||||
| -rw-r--r-- | src/emu/netlist/nl_setup.h | 8 | ||||
| -rw-r--r-- | src/emu/netlist/nl_time.h | 1 | ||||
| -rw-r--r-- | src/emu/netlist/plib/pconfig.h | 4 | ||||
| -rw-r--r-- | src/emu/netlist/plib/plists.h | 17 | ||||
| -rw-r--r-- | src/emu/netlist/solver/mat_cr.h | 10 | ||||
| -rw-r--r-- | src/emu/netlist/solver/nld_ms_direct.h | 6 | ||||
| -rw-r--r-- | src/emu/netlist/solver/nld_ms_gmres.h | 26 | ||||
| -rw-r--r-- | src/emu/netlist/solver/nld_ms_sor_mat.h | 2 | ||||
| -rw-r--r-- | src/emu/netlist/solver/vector_base.h | 1 | ||||
| -rw-r--r-- | src/emu/netlist/tools/nl_convert.c | 24 | ||||
| -rw-r--r-- | src/emu/netlist/tools/nl_convert.h | 1 |
22 files changed, 78 insertions, 93 deletions
diff --git a/src/emu/netlist/devices/net_lib.c b/src/emu/netlist/devices/net_lib.c index a98004bb079..75acd004a85 100644 --- a/src/emu/netlist/devices/net_lib.c +++ b/src/emu/netlist/devices/net_lib.c @@ -54,7 +54,7 @@ void initialize_factory(factory_list_t &factory) ENTRY(VCCS, VCCS, "-") ENTRY(CCCS, CCCS, "-") ENTRY(dummy_input, DUMMY_INPUT, "-") - ENTRY(frontier, FRONTIER_DEV, "+I,G,Q") // not intended to be used directly + ENTRY(frontier, FRONTIER_DEV, "+I,G,Q") // not intended to be used directly ENTRY(QBJT_EB, QBJT_EB, "model") ENTRY(QBJT_switch, QBJT_SW, "model") ENTRY(ttl_input, TTL_INPUT, "IN") diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h index 1da91d2a813..eb547c847e0 100644 --- a/src/emu/netlist/devices/nld_system.h +++ b/src/emu/netlist/devices/nld_system.h @@ -51,7 +51,7 @@ NET_C(_G, _name.G) \ NET_C(_OUT, _name.Q) -#define OPTIMIZE_FRONTIER(_attach, _r_in, _r_out) \ +#define OPTIMIZE_FRONTIER(_attach, _r_in, _r_out) \ setup.register_frontier(# _attach, _r_in, _r_out); #define RES_SWITCH(_name, _IN, _P1, _P2) \ diff --git a/src/emu/netlist/devices/nld_truthtable.c b/src/emu/netlist/devices/nld_truthtable.c index c4030e8bff3..a5185c1fed1 100644 --- a/src/emu/netlist/devices/nld_truthtable.c +++ b/src/emu/netlist/devices/nld_truthtable.c @@ -238,11 +238,11 @@ void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32 disabled_ } -#define ENTRYX(_n,_m,_h) case (_n * 1000 + _m * 10 + _h): \ +#define ENTRYX(_n,_m,_h) case (_n * 1000 + _m * 10 + _h): \ { typedef netlist_factory_truthtable_t<_n,_m,_h> xtype; \ - return palloc(xtype,name,classname,def_param); } break + return palloc(xtype,name,classname,def_param); } break -#define ENTRYY(_n,_m) ENTRYX(_n,_m,0); ENTRYX(_n,_m,1) +#define ENTRYY(_n,_m) ENTRYX(_n,_m,0); ENTRYX(_n,_m,1) #define ENTRY(_n) ENTRYY(_n, 1); ENTRYY(_n, 2); ENTRYY(_n, 3); ENTRYY(_n, 4); ENTRYY(_n, 5); ENTRYY(_n, 6) diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index 588b4e53f35..f5c585fc570 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -99,7 +99,6 @@ public: const logic_family_desc_t *logic_family_desc_t::from_model(const pstring &model) { - if (setup_t::model_value_str(model, "TYPE", "") == "TTL") return &netlist_family_TTL; if (setup_t::model_value_str(model, "TYPE", "") == "CD4000") diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index b6347eb5fe8..a884370c647 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -170,9 +170,8 @@ typedef UINT8 netlist_sig_t; // MACROS / netlist devices //============================================================ -#define NETLIB_NAMESPACE_DEVICES_START() namespace netlist { namespace devices { - -#define NETLIB_NAMESPACE_DEVICES_END() }} +#define NETLIB_NAMESPACE_DEVICES_START() namespace netlist { namespace devices { +#define NETLIB_NAMESPACE_DEVICES_END() }} #define NETLIB_NAME(_chip) nld_ ## _chip @@ -292,7 +291,7 @@ namespace netlist fatalerror_e(const char *format, va_list ap); virtual ~fatalerror_e() throw() {} - const pstring &text() { return m_text; } + const pstring &text() { return m_text; } private: pstring m_text; }; @@ -432,7 +431,7 @@ namespace netlist // ----------------------------------------------------------------------------- // netlist_owned_object_t // ----------------------------------------------------------------------------- - + class owned_object_t : public object_t { NETLIST_PREVENT_COPYING(owned_object_t) diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index 439e779b1ce..debddd8b97c 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -17,42 +17,42 @@ /* * The following options determine how object::update is called. * NL_PMF_TYPE_VIRTUAL - * Use stock virtual call + * Use stock virtual call * * NL_PMF_TYPE_GNUC_PMF - * Use standard pointer to member function syntax + * Use standard pointer to member function syntax * - * NL_PMF_TYPE_GNUC_PMF_CONV - * Use gnu extension and convert the pmf to a function pointer. - * This is not standard compliant and needs - * -Wno-pmf-conversions to compile. + * NL_PMF_TYPE_GNUC_PMF_CONV + * Use gnu extension and convert the pmf to a function pointer. + * This is not standard compliant and needs + * -Wno-pmf-conversions to compile. * - * NL_PMF_TYPE_INTERNAL - * Use the same approach as MAME for deriving the function pointer. - * This is compiler-dependant as well + * NL_PMF_TYPE_INTERNAL + * Use the same approach as MAME for deriving the function pointer. + * This is compiler-dependant as well * - * Benchmarks for ./nltool -c run -f src/mame/drivers/nl_pong.c -t 10 -n pong_fast + * Benchmarks for ./nltool -c run -f src/mame/drivers/nl_pong.c -t 10 -n pong_fast * - * NL_PMF_TYPE_INTERNAL: 215% - * NL_PMF_TYPE_GNUC_PMF: 163% - * NL_PMF_TYPE_GNUC_PMF_CONV: 215% - * NL_PMF_TYPE_VIRTUAL: 213% + * NL_PMF_TYPE_INTERNAL: 215% + * NL_PMF_TYPE_GNUC_PMF: 163% + * NL_PMF_TYPE_GNUC_PMF_CONV: 215% + * NL_PMF_TYPE_VIRTUAL: 213% * - * The whole exercise was done to avoid virtual calls. In prior versions of - * netlist, the INTERNAL and GNUC_PMF_CONV approach provided significant improvement. - * Since than, ATTR_COLD was removed from functions declared as virtual. - * This may explain that the recent benchmarks show no difference at all. + * The whole exercise was done to avoid virtual calls. In prior versions of + * netlist, the INTERNAL and GNUC_PMF_CONV approach provided significant improvement. + * Since than, ATTR_COLD was removed from functions declared as virtual. + * This may explain that the recent benchmarks show no difference at all. * - * Disappointing is the GNUC_PMF performance. + * Disappointing is the GNUC_PMF performance. */ // This will be autodetected //#define NL_PMF_TYPE 3 -#define NL_PMF_TYPE_VIRTUAL 0 -#define NL_PMF_TYPE_GNUC_PMF 1 -#define NL_PMF_TYPE_GNUC_PMF_CONV 2 -#define NL_PMF_TYPE_INTERNAL 3 +#define NL_PMF_TYPE_VIRTUAL 0 +#define NL_PMF_TYPE_GNUC_PMF 1 +#define NL_PMF_TYPE_GNUC_PMF_CONV 2 +#define NL_PMF_TYPE_INTERNAL 3 #ifndef NL_PMF_TYPE #if PHAS_PMF_INTERNAL diff --git a/src/emu/netlist/nl_factory.c b/src/emu/netlist/nl_factory.c index 7275a7bb772..a62c889baed 100644 --- a/src/emu/netlist/nl_factory.c +++ b/src/emu/netlist/nl_factory.c @@ -13,7 +13,6 @@ namespace netlist { - // ---------------------------------------------------------------------------------------- // net_device_t_base_factory // ---------------------------------------------------------------------------------------- diff --git a/src/emu/netlist/nl_factory.h b/src/emu/netlist/nl_factory.h index e2cecebf7cd..2b29efca61f 100644 --- a/src/emu/netlist/nl_factory.h +++ b/src/emu/netlist/nl_factory.h @@ -16,7 +16,6 @@ namespace netlist { - // ----------------------------------------------------------------------------- // net_dev class factory // ----------------------------------------------------------------------------- diff --git a/src/emu/netlist/nl_lists.h b/src/emu/netlist/nl_lists.h index 6aaaef22330..bea7508a7d8 100644 --- a/src/emu/netlist/nl_lists.h +++ b/src/emu/netlist/nl_lists.h @@ -19,7 +19,6 @@ namespace netlist { - template <class _Element, class _Time> class timed_queue { diff --git a/src/emu/netlist/nl_parser.h b/src/emu/netlist/nl_parser.h index 1039e01997f..44074b8b9ca 100644 --- a/src/emu/netlist/nl_parser.h +++ b/src/emu/netlist/nl_parser.h @@ -14,7 +14,6 @@ namespace netlist { - class parser_t : public ptokenizer { NETLIST_PREVENT_COPYING(parser_t) diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 68bc5452815..a135caf5598 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -39,7 +39,6 @@ NETLIST_END() namespace netlist { - setup_t::setup_t(netlist_t *netlist) : m_netlist(netlist) , m_proxy_cnt(0) diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index 2c6d341913c..ddc26ba8390 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -55,10 +55,9 @@ #define NETLIST_START(_name) \ ATTR_COLD void NETLIST_NAME(_name)(netlist::setup_t &setup) \ { - #define NETLIST_END() } -#define LOCAL_SOURCE(_name) \ +#define LOCAL_SOURCE(_name) \ setup.register_source(palloc(netlist::source_proc_t, # _name, &NETLIST_NAME(_name))); #define INCLUDE(_name) \ @@ -75,7 +74,6 @@ ATTR_COLD void NETLIST_NAME(_name)(netlist::setup_t &setup) namespace netlist { - // Forward definition so we keep nl_factory.h out of the public class factory_list_t; @@ -282,8 +280,8 @@ namespace netlist public: source_proc_t(pstring name, void (*setup_func)(setup_t &)) : setup_t::source_t(), - m_setup_func(setup_func), - m_setup_func_name(name) + m_setup_func(setup_func), + m_setup_func_name(name) { } diff --git a/src/emu/netlist/nl_time.h b/src/emu/netlist/nl_time.h index 72079b8d17b..4473b67d2c8 100644 --- a/src/emu/netlist/nl_time.h +++ b/src/emu/netlist/nl_time.h @@ -27,7 +27,6 @@ namespace netlist { - struct netlist_time { public: diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h index cfb4fe8fb60..1918ec61fb6 100644 --- a/src/emu/netlist/plib/pconfig.h +++ b/src/emu/netlist/plib/pconfig.h @@ -145,10 +145,10 @@ public: // construct from any member function pointer class generic_class; typedef void (*generic_function)(); - + #if (PSTANDALONE) typedef std::size_t FPTR; - #endif + #endif template<typename _MemberFunctionType> pmfp(_MemberFunctionType mfp) diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h index 4193f4956cc..0f71a35c9e4 100644 --- a/src/emu/netlist/plib/plists.h +++ b/src/emu/netlist/plib/plists.h @@ -97,7 +97,7 @@ public: plist_t() : std::vector<_ListClass>() {} plist_t(const int numElements) : std::vector<_ListClass>(numElements) {} - void add(const _ListClass &elem) { this->push_back(elem); } + void add(const _ListClass &elem) { this->push_back(elem); } void clear_and_free() { for (_ListClass *i = this->data(); i < this->data() + this->size(); i++) @@ -106,7 +106,7 @@ public: } this->clear(); } - bool contains(const _ListClass &elem) const + bool contains(const _ListClass &elem) const { for (const _ListClass *i = this->data(); i < this->data() + this->size(); i++) { @@ -116,7 +116,7 @@ public: return false; } - void remove(const _ListClass &elem) + void remove(const _ListClass &elem) { for (int i = 0; i < this->size(); i++) { @@ -127,12 +127,12 @@ public: } } } - void remove_at(const int pos) + void remove_at(const int pos) { this->erase(this->begin() + pos); } - int indexof(const _ListClass &elem) const + int indexof(const _ListClass &elem) const { for (int i = 0; i < this->size(); i++) { @@ -539,7 +539,6 @@ public: pstring_list_t(const pstring &str, const pstring &onstr, bool ignore_empty = false) : plist_t<pstring>() { - int p = 0; int pn; @@ -607,9 +606,9 @@ static inline void psort_list(Class &sl) { for(int i = 0; i < (int) sl.size() - 1; i++) { - for(int j = i + 1; j < sl.size(); j++) - if(sl[i] > sl[j]) - std::swap(sl[i], sl[j]); + for(int j = i + 1; j < sl.size(); j++) + if(sl[i] > sl[j]) + std::swap(sl[i], sl[j]); } } diff --git a/src/emu/netlist/solver/mat_cr.h b/src/emu/netlist/solver/mat_cr.h index 9322a74c045..4972bc21a29 100644 --- a/src/emu/netlist/solver/mat_cr.h +++ b/src/emu/netlist/solver/mat_cr.h @@ -19,7 +19,7 @@ struct mat_cr_t unsigned nz_num; unsigned ia[_storage_N + 1]; unsigned ja[_storage_N * _storage_N]; - unsigned diag[_storage_N]; /* n */ + unsigned diag[_storage_N]; /* n */ void mult_vec(const double * RESTRICT A, const double * RESTRICT x, double * RESTRICT res) { @@ -85,14 +85,14 @@ struct mat_cr_t /* * Solve a linear equation Ax = r * where - * A = L*U + * A = L*U * - * L unit lower triangular - * U upper triangular + * L unit lower triangular + * U upper triangular * * ==> LUx = r * - * ==> Ux = L⁻¹r = w + * ==> Ux = L?????r = w * * ==> r = Lw * diff --git a/src/emu/netlist/solver/nld_ms_direct.h b/src/emu/netlist/solver/nld_ms_direct.h index e8eb9898ed8..e9acd1d2415 100644 --- a/src/emu/netlist/solver/nld_ms_direct.h +++ b/src/emu/netlist/solver/nld_ms_direct.h @@ -250,7 +250,7 @@ ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::lis } psort_list(t->m_nzrd); - t->m_nz.add(k); // add diagonal + t->m_nz.add(k); // add diagonal psort_list(t->m_nz); } @@ -388,8 +388,8 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve() /* The code below is 30% faster than the original * implementation which is given here for reference. * - * for (unsigned k = i + 1; k < kN; k++) - * m_A[j][k] = m_A[j][k] + m_A[i][k] * f1; + * for (unsigned k = i + 1; k < kN; k++) + * m_A[j][k] = m_A[j][k] + m_A[i][k] * f1; */ double * RESTRICT d = &m_A[j][i+1]; const double * RESTRICT s = &m_A[i][i+1]; diff --git a/src/emu/netlist/solver/nld_ms_gmres.h b/src/emu/netlist/solver/nld_ms_gmres.h index 6ed58ac4498..f3f5bf43d00 100644 --- a/src/emu/netlist/solver/nld_ms_gmres.h +++ b/src/emu/netlist/solver/nld_ms_gmres.h @@ -78,10 +78,10 @@ private: double m_c[_storage_N + 1]; /* mr + 1 */ double m_g[_storage_N + 1]; /* mr + 1 */ - double * RESTRICT m_ht[_storage_N]; /* mr, (mr + 1) */ - double m_s[_storage_N]; /* mr + 1 */ - double * RESTRICT m_v[_storage_N + 1]; /*(mr + 1), n */ - //double m_y[_storage_N]; /* mr + 1 */ + double * RESTRICT m_ht[_storage_N]; /* mr, (mr + 1) */ + double m_s[_storage_N]; /* mr + 1 */ + double * RESTRICT m_v[_storage_N + 1]; /*(mr + 1), n */ + //double m_y[_storage_N]; /* mr + 1 */ double m_accuracy_mult; @@ -234,7 +234,7 @@ ATTR_HOT inline int matrix_solver_GMRES_t<m_N, _storage_N>::vsolve_non_dynamic(c if (gsl>=failed) { //for (int k = 0; k < iN; k++) - // this->m_nets[k]->m_cur_Analog = new_V[k]; + // this->m_nets[k]->m_cur_Analog = new_V[k]; // Fallback to direct solver ... this->m_gs_fail++; return matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(newton_raphson); @@ -264,11 +264,11 @@ ATTR_HOT inline int matrix_solver_GMRES_t<m_N, _storage_N>::vsolve_non_dynamic(c static inline void givens_mult( const double c, const double s, double * RESTRICT g0, double * RESTRICT g1 ) { - const double tg0 = c * *g0 - s * *g1; - const double tg1 = s * *g0 + c * *g1; + const double tg0 = c * *g0 - s * *g1; + const double tg1 = s * *g0 + c * *g1; - *g0 = tg0; - *g1 = tg1; + *g0 = tg0; + *g1 = tg1; } template <unsigned m_N, unsigned _storage_N> @@ -289,10 +289,10 @@ int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x * * Yousef Saad, * Iterative Methods for Sparse Linear Systems, - * Second Edition, - * SIAM, 20003, - * ISBN: 0898715342, - * LC: QA188.S17. + * Second Edition, + * SIAM, 20003, + * ISBN: 0898715342, + * LC: QA188.S17. * *------------------------------------------------------------------------*/ diff --git a/src/emu/netlist/solver/nld_ms_sor_mat.h b/src/emu/netlist/solver/nld_ms_sor_mat.h index dbb3c7563d4..8498633c4d9 100644 --- a/src/emu/netlist/solver/nld_ms_sor_mat.h +++ b/src/emu/netlist/solver/nld_ms_sor_mat.h @@ -175,7 +175,7 @@ ATTR_HOT inline int matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non_dynamic s = s + nl_math::abs(this->m_A[k][i]); akk = s / akk - 1.0; if ( akk > lambdaN) - lambdaN = akk; + lambdaN = akk; if (akk < lambda1) lambda1 = akk; #endif diff --git a/src/emu/netlist/solver/vector_base.h b/src/emu/netlist/solver/vector_base.h index 3d3a1028b2a..e0ad8139296 100644 --- a/src/emu/netlist/solver/vector_base.h +++ b/src/emu/netlist/solver/vector_base.h @@ -17,7 +17,6 @@ template <unsigned _storage_N> struct pvector { - pvector(unsigned size) : m_N(size) { } diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c index 698bb6a5a4d..f1629308404 100644 --- a/src/emu/netlist/tools/nl_convert.c +++ b/src/emu/netlist/tools/nl_convert.c @@ -17,15 +17,15 @@ static plist_t<int> bubble(const pnamedlist_t<Class *> &sl) ret[i] = i; for(int i=0; i < sl.size()-1;i++) - { - for(int j=i+1; j < sl.size(); j++) - { - if(sl[ret[i]]->name() > sl[ret[j]]->name()) - { - std::swap(ret[i], ret[j]); - } - } - } + { + for(int j=i+1; j < sl.size(); j++) + { + if(sl[ret[i]]->name() > sl[ret[j]]->name()) + { + std::swap(ret[i], ret[j]); + } + } + } return ret; } @@ -179,7 +179,7 @@ nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = { {"M", "CAP_M(%g)", 1.0e-3 }, {"u", "CAP_U(%g)", 1.0e-6 }, /* eagle */ {"U", "CAP_U(%g)", 1.0e-6 }, - {"µ", "CAP_U(%g)", 1.0e-6 }, + {"??", "CAP_U(%g)", 1.0e-6 }, {"N", "CAP_N(%g)", 1.0e-9 }, {"P", "CAP_P(%g)", 1.0e-12}, {"F", "%ge-15", 1.0e-15}, @@ -444,7 +444,7 @@ void nl_convert_eagle_t::convert(const pstring &contents) pstring devname = token.str(); pstring pin = tok.get_string(); add_term(netname, devname + "." + pin); - token = tok.get_token(); } + token = tok.get_token(); } } else { @@ -454,5 +454,3 @@ void nl_convert_eagle_t::convert(const pstring &contents) } } - - diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index 4a0efd020a7..d2e2d238718 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -164,7 +164,6 @@ public: class eagle_tokenizer : public ptokenizer { - public: eagle_tokenizer(nl_convert_eagle_t &convert) : ptokenizer(), m_convert(convert) |
