summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_parser.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-06-13 15:49:35 +0200
committer couriersud <couriersud@gmx.org>2020-06-13 15:49:35 +0200
commite949e9c29de82ee7c32692e7b65da05dd22bdc9d (patch)
tree8770696a48827e3b63d94063f8162eaadeff6539 /src/lib/netlist/nl_parser.cpp
parent75681d760c478f772fdb1603222498f96a9b61e7 (diff)
netlist: Performance improvement and refactoring. [Couriersud]
Kidniki now achieves up to 910% when run with static solvers and with nltool. That is significant better than the 860% we have seen previously. This increase is driven by using a global memory pool in the solver code. In addition the following refactoring and code maintenance work is included. Please excuse the large commit, some of this took interfered with other work and the detail development steps were ugly. - gsl support: This commit adds pgsl.h which implements a very limited number of the functionality of the gsl header described in the c++ core guidelines. - clang-tidy fixes - A significant refactoring of palloc.h. Aligned hints were removed, they added complexity without a significant performance gain. Vector operations should better be done on special spans/views. The code has been tested on linux with g++-7, g++-9, clang-11. On Windows mingw-10 and VS2019, OSX clang-11.
Diffstat (limited to 'src/lib/netlist/nl_parser.cpp')
-rw-r--r--src/lib/netlist/nl_parser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp
index 8e76538632a..e34683d5261 100644
--- a/src/lib/netlist/nl_parser.cpp
+++ b/src/lib/netlist/nl_parser.cpp
@@ -83,7 +83,7 @@ bool parser_t::parse(const pstring &nlname)
require_token(m_tok_paren_left);
token_t name = get_token();
require_token(m_tok_paren_right);
- if (name.str() == nlname || nlname == "")
+ if (name.str() == nlname || nlname.empty())
{
parse_netlist(name.str());
return true;
@@ -164,8 +164,8 @@ void parser_t::net_truthtable_start(const pstring &nlname)
netlist::tt_desc desc;
desc.name = name;
- desc.ni = static_cast<unsigned long>(ni);
- desc.no = static_cast<unsigned long>(no);
+ desc.ni = gsl::narrow<unsigned long>(ni);
+ desc.no = gsl::narrow<unsigned long>(no);
desc.family = "";
while (true)