summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/devices/nlid_system.h
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2016-12-30 15:48:23 +0100
committer couriersud <couriersud@arcor.de>2016-12-30 20:31:14 +0100
commitb1516cc7a3f756750261260bb3fc79f507da9762 (patch)
treed86adf5ad8396fc665f1a5dcd7d0899d94d442e2 /src/lib/netlist/devices/nlid_system.h
parentc6cb9f8bef6665bd1d9d753ae84e34b5a51d2eb6 (diff)
Analog to digital proxy rework. (nw)
Properly handle connected inputs when creating a-d proxy. Aligned a-d proxy to d-a proxy class structure.
Diffstat (limited to 'src/lib/netlist/devices/nlid_system.h')
-rw-r--r--src/lib/netlist/devices/nlid_system.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index 89251264fa7..ff08177cfdb 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -413,6 +413,45 @@ namespace netlist
state_var<netlist_sig_t> m_last_state;
};
+ // -----------------------------------------------------------------------------
+ // factory class to wrap macro based chips/elements
+ // -----------------------------------------------------------------------------
+
+ class factory_lib_entry_t : public base_factory_t
+ {
+ P_PREVENT_COPYING(factory_lib_entry_t)
+ public:
+
+ factory_lib_entry_t(setup_t &setup, const pstring &name, const pstring &classname,
+ const pstring &def_param)
+ : base_factory_t(name, classname, def_param), m_setup(setup) { }
+
+ class wrapper : public device_t
+ {
+ public:
+ wrapper(const pstring &devname, netlist_t &anetlist, const pstring &name)
+ : device_t(anetlist, name), m_devname(devname)
+ {
+ anetlist.setup().namespace_push(name);
+ anetlist.setup().include(m_devname);
+ anetlist.setup().namespace_pop();
+ }
+ protected:
+ NETLIB_RESETI() { }
+ NETLIB_UPDATEI() { }
+
+ pstring m_devname;
+ };
+
+ plib::owned_ptr<device_t> Create(netlist_t &anetlist, const pstring &name) override
+ {
+ return plib::owned_ptr<device_t>::Create<wrapper>(this->name(), anetlist, name);
+ }
+
+ private:
+ setup_t &m_setup;
+ };
+
} //namespace devices
} // namespace netlist