mirror of
https://github.com/holub/mame
synced 2025-06-05 20:33:45 +03:00
Commit current state of netlist examples. Later, these are intended as a basis for regression tests.
This commit is contained in:
parent
ee7c90c3a4
commit
534348f6a9
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
33
nl_examples/sn74ls629_osc.c
Normal file
33
nl_examples/sn74ls629_osc.c
Normal file
@ -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()
|
@ -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
|
||||
|
28
nl_examples/vccs.c
Normal file
28
nl_examples/vccs.c
Normal file
@ -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()
|
33
nl_examples/vccs1.c
Normal file
33
nl_examples/vccs1.c
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user