1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/*
* nld_system.c
*
*/
#include "nld_system.h"
#include "nld_twoterm.h"
// ----------------------------------------------------------------------------------------
// netdev_const
// ----------------------------------------------------------------------------------------
NETLIB_START(ttl_const)
{
register_output("Q", m_Q);
register_param("CONST", m_const, 0);
}
NETLIB_UPDATE(ttl_const)
{
}
NETLIB_UPDATE_PARAM(ttl_const)
{
OUTLOGIC(m_Q, m_const.Value(), NLTIME_IMMEDIATE);
}
NETLIB_START(analog_const)
{
register_output("Q", m_Q);
register_param("CONST", m_const, 0.0);
}
NETLIB_UPDATE(analog_const)
{
}
NETLIB_UPDATE_PARAM(analog_const)
{
m_Q.initial(m_const.Value());
}
// ----------------------------------------------------------------------------------------
// clock
// ----------------------------------------------------------------------------------------
NETLIB_START(clock)
{
register_output("Q", m_Q);
//register_input("FB", m_feedback);
register_param("FREQ", m_freq, 7159000.0 * 5.0);
m_inc = netlist_time::from_hz(m_freq.Value()*2);
register_link_internal(m_feedback, m_Q, netlist_input_t::STATE_INP_ACTIVE);
}
NETLIB_UPDATE_PARAM(clock)
{
m_inc = netlist_time::from_hz(m_freq.Value()*2);
}
NETLIB_UPDATE(clock)
{
OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc );
}
// ----------------------------------------------------------------------------------------
// logic_input
// ----------------------------------------------------------------------------------------
NETLIB_START(logic_input)
{
register_output("Q", m_Q);
}
NETLIB_UPDATE(logic_input)
{
}
// ----------------------------------------------------------------------------------------
// analog_input
// ----------------------------------------------------------------------------------------
NETLIB_START(analog_input)
{
register_output("Q", m_Q);
}
NETLIB_UPDATE(analog_input)
{
}
|