diff options
author | 2019-09-10 21:42:28 +0200 | |
---|---|---|
committer | 2019-09-12 01:02:01 +0200 | |
commit | 9ea16d24e26218e505ef2a947ad89c99e19abc78 (patch) | |
tree | e7d9bf8c4ba464d87ac626915a4e3e6fceade023 /nl_examples/cccs.c | |
parent | 0c02c8aa076d5be078d811ca5e3d6256ae5f6e7e (diff) |
nl_examples: commit some long overdue changes. (nw)
Diffstat (limited to 'nl_examples/cccs.c')
-rw-r--r-- | nl_examples/cccs.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/nl_examples/cccs.c b/nl_examples/cccs.c new file mode 100644 index 00000000000..a1244677d20 --- /dev/null +++ b/nl_examples/cccs.c @@ -0,0 +1,39 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * cccs.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(cccs) + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.METHOD, "MAT_CR") + + CCCS(VV) + PARAM(VV.G, 1) + PARAM(VV.RI, 1e-3) + + RES(R2, 1000) + RES(R1, 1000) + NET_C(clk, VV.IP) + NET_C(VV.IN, R1.1) + NET_C(R1.2, GND) + + NET_C(R2.1, VV.OP) + NET_C(R2.2, GND) + NET_C(VV.ON, GND) + + /* Simple current source */ + + CS(CS1, 1) + RES(R3, 1) + NET_C(R3.1, CS1.P) + NET_C(GND, CS1.N, R3.2) + +NETLIST_END() |