summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_base.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-01-27 21:47:41 +0100
committer couriersud <couriersud@gmx.org>2020-01-27 21:47:41 +0100
commitf7d8a10da53e07747ab4f11d5c7b4827869e5763 (patch)
tree1ae8c2b3a06a6abd253814bd159cb151dd6cc20a /src/lib/netlist/nl_base.cpp
parent8c2bb6236774977e848c62fad35eb665a6d8e58b (diff)
netlist: Code maintenance. (nw)
- Fixed some clang lint warnings - Removed dead code - Experimental parser code to allow calculations in parameter value. This already works for compiled netlists. These changes are currently disabled. Updated pong netlist (and CRC/SHA) to work with this new code.
Diffstat (limited to 'src/lib/netlist/nl_base.cpp')
-rw-r--r--src/lib/netlist/nl_base.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index 14bb0e5530b..147c7b0423e 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -35,7 +35,6 @@ namespace netlist
public:
logic_family_ttl_t() : logic_family_desc_t()
{
- m_fixed_V = nlconst::magic(5.0);
m_low_thresh_PCNT = nlconst::magic(0.8 / 5.0);
m_high_thresh_PCNT = nlconst::magic(2.0 / 5.0);
// m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications.
@@ -62,7 +61,6 @@ namespace netlist
public:
logic_family_cd4xxx_t() : logic_family_desc_t()
{
- m_fixed_V = nlconst::magic(0.0);
m_low_thresh_PCNT = nlconst::magic(1.5 / 5.0);
m_high_thresh_PCNT = nlconst::magic(3.5 / 5.0);
// m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications.
@@ -214,6 +212,24 @@ namespace netlist
// Initialize factory
devices::initialize_factory(m_setup->factory());
+
+ // Add default include file
+ using a = plib::psource_str_t<plib::psource_t>;
+#if USE_EVAL
+ const pstring content =
+ "#define RES_R(res) (res) \n"
+ "#define RES_K(res) ((res) * 1e3) \n"
+ "#define RES_M(res) ((res) * 1e6) \n"
+ "#define CAP_U(cap) ((cap) * 1e-6) \n"
+ "#define CAP_N(cap) ((cap) * 1e-9) \n"
+ "#define CAP_P(cap) ((cap) * 1e-12) \n"
+ "#define IND_U(ind) ((ind) * 1e-6) \n"
+ "#define IND_N(ind) ((ind) * 1e-9) \n"
+ "#define IND_P(ind) ((ind) * 1e-12) \n";
+ setup().add_include(plib::make_unique<a>("netlist/devices/net_lib.h", content));
+#else
+ setup().add_include(plib::make_unique<a>("netlist/devices/net_lib.h",""));
+#endif
NETLIST_NAME(base)(*m_setup);
}