mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
nl_examples: commit some long overdue changes. (nw)
This commit is contained in:
parent
0c02c8aa07
commit
9ea16d24e2
4 changed files with 131 additions and 0 deletions
33
nl_examples/7414.cpp
Normal file
33
nl_examples/7414.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// license:GPL-2.0+
|
||||
// copyright-holders:Couriersud
|
||||
/*
|
||||
* 7414.c
|
||||
*
|
||||
*/
|
||||
|
||||
#include "netlist/devices/net_lib.h"
|
||||
|
||||
NETLIST_START(7414_astable)
|
||||
|
||||
/*
|
||||
* Simple oscillator with 74LS14
|
||||
*
|
||||
* ./nltool -f nl_examples/7414.cpp -l C37.1 -l U4A1.Q
|
||||
*
|
||||
*/
|
||||
|
||||
/* Standard stuff */
|
||||
|
||||
SOLVER(Solver, 48000)
|
||||
PARAM(Solver.ACCURACY, 1e-8)
|
||||
|
||||
TTL_74LS14_GATE(U4A1)
|
||||
//TTL_7404_GATE(U4A1)
|
||||
RES(R39, 2200)
|
||||
CAP(C37, CAP_U(1))
|
||||
NET_C(U4A1.A, R39.2, C37.1)
|
||||
NET_C(GND, C37.2)
|
||||
NET_C(GND, U4A1.GND)
|
||||
NET_C(R39.1, U4A1.Q)
|
||||
|
||||
NETLIST_END()
|
39
nl_examples/cccs.c
Normal file
39
nl_examples/cccs.c
Normal file
|
@ -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()
|
27
nl_examples/cs.cpp
Normal file
27
nl_examples/cs.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
// license:GPL-2.0+
|
||||
// copyright-holders:Couriersud
|
||||
/*
|
||||
* cs.c
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "netlist/devices/net_lib.h"
|
||||
|
||||
NETLIST_START(cs)
|
||||
|
||||
SOLVER(Solver, 48000)
|
||||
PARAM(Solver.ACCURACY, 1e-12)
|
||||
PARAM(Solver.METHOD, "MAT_CR")
|
||||
|
||||
/* Positive current flows into pin 1 of the current source
|
||||
* Thus we observe a negative voltage on R1.1 !
|
||||
*/
|
||||
CS(CS1, 1e-3)
|
||||
RES(R1, 1000)
|
||||
|
||||
NET_C(CS1.1, R1.1)
|
||||
NET_C(GND, CS1.2, R1.2)
|
||||
|
||||
LOG(log_P, R1.1)
|
||||
NETLIST_END()
|
32
nl_examples/vs.c
Normal file
32
nl_examples/vs.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
// license:GPL-2.0+
|
||||
// copyright-holders:Couriersud
|
||||
/*
|
||||
* vs_cs.c
|
||||
*
|
||||
* Voltage and current source test
|
||||
*
|
||||
*/
|
||||
|
||||
#include "netlist/devices/net_lib.h"
|
||||
|
||||
NETLIST_START(vs)
|
||||
|
||||
/* Standard stuff */
|
||||
|
||||
SOLVER(Solver, 480)
|
||||
PARAM(Solver.ACCURACY, 1e-6)
|
||||
PARAM(Solver.METHOD, "MAT_CR")
|
||||
PARAM(Solver.DYNAMIC_TS, 1)
|
||||
|
||||
RES(R1, 1000)
|
||||
VS(VS1, 1)
|
||||
PARAM(VS1.R, 1)
|
||||
PARAM(VS1.FUNC, "T 10000.0 * sin 1.0 +")
|
||||
NET_C(R1.1, VS1.P)
|
||||
NET_C(R1.2, VS1.N)
|
||||
NET_C(GND, VS1.N)
|
||||
|
||||
//LOG(tt, VS1.P)
|
||||
//LOG(tt1, R1.1)
|
||||
|
||||
NETLIST_END()
|
Loading…
Reference in a new issue