summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/devices/nld_74153.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-07-12 12:11:40 +0200
committer couriersud <couriersud@gmx.org>2020-07-12 12:12:27 +0200
commit268366566583916526f67a66254ffc934d18f237 (patch)
treefd12281c54063a1263e64de045fc8ba78e7c85a5 /src/lib/netlist/devices/nld_74153.cpp
parenta5fc819f50130a0b0af9b9366d485c79d038e8b8 (diff)
netlist: first batch of explicit handlers.
* Currently devices use the "update" function if no handler is given for an input. * For this to work the update function has to be virtual. This will cause issues on shared execution schemes like CPU/GPU using nvcc. * This is the first batch of changes to ensure that handler resolution is static.
Diffstat (limited to 'src/lib/netlist/devices/nld_74153.cpp')
-rw-r--r--src/lib/netlist/devices/nld_74153.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/netlist/devices/nld_74153.cpp b/src/lib/netlist/devices/nld_74153.cpp
index ce6f6536364..31ead62b6da 100644
--- a/src/lib/netlist/devices/nld_74153.cpp
+++ b/src/lib/netlist/devices/nld_74153.cpp
@@ -13,10 +13,9 @@ namespace netlist
namespace devices
{
- /* FIXME: timing is not 100% accurate, Strobe and Select inputs have a
- * slightly longer timing.
- * Convert this to sub-devices at some time.
- */
+ // FIXME: timing is not 100% accurate, Strobe and Select inputs have a
+ // slightly longer timing .
+ // FIXME: Truthtable candidate
NETLIB_OBJECT(74153)
{
@@ -25,8 +24,8 @@ namespace devices
, m_G(*this, "G", NETLIB_DELEGATE(sub))
, m_Y(*this, "AY") //FIXME: Change netlists
, m_chan(*this, "m_chan", 0)
- , m_A(*this, "A")
- , m_B(*this, "B")
+ , m_A(*this, "A", NETLIB_DELEGATE(other))
+ , m_B(*this, "B", NETLIB_DELEGATE(other))
, m_power_pins(*this)
{
}
@@ -36,12 +35,17 @@ namespace devices
m_chan = 0;
}
- NETLIB_UPDATEI()
+ NETLIB_HANDLERI(other)
{
m_chan = (m_A() | (m_B()<<1));
sub();
}
+ NETLIB_UPDATEI()
+ {
+ other();
+ }
+
NETLIB_HANDLERI(sub)
{
constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };