summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/examples/vccs.c
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-11-25 22:28:41 +0100
committer couriersud <couriersud@gmx.org>2019-11-25 22:28:41 +0100
commitc50bf9a698c8dc3e99ab6f703fc8bb9d1da41ad6 (patch)
tree96f0910ad76c2ef23d87f5626f3c30768ec04c3e /src/lib/netlist/examples/vccs.c
parentceae2fdc3ebbd1c54e21190aa16957af8724b4b5 (diff)
netlist: move nl_examples to src/lib/netlist/examples. (nw)
One folder less in the top-level.
Diffstat (limited to 'src/lib/netlist/examples/vccs.c')
-rw-r--r--src/lib/netlist/examples/vccs.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/netlist/examples/vccs.c b/src/lib/netlist/examples/vccs.c
new file mode 100644
index 00000000000..27ebf5a64e0
--- /dev/null
+++ b/src/lib/netlist/examples/vccs.c
@@ -0,0 +1,30 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * vccs.c
+ *
+ */
+
+
+#include "netlist/devices/net_lib.h"
+
+NETLIST_START(vccs)
+
+ CLOCK(clk, 1000) // 1000 Hz
+ SOLVER(Solver, 48000)
+ PARAM(Solver.ACCURACY, 1e-12)
+ PARAM(Solver.GS_LOOPS, 10000)
+
+ VCCS(VV)
+ PARAM(VV.G, 100) // typical OP-AMP amplification
+ RES(R2, 1)
+
+ NET_C(clk, VV.IN)
+ NET_C(R2.1, VV.OP)
+ NET_C(R2.2, GND)
+ NET_C(VV.ON, GND)
+ NET_C(VV.IP, GND)
+ LOG(logX, VV.OP)
+ LOG(logY, clk)
+
+NETLIST_END()