summaryrefslogtreecommitdiffstatshomepage
path: root/nl_examples/diode.c
diff options
context:
space:
mode:
author Westley M. Martinez <anikom15@gmail.com>2016-12-29 14:34:59 -0800
committer Westley M. Martinez <anikom15@gmail.com>2016-12-29 14:34:59 -0800
commit1fafe7706cbfcfc6e39c23c3c713fbb102557cbe (patch)
treee717407aa8f98f192a2095f28909c89f3af3a8e5 /nl_examples/diode.c
parentf7a98c4a969478fca51faf30f588d59631394bd9 (diff)
parent2b74e4c0be91b86b408fca518af7518c1ea994c9 (diff)
Merge https://github.com/mamedev/mame
Diffstat (limited to 'nl_examples/diode.c')
-rw-r--r--nl_examples/diode.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/nl_examples/diode.c b/nl_examples/diode.c
new file mode 100644
index 00000000000..9a2196c6f24
--- /dev/null
+++ b/nl_examples/diode.c
@@ -0,0 +1,31 @@
+/*
+ * diode.c
+ *
+ */
+
+
+#include "netlist/devices/net_lib.h"
+
+NETLIST_START(diode)
+ /* Standard stuff */
+
+ CLOCK(clk, 1000) // 1000 Hz
+ SOLVER(Solver, 48)
+ ANALOG_INPUT(V5, 5)
+
+ //DIODE(D, "1N914")
+ DIODE(D, "D(IS=1e-15)")
+
+ RES(R, RES_K(10))
+ RES(R1, RES_K(10))
+
+ NET_C(clk, D.K)
+ NET_C(D.A, R.1)
+ NET_C(R.2, V5)
+ NET_C(R1.2, GND)
+ NET_C(R.1, R1.1)
+
+ LOG(logB, clk)
+ LOG(logC, D.A)
+
+NETLIST_END()