diff options
-rw-r--r-- | .gitattributes | 3 | ||||
-rw-r--r-- | nl_examples/7400_astable.c | 14 | ||||
-rw-r--r-- | nl_examples/opamp.c | 18 | ||||
-rw-r--r-- | nl_examples/sn74ls629_osc.c | 33 | ||||
-rw-r--r-- | nl_examples/todo.c | 17 | ||||
-rw-r--r-- | nl_examples/vccs.c | 28 | ||||
-rw-r--r-- | nl_examples/vccs1.c | 33 |
7 files changed, 114 insertions, 32 deletions
diff --git a/.gitattributes b/.gitattributes index 19aa0f03426..875a1107555 100644 --- a/.gitattributes +++ b/.gitattributes @@ -358,8 +358,11 @@ nl_examples/bjt_eb.c svneol=native#text/plain nl_examples/msx_mixer_stage.c svneol=native#text/plain nl_examples/ne555_astable.c svneol=native#text/plain nl_examples/opamp.c svneol=native#text/plain +nl_examples/sn74ls629_osc.c svneol=native#text/plain nl_examples/test.c svneol=native#text/plain nl_examples/todo.c svneol=native#text/plain +nl_examples/vccs.c svneol=native#text/plain +nl_examples/vccs1.c svneol=native#text/plain src/build/build.mak svneol=native#text/plain src/build/file2str.c svneol=native#text/plain src/build/makedep.c svneol=native#text/plain diff --git a/nl_examples/7400_astable.c b/nl_examples/7400_astable.c index 4e92127c2f5..b9f4c93eee0 100644 --- a/nl_examples/7400_astable.c +++ b/nl_examples/7400_astable.c @@ -16,19 +16,19 @@ NETLIST_START(7400_astable) SOLVER(Solver) PARAM(Solver.FREQ, 48000) - PARAM(Solver.ACCURACY, 1e-7) + PARAM(Solver.ACCURACY, 1e-4) - // astable NAND Multivibrator - RES(R1, 1000) - CAP(C1, 1e-6) + // astable NAND Multivibrator ==> f ~ 1.0 / (3 * R * C) + RES(R1, 4700) + CAP(C1, 0.22e-6) TTL_7400_NAND(n1,R1.1,R1.1) TTL_7400_NAND(n2,R1.2,R1.2) NET_C(n1.Q, R1.2) NET_C(n2.Q, C1.1) NET_C(C1.2, R1.1) - LOG(log2, C1.2) - //LOG(log2, n1.Q) - LOG(log3, n2.Q) + LOG(logC12, C1.2) + LOG(logn1Q, n1.Q) + LOG(logn2Q, n2.Q) NETLIST_END() diff --git a/nl_examples/opamp.c b/nl_examples/opamp.c index 2d960888f2e..57daf960e9c 100644 --- a/nl_examples/opamp.c +++ b/nl_examples/opamp.c @@ -19,10 +19,8 @@ NETLIST_START(opamp) /* Standard stuff */ - CLOCK(clk) - PARAM(clk.FREQ, 1000) // 1000 Hz - SOLVER(Solver) - PARAM(Solver.FREQ, 48000) + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) PARAM(Solver.ACCURACY, 1e-6) /* Wiring up the opamp */ @@ -40,9 +38,9 @@ NETLIST_START(opamp) PARAM(EBUF.RO, 50) PARAM(EBUF.G, 1) - NET_ALIAS(PLUS, G1.IP) // Positive input - NET_ALIAS(MINUS, G1.IN) // Negative input - NET_ALIAS(OUT, EBUF.OP) // Opamp output ... + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G1.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... NET_C(EBUF.ON, GND) @@ -55,6 +53,10 @@ NETLIST_START(opamp) NET_C(CP1.1, RP1.1) NET_C(EBUF.IP, RP1.1) + RES(RL, 1000) + NET_C(RL.2, GND) + NET_C(RL.1, OUT) + //LOG(logX, OUT) - //LOG(logY, 4V) + //LOG(logY, clk) NETLIST_END() diff --git a/nl_examples/sn74ls629_osc.c b/nl_examples/sn74ls629_osc.c new file mode 100644 index 00000000000..e390361a74b --- /dev/null +++ b/nl_examples/sn74ls629_osc.c @@ -0,0 +1,33 @@ +/* + * ne555_astable.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(ne555_astable) + + /* + * Astable ne555 + * + */ + + /* Standard stuff */ + + SOLVER(Solver) + PARAM(Solver.FREQ, 48000) + + ANALOG_INPUT(V5, 5) // 5V + ANALOG_INPUT(VF, 2.5) // 5V + ANALOG_INPUT(VR, 5) // 5V + + SN74LS629(OSC, 0.022e-6) + + NET_C(GND, OSC.GND) + NET_C(VR, OSC.RNG) + NET_C(VF, OSC.FC) + NET_C(GND, OSC.ENQ) + + //LOG(log2, OSC.Y) + +NETLIST_END() diff --git a/nl_examples/todo.c b/nl_examples/todo.c index 641a94fa803..9da1a2c66f6 100644 --- a/nl_examples/todo.c +++ b/nl_examples/todo.c @@ -49,23 +49,6 @@ #endif #if 0 - NETDEV_VCCS(VV) - PARAM(VV.G, 100000) // typical OP-AMP amplification - RES(R1, 1000) - RES(R2, 1) - RES(R3, 10000) - - NET_C(4V, R1.1) - NET_C(R1.2, VV.IN) - NET_C(R2.1, VV.OP) - NET_C(R3.1, VV.IN) - NET_C(R3.2, VV.OP) - NET_C(R2.2, GND) - NET_C(VV.ON, GND) - NET_C(VV.IP, GND) - //LOG(logX, VV.OP) - //LOG(logY, 4V) - #endif #if 0 diff --git a/nl_examples/vccs.c b/nl_examples/vccs.c new file mode 100644 index 00000000000..73cefd15fb1 --- /dev/null +++ b/nl_examples/vccs.c @@ -0,0 +1,28 @@ +/* + * 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.RESCHED_LOOPS, 10000) + + NETDEV_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() diff --git a/nl_examples/vccs1.c b/nl_examples/vccs1.c new file mode 100644 index 00000000000..c1a5725f93c --- /dev/null +++ b/nl_examples/vccs1.c @@ -0,0 +1,33 @@ +/* + * vccs.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(vccs) + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + + + NETDEV_VCCS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + RES(R1, 10000) + RES(R2, 1) + RES(R3, 1000) + + NET_C(clk, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R3.1, VV.IN) + NET_C(R3.2, 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() |