summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/devices/nld_9316.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/devices/nld_9316.cpp')
-rw-r--r--src/lib/netlist/devices/nld_9316.cpp78
1 files changed, 15 insertions, 63 deletions
diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp
index 8c6b70c5810..3033ace81bc 100644
--- a/src/lib/netlist/devices/nld_9316.cpp
+++ b/src/lib/netlist/devices/nld_9316.cpp
@@ -44,15 +44,15 @@ namespace netlist
{
NETLIB_CONSTRUCTOR(9316_sub)
, m_CLK(*this, "CLK")
+ , m_cnt(*this, "m_cnt", 0)
+ , m_loadq(*this, "m_loadq", 0)
+ , m_ent(*this, "m_ent", 0)
, m_QA(*this, "QA")
, m_QB(*this, "QB")
, m_QC(*this, "QC")
, m_QD(*this, "QD")
, m_RC(*this, "RC")
, m_ABCD(nullptr)
- , m_cnt(*this, "m_cnt", 0)
- , m_loadq(*this, "m_loadq", 0)
- , m_ent(*this, "m_ent", 0)
{
}
@@ -60,11 +60,20 @@ namespace netlist
NETLIB_UPDATEI();
public:
- inline void update_outputs_all(const uint_fast8_t cnt, const netlist_time out_delay);
- inline void update_outputs(const uint_fast8_t cnt);
+ void update_outputs_all(const uint_fast8_t cnt, const netlist_time out_delay)
+ {
+ OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
+ OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
+ OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
+ OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
+ }
logic_input_t m_CLK;
+ state_var_u8 m_cnt;
+ state_var_u8 m_loadq;
+ state_var_u8 m_ent;
+
logic_output_t m_QA;
logic_output_t m_QB;
logic_output_t m_QC;
@@ -72,11 +81,6 @@ namespace netlist
logic_output_t m_RC;
NETLIB_NAME(9316_subABCD) *m_ABCD;
-
- state_var_u8 m_cnt;
- state_var_u8 m_loadq;
- state_var_u8 m_ent;
-
};
NETLIB_OBJECT(9316)
@@ -173,7 +177,7 @@ namespace netlist
break;
default:
m_cnt++;
- update_outputs(m_cnt);
+ update_outputs_all(m_cnt, NLTIME_FROM_NS(20));
break;
}
}
@@ -209,58 +213,6 @@ namespace netlist
}
}
- inline NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const uint_fast8_t cnt, const netlist_time out_delay))
- {
- OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
- OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
- OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
- OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
- }
-
- inline NETLIB_FUNC_VOID(9316_sub, update_outputs, (const uint_fast8_t cnt))
- {
- /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20);
- #if 0
- // for (int i=0; i<4; i++)
- // OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]);
- OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
- OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
- OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
- OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
- #else
- if ((cnt & 1) == 1)
- OUTLOGIC(m_QA, 1, out_delay);
- else
- {
- OUTLOGIC(m_QA, 0, out_delay);
- switch (cnt)
- {
- case 0x00:
- OUTLOGIC(m_QB, 0, out_delay);
- OUTLOGIC(m_QC, 0, out_delay);
- OUTLOGIC(m_QD, 0, out_delay);
- break;
- case 0x02:
- case 0x06:
- case 0x0A:
- case 0x0E:
- OUTLOGIC(m_QB, 1, out_delay);
- break;
- case 0x04:
- case 0x0C:
- OUTLOGIC(m_QB, 0, out_delay);
- OUTLOGIC(m_QC, 1, out_delay);
- break;
- case 0x08:
- OUTLOGIC(m_QB, 0, out_delay);
- OUTLOGIC(m_QC, 0, out_delay);
- OUTLOGIC(m_QD, 1, out_delay);
- break;
- }
-
- }
- #endif
- }
NETLIB_DEVICE_IMPL(9316)
NETLIB_DEVICE_IMPL(9316_dip)