示例#1
0
static void run(tool_options_t &opts)
{
	netlist_tool_t nt;
	osd_ticks_t t = osd_ticks();

	nt.m_opts = &opts;
	nt.init();
	nt.read_netlist(filetobuf(opts.opt_file()), opts.opt_name());

	plist_t<input_t> *inps = read_input(&nt, opts.opt_inp());

	double ttr = opts.opt_ttr();

	printf("startup time ==> %5.3f\n", (double) (osd_ticks() - t) / (double) osd_ticks_per_second() );
	printf("runnning ...\n");
	t = osd_ticks();

	unsigned pos = 0;
	netlist::netlist_time nlt = netlist::netlist_time::zero;

	while (pos < inps->size() && (*inps)[pos].m_time < netlist::netlist_time::from_double(ttr))
	{
		nt.process_queue((*inps)[pos].m_time - nlt);
		(*inps)[pos].setparam();
		nlt = (*inps)[pos].m_time;
		pos++;
	}
	nt.process_queue(netlist::netlist_time::from_double(ttr) - nlt);
	nt.stop();
	pfree(inps);

	double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
	printf("%f seconds emulation took %f real time ==> %5.2f%%\n", ttr, emutime, ttr/emutime*100.0);
}
示例#2
0
文件: nltool.cpp 项目: dinoue/mame
static void static_compile(tool_options_t &opts)
{
	netlist_tool_t nt("netlist");

	nt.m_opts = &opts;
	nt.init();

	nt.log().verbose.set_enabled(false);
	nt.log().warning.set_enabled(false);

	nt.read_netlist(opts.opt_file(), opts.opt_name());

	nt.solver()->create_solver_code(pout_strm);

	nt.stop();

}
示例#3
0
文件: nltool.c 项目: dinkc64/mame
void usage(tool_options_t &opts)
{
    fprintf(stderr,
            "Usage:\n"
            "  nltool -help\n"
            "  nltool [options]\n"
            "\n"
            "Where:\n"
           );
    fprintf(stderr, "%s\n", opts.help().cstr());
}
示例#4
0
文件: nltool.cpp 项目: dinoue/mame
void usage(tool_options_t &opts)
{
	perr("{}",
		"Usage:\n"
		"  nltool --help\n"
		"  nltool [options]\n"
		"\n"
		"Where:\n"
	);
	perr("{}\n", opts.help().cstr());
}
示例#5
0
文件: nltool.c 项目: dinkc64/mame
static void run(tool_options_t &opts)
{
    netlist_tool_t nt;
    osd_ticks_t t = osd_ticks();

    nt.init();
    nt.m_logs = opts.opt_logs();
    nt.m_verbose = opts.opt_verb();
    nt.read_netlist(filetobuf(opts.opt_file()), opts.opt_name());
    double ttr = opts.opt_ttr();

    printf("startup time ==> %5.3f\n", (double) (osd_ticks() - t) / (double) osd_ticks_per_second() );
    printf("runnning ...\n");
    t = osd_ticks();

    nt.process_queue(netlist::netlist_time::from_double(ttr));
    nt.stop();

    double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
    printf("%f seconds emulation took %f real time ==> %5.2f%%\n", ttr, emutime, ttr/emutime*100.0);
}
示例#6
0
	void verror(const loglevel_e level, const char *format, va_list ap) const
	{
		switch (level)
		{
			case NL_LOG:
				if (m_opts ? m_opts->opt_verb() : false)
				{
					vprintf(format, ap);
					printf("\n");
				}
				break;
			case NL_WARNING:
				if (!(m_opts ? m_opts->opt_quiet() : false))
				{
					vprintf(format, ap);
					printf("\n");
				}
				break;
			case NL_ERROR:
				vprintf(format, ap);
				printf("\n");
				throw;
		}
	}
示例#7
0
文件: nltool.cpp 项目: dinoue/mame
static void run(tool_options_t &opts)
{
	netlist_tool_t nt("netlist");
	plib::ticks_t t = plib::ticks();

	nt.m_opts = &opts;
	nt.init();

	if (!opts.opt_verb())
		nt.log().verbose.set_enabled(false);
	if (opts.opt_quiet())
		nt.log().warning.set_enabled(false);

	nt.read_netlist(opts.opt_file(), opts.opt_name());

	std::vector<input_t> *inps = read_input(&nt, opts.opt_inp());

	double ttr = opts.opt_ttr();

	pout("startup time ==> {1:5.3f}\n", (double) (plib::ticks() - t) / (double) plib::ticks_per_second() );
	pout("runnning ...\n");
	t = plib::ticks();

	unsigned pos = 0;
	netlist::netlist_time nlt = netlist::netlist_time::zero();

	while (pos < inps->size() && (*inps)[pos].m_time < netlist::netlist_time::from_double(ttr))
	{
		nt.process_queue((*inps)[pos].m_time - nlt);
		(*inps)[pos].setparam();
		nlt = (*inps)[pos].m_time;
		pos++;
	}
	nt.process_queue(netlist::netlist_time::from_double(ttr) - nlt);
	nt.stop();
	plib::pfree(inps);

	double emutime = (double) (plib::ticks() - t) / (double) plib::ticks_per_second();
	pout("{1:f} seconds emulation took {2:f} real time ==> {3:5.2f}%\n", ttr, emutime, ttr/emutime*100.0);
}