netlist: move nld_power_pins to nl_base.h (nw)

This removes a large number of dependencies on nlid_system.h.
This commit is contained in:
couriersud 2020-05-07 11:04:24 +02:00
parent 2b920981e2
commit 3a4e3f2f3e
44 changed files with 56 additions and 81 deletions

View File

@ -7,7 +7,6 @@
#include "nld_2102A.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
#define ADDR2BYTE(a) ((a) >> 3)
#define ADDR2BIT(a) ((a) & 0x7)

View File

@ -7,7 +7,6 @@
#include "nld_2716.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -6,7 +6,7 @@
*/
#include "nld_4006.h"
#include "nlid_system.h"
#include "nl_base.h"
namespace netlist
{

View File

@ -6,7 +6,8 @@
*/
#include "nld_4020.h"
#include "nlid_system.h"
#include "nl_base.h"
#include "nl_factory.h"
namespace netlist
{

View File

@ -9,7 +9,6 @@
#include "netlist/analog/nlid_twoterm.h"
#include "netlist/solver/nld_solver.h"
#include "nlid_system.h"
// This is an experimental approach to implement the analog switch.
// This will make the switch a 3 terminal element which is completely

View File

@ -8,7 +8,6 @@
#include "nld_4316.h"
#include "netlist/analog/nlid_twoterm.h"
#include "netlist/solver/nld_solver.h"
#include "nlid_system.h"
namespace netlist { namespace devices {

View File

@ -7,7 +7,6 @@
#include "nld_74107.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -5,8 +5,8 @@
*
*/
#include "nlid_system.h"
#include "netlist/analog/nlid_twoterm.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74153.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74161.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
#include <array>

View File

@ -10,7 +10,6 @@
#include "nld_74164.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74165.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74166.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74174.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74175.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74192.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74193.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74194.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74365.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_74393.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7442.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -6,7 +6,6 @@
*/
#include "nld_7448.h"
#include "nlid_system.h"
#include "nlid_truthtable.h"
#include <array>

View File

@ -7,7 +7,6 @@
#include "nld_7450.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7473.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -8,7 +8,6 @@
#include "nld_7474.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
#include <array>

View File

@ -8,7 +8,6 @@
#include "nld_7475.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7483.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7485.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7490.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7492.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_7493.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
//- Identifier: TTL_7493_DIP
//- Title: 7493 Binary Counters

View File

@ -11,7 +11,6 @@
#include "nld_7497.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_82S115.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_82S123.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_82S126.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_82S16.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_9310.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
#define MAXCNT 9

View File

@ -7,7 +7,6 @@
#include "nld_9316.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_9322.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_am2847.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_dm9314.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -7,7 +7,6 @@
#include "nld_dm9334.h"
#include "netlist/nl_base.h"
#include "nlid_system.h"
namespace netlist
{

View File

@ -43,40 +43,6 @@ namespace devices
param_num_t<unsigned> m_max_link_loops;
};
// -----------------------------------------------------------------------------
// power pins - not a device, but a helper
// -----------------------------------------------------------------------------
/// \brief Power pins class.
///
/// Power Pins are passive inputs. Delegate noop will silently ignore any
/// updates.
class nld_power_pins
{
public:
explicit nld_power_pins(device_t &owner, const pstring &sVCC = sPowerVCC,
const pstring &sGND = sPowerGND)
: m_VCC(owner, sVCC, NETLIB_DELEGATE(power_pins, noop))
, m_GND(owner, sGND, NETLIB_DELEGATE(power_pins, noop))
{
}
const analog_input_t &VCC() const noexcept
{
return m_VCC;
}
const analog_input_t &GND() const noexcept
{
return m_GND;
}
private:
void noop() { }
analog_input_t m_VCC;
analog_input_t m_GND;
};
// -----------------------------------------------------------------------------
// clock
// -----------------------------------------------------------------------------

View File

@ -333,13 +333,19 @@ namespace netlist
struct state_var
{
public:
template <typename O, typename... Args>
template <typename O>
//! Constructor.
state_var(O &owner, //!< owner must have a netlist() method.
const pstring &name, //!< identifier/name for this state variable
Args&&... args //!< Initial values for construction of O
const T &value //!< Initial value after construction
);
template <typename O>
//! Constructor.
state_var(O &owner, //!< owner must have a netlist() method.
const pstring &name //!< identifier/name for this state variable
);
//! Destructor.
~state_var() noexcept = default;
//! Copy Constructor.
@ -1776,6 +1782,40 @@ namespace netlist
};
// -----------------------------------------------------------------------------
// power pins - not a device, but a helper
// -----------------------------------------------------------------------------
/// \brief Power pins class.
///
/// Power Pins are passive inputs. Delegate noop will silently ignore any
/// updates.
class nld_power_pins
{
public:
explicit nld_power_pins(device_t &owner, const pstring &sVCC = sPowerVCC,
const pstring &sGND = sPowerGND)
: m_VCC(owner, sVCC, NETLIB_DELEGATE(power_pins, noop))
, m_GND(owner, sGND, NETLIB_DELEGATE(power_pins, noop))
{
}
const analog_input_t &VCC() const noexcept
{
return m_VCC;
}
const analog_input_t &GND() const noexcept
{
return m_GND;
}
private:
void noop() { }
analog_input_t m_VCC;
analog_input_t m_GND;
};
// -----------------------------------------------------------------------------
// inline implementations
// -----------------------------------------------------------------------------
@ -2038,9 +2078,16 @@ namespace netlist
}
template <typename T>
template <typename O, typename... Args>
state_var<T>::state_var(O &owner, const pstring &name, Args&&... args)
: m_value(std::forward<Args>(args)...)
template <typename O>
state_var<T>::state_var(O &owner, const pstring &name, const T &value)
: m_value(value)
{
owner.state().save(owner, m_value, owner.name(), name);
}
template <typename T>
template <typename O>
state_var<T>::state_var(O &owner, const pstring &name)
{
owner.state().save(owner, m_value, owner.name(), name);
}