Previous 199869 Revisions Next

r26468 Sunday 1st December, 2013 at 19:26:34 UTC by Couriersud
Netlist: logs now write to individual log files
[src/emu/netlist]netlist.mak
[src/emu/netlist/devices]net_lib.c net_lib.h nld_log.c* nld_log.h*

trunk/src/emu/netlist/devices/net_lib.c
r26467r26468
6868{
6969}
7070
71NETLIB_START(log)
72{
73   register_input("I", m_I);
74}
75
76NETLIB_UPDATE(log)
77{
78   printf("%s: %f %f\n", name().cstr(), netlist().time().as_double(), INPANALOG(m_I));
79}
80
81
8271NETLIB_START(nicMultiSwitch)
8372{
8473   static const char *sIN[8] = { "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8" };
trunk/src/emu/netlist/devices/nld_log.c
r0r26468
1/*
2 * nld_log.c
3 *
4 */
5
6#include "nld_log.h"
7
8NETLIB_START(log)
9{
10    register_input("I", m_I);
11
12    pstring filename = "netlist_" + name() + ".log";
13    m_file = fopen(filename, "w");
14}
15
16NETLIB_UPDATE(log)
17{
18    fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I));
19}
20
21NETLIB_NAME(log)::~NETLIB_NAME(log)()
22{
23    fclose(m_file);
24}
Property changes on: trunk/src/emu/netlist/devices/nld_log.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/netlist/devices/net_lib.h
r26467r26468
6868
6969#include "nld_NE555.h"
7070
71#include "nld_log.h"
72
7173// this is a bad hack
7274#define USE_OLD7493 (0)
7375
r26467r26468
8789      NET_CONNECT(_name, i1, _i1)                                                 \
8890      NET_CONNECT(_name, i2, _i2)
8991#define NETDEV_DELAY_RISE(_name, _CLK, _D)                                          \
90      NET_REGISTER_DEV(delay_lh, _name)                                    \
92      NET_REGISTER_DEV(delay_lh, _name)                                           \
9193      NET_CONNECT(_name, CLK, _CLK)                                               \
9294      NET_CONNECT(_name, D, _D)
9395#define NETDEV_RSFF(_name, _S, _R)                                                  \
r26467r26468
9597      NET_CONNECT(_name, S, _S)                                                   \
9698      NET_CONNECT(_name, R, _R)
9799
98#define NETDEV_LOG(_name, _I)                                                       \
99      NET_REGISTER_DEV(log, _name)                                         \
100      NET_CONNECT(_name, I, _I)
101100
102101
103102// ----------------------------------------------------------------------------------------
r26467r26468
203202   netlist_analog_output_t m_Q;
204203);
205204
206NETLIB_DEVICE(log,
207   netlist_analog_input_t m_I;
208);
209
210
211205// ----------------------------------------------------------------------------------------
212206// Special devices ...
213207// ----------------------------------------------------------------------------------------
trunk/src/emu/netlist/devices/nld_log.h
r0r26468
1// license:GPL-2.0+
2// copyright-holders:Couriersud
3/*
4 * nld_log.h
5 *
6 *  Devices supporting analysis and logging
7 *
8 *  nld_log:
9 *
10 *          +---------+
11 *          |    ++   |
12 *        I |         | ==> Log to file "netlist_" + name() + ".log"
13 *          |         |
14 *          +---------+
15 *
16 */
17
18#ifndef NLD_LOG_H_
19#define NLD_LOG_H_
20
21#include "../nl_base.h"
22
23#define NETDEV_LOG(_name, _I)                                                       \
24        NET_REGISTER_DEV(log, _name)                                                \
25        NET_CONNECT(_name, I, _I)
26
27NETLIB_DEVICE(log,
28    ~NETLIB_NAME(log)();
29    netlist_analog_input_t m_I;
30private:
31    FILE *m_file;
32);
33
34#endif /* NLD_LOG_H_ */
Property changes on: trunk/src/emu/netlist/devices/nld_log.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/netlist/netlist.mak
r26467r26468
2929   $(NETLISTOBJ)/devices/nld_7474.o \
3030   $(NETLISTOBJ)/devices/nld_7486.o \
3131   $(NETLISTOBJ)/devices/nld_NE555.o \
32   $(NETLISTOBJ)/devices/nld_log.o \
3233

Previous 199869 Revisions Next


© 1997-2024 The MAME Team