summaryrefslogtreecommitdiff
path: root/src/dev/simconsole.cc
diff options
context:
space:
mode:
authorMiles Kaufmann <milesck@eecs.umich.edu>2007-08-30 15:16:59 -0400
committerMiles Kaufmann <milesck@eecs.umich.edu>2007-08-30 15:16:59 -0400
commit54cc0053f0a6822e47a49771976af6daaabc24bb (patch)
tree72e6c7879de698347832e1e1475afbb9c1be2b70 /src/dev/simconsole.cc
parent9cb49ab9e0ff8917d20fd7dc81be3ce5ecc81bd8 (diff)
downloadgem5-54cc0053f0a6822e47a49771976af6daaabc24bb.tar.xz
params: Deprecate old-style constructors; update most SimObject constructors.
SimObjects not yet updated: - Process and subclasses - BaseCPU and subclasses The SimObject(const std::string &name) constructor was removed. Subclasses that still rely on that behavior must call the parent initializer as : SimObject(makeParams(name)) --HG-- extra : convert_revision : d6faddde76e7c3361ebdbd0a7b372a40941c12ed
Diffstat (limited to 'src/dev/simconsole.cc')
-rw-r--r--src/dev/simconsole.cc30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/dev/simconsole.cc b/src/dev/simconsole.cc
index 7ce462bd0..e8dc1b210 100644
--- a/src/dev/simconsole.cc
+++ b/src/dev/simconsole.cc
@@ -52,7 +52,6 @@
#include "dev/platform.hh"
#include "dev/simconsole.hh"
#include "dev/uart.hh"
-#include "params/SimConsole.hh"
using namespace std;
@@ -91,18 +90,24 @@ SimConsole::DataEvent::process(int revent)
/*
* SimConsole code
*/
-SimConsole::SimConsole(const string &name, ostream *os, int num, int port)
- : SimObject(name), listenEvent(NULL), dataEvent(NULL), number(num),
- data_fd(-1), txbuf(16384), rxbuf(16384), outfile(os)
+SimConsole::SimConsole(const Params *p)
+ : SimObject(p), listenEvent(NULL), dataEvent(NULL), number(p->number),
+ data_fd(-1), txbuf(16384), rxbuf(16384), outfile(NULL)
#if TRACING_ON == 1
, linebuf(16384)
#endif
{
- if (outfile)
+ if (!p->output.empty()) {
+ if (p->append_name)
+ outfile = simout.find(p->output + "." + p->name);
+ else
+ outfile = simout.find(p->output);
+
outfile->setf(ios::unitbuf);
+ }
- if (port)
- listen(port);
+ if (p->port)
+ listen(p->port);
}
SimConsole::~SimConsole()
@@ -328,14 +333,5 @@ SimConsole::out(char c)
SimConsole *
SimConsoleParams::create()
{
- string filename = output;
- ostream *stream = NULL;
-
- if (!filename.empty()) {
- if (append_name)
- filename += "." + name;
- stream = simout.find(filename);
- }
-
- return new SimConsole(name, stream, number, port);
+ return new SimConsole(this);
}