summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/nl_base.cpp')
-rw-r--r--src/lib/netlist/nl_base.cpp89
1 files changed, 60 insertions, 29 deletions
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index d8a01612e25..76ce59db5ac 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -15,6 +15,7 @@
#include "nl_base.h"
#include "devices/nlid_system.h"
+#include "devices/nlid_proxy.h"
namespace netlist
{
@@ -57,11 +58,12 @@ class logic_family_ttl_t : public logic_family_desc_t
public:
logic_family_ttl_t() : logic_family_desc_t()
{
- m_low_thresh_V = 0.8;
- m_high_thresh_V = 2.0;
+ m_fixed_V = 5.0;
+ m_low_thresh_PCNT = 0.8 / 5.0;
+ m_high_thresh_PCNT = 2.0 / 5.0;
// m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications.
- m_low_V = 0.1;
- m_high_V = 4.0;
+ m_low_VO = 0.1;
+ m_high_VO = 1.0; // 4.0
m_R_low = 1.0;
m_R_high = 130.0;
}
@@ -76,11 +78,12 @@ class logic_family_cd4xxx_t : public logic_family_desc_t
public:
logic_family_cd4xxx_t() : logic_family_desc_t()
{
- m_low_thresh_V = 0.8;
- m_high_thresh_V = 2.0;
+ m_fixed_V = 0.0;
+ m_low_thresh_PCNT = 1.5 / 5.0;
+ m_high_thresh_PCNT = 3.5 / 5.0;
// m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications.
- m_low_V = 0.05;
- m_high_V = 4.95;
+ m_low_VO = 0.05;
+ m_high_VO = 0.05; // 4.95
m_R_low = 10.0;
m_R_high = 10.0;
}
@@ -464,26 +467,7 @@ void netlist_t::print_stats() const
}
}
-// ----------------------------------------------------------------------------------------
-// Parameters ...
-// ----------------------------------------------------------------------------------------
-template <typename C, param_t::param_type_t T>
-param_template_t<C, T>::param_template_t(device_t &device, const pstring name, const C val)
-: param_t(T, device, device.name() + "." + name)
-, m_param(val)
-{
- /* pstrings not yet supported, these need special logic */
- if (T != param_t::STRING && T != param_t::MODEL)
- netlist().save(*this, m_param, "m_param");
- device.setup().register_and_set_param(device.name() + "." + name, *this);
-}
-
-template class param_template_t<double, param_t::DOUBLE>;
-template class param_template_t<int, param_t::INTEGER>;
-template class param_template_t<bool, param_t::LOGIC>;
-template class param_template_t<pstring, param_t::STRING>;
-template class param_template_t<pstring, param_t::MODEL>;
// ----------------------------------------------------------------------------------------
// core_device_t
@@ -904,13 +888,21 @@ logic_input_t::logic_input_t(core_device_t &dev, const pstring &aname)
}
// ----------------------------------------------------------------------------------------
-// param_t & friends
+// Parameters ...
// ----------------------------------------------------------------------------------------
param_t::param_t(const param_type_t atype, device_t &device, const pstring &name)
- : device_object_t(device, name, PARAM)
+ : device_object_t(device, device.name() + "." + name, PARAM)
, m_param_type(atype)
{
+ device.setup().register_param(this->name(), *this);
+}
+
+void param_t::update_param()
+{
+ device().update_param();
+ if (device().needs_update_after_param_change())
+ device().update_dev();
}
const pstring param_model_t::model_type()
@@ -920,6 +912,39 @@ const pstring param_model_t::model_type()
return m_map["COREMODEL"];
}
+param_str_t::param_str_t(device_t &device, const pstring name, const pstring val)
+: param_t(param_t::STRING, device, name)
+{
+ m_param = device.setup().get_initial_param_val(this->name(),val);
+}
+
+param_double_t::param_double_t(device_t &device, const pstring name, const double val)
+: param_t(param_t::DOUBLE, device, name)
+{
+ m_param = device.setup().get_initial_param_val(this->name(),val);
+ netlist().save(*this, m_param, "m_param");
+}
+
+param_int_t::param_int_t(device_t &device, const pstring name, const int val)
+: param_t(param_t::INTEGER, device, name)
+{
+ m_param = device.setup().get_initial_param_val(this->name(),val);
+ netlist().save(*this, m_param, "m_param");
+}
+
+param_logic_t::param_logic_t(device_t &device, const pstring name, const bool val)
+: param_t(param_t::LOGIC, device, name)
+{
+ m_param = device.setup().get_initial_param_val(this->name(),val);
+ netlist().save(*this, m_param, "m_param");
+}
+
+param_ptr_t::param_ptr_t(device_t &device, const pstring name, uint8_t * val)
+: param_t(param_t::POINTER, device, name)
+{
+ m_param = val; //device.setup().get_initial_param_val(this->name(),val);
+ //netlist().save(*this, m_param, "m_param");
+}
const pstring param_model_t::model_value_str(const pstring &entity)
{
@@ -935,6 +960,12 @@ nl_double param_model_t::model_value(const pstring &entity)
return netlist().setup().model_value(m_map, entity);
}
+std::unique_ptr<plib::pistream> param_data_t::stream()
+{
+ return device().netlist().setup().get_data_stream(Value());
+}
+
+
namespace devices
{