mame/nl_examples/cdelay.c
couriersud caafc0f782 Netlist improvements:
- nltool now accepts -Ddefine=value to pass on to netlists
- improved option handling and added "dummy" options to add grouping and
  examples in help output.
- improved --cmd=listdevices output
- Fix dynamic timestepping. This will work with breakout using real
  capacitor modelling instead of delay devices. Really slow, but very
  useful to calibrate timings.
- Fix an awful bug in timing for delay devices.
- Switched to clang 3.8 and made code compile with
  -Weverything -Werror -Wno-old-style-cast -Wno-padded -Wno-weak-vtables
  -Wno-missing-variable-declarations -Wno-conversion -Wno-c++98-compat
  -Wno-float-equal -Wno-cast-align -Wno-global-constructors
  -Wno-c++98-compat-pedantic -Wno-exit-time-destructors
  -Wno-format-nonliteral -Wno-weak-template-vtables
  This was a helpful exercise since it brought forward some 
  serious issues with implicit constructors. 
[Couriersud]
2016-07-01 02:09:14 +02:00

53 lines
798 B
C

// license:GPL-2.0+
// copyright-holders:Couriersud
/*
* cdelay.c
*
*/
#include "netlist/devices/net_lib.h"
NETLIST_START(perf)
SOLVER(Solver, 48000)
PARAM(Solver.ACCURACY, 1e-20)
MAINCLOCK(clk, 50000000)
TTL_7400_NAND(n1,clk,clk)
NETLIST_END()
#ifndef P_FREQ
#define P_FREQ 4800
#endif
#ifndef P_DTS
#define P_DTS 1
#endif
NETLIST_START(cap_delay)
/*
* delay circuit
*
*/
/* Standard stuff */
SOLVER(Solver, P_FREQ)
PARAM(Solver.ACCURACY, 1e-20)
PARAM(Solver.DYNAMIC_TS, P_DTS)
PARAM(Solver.MIN_TIMESTEP, 1e-6)
CLOCK(clk, 5000)
TTL_7400_NAND(n1,clk,clk)
CAP(C, 1e-6)
NET_C(n1.Q, C.2)
NET_C(GND, C.1)
TTL_7400_NAND(n2,n1.Q, n1.Q)
LOG(logclk, clk)
LOG(logn1Q, C.2)
LOG(logn2Q, n1.Q)
NETLIST_END()