diff options
Diffstat (limited to 'src/lib/netlist/prg/nltool.cpp')
-rw-r--r-- | src/lib/netlist/prg/nltool.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 8d753e212c6..0f7b7ffb565 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -118,6 +118,8 @@ public: } } + netlist::setup_t &setup() { return *m_setup; } + tool_options_t *m_opts; protected: @@ -143,11 +145,13 @@ void usage(tool_options_t &opts) struct input_t { +#if 0 input_t() : m_param(nullptr), m_value(0.0) { } - input_t(netlist::netlist_t *netlist, const pstring &line) +#endif + input_t(const netlist::setup_t &setup, const pstring &line) { char buf[400]; double t; @@ -155,7 +159,7 @@ struct input_t if ( e!= 3) throw netlist::fatalerror_e(plib::pfmt("error {1} scanning line {2}\n")(e)(line)); m_time = netlist::netlist_time::from_double(t); - m_param = netlist->setup().find_param(buf, true); + m_param = setup.find_param(buf, true); } void setparam() @@ -183,9 +187,9 @@ struct input_t }; -std::vector<input_t> *read_input(netlist::netlist_t *netlist, pstring fname) +static std::vector<input_t> read_input(const netlist::setup_t &setup, pstring fname) { - std::vector<input_t> *ret = plib::palloc<std::vector<input_t>>(); + std::vector<input_t> ret; if (fname != "") { plib::pifilestream f(fname); @@ -194,8 +198,8 @@ std::vector<input_t> *read_input(netlist::netlist_t *netlist, pstring fname) { if (l != "") { - input_t inp(netlist, l); - ret->push_back(inp); + input_t inp(setup, l); + ret.push_back(inp); } } } @@ -220,7 +224,7 @@ static void run(tool_options_t &opts) nt.read_netlist(opts.opt_file(), opts.opt_name()); - std::vector<input_t> *inps = read_input(&nt, opts.opt_inp()); + std::vector<input_t> inps = read_input(nt.setup(), opts.opt_inp()); double ttr = opts.opt_ttr(); t.stop(); @@ -234,16 +238,15 @@ static void run(tool_options_t &opts) 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)) + 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; + 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); t.stop(); |