From abc76f20cb98c90e8dab416dd16dfd4a954013ba Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Jul 2007 21:51:38 -0700 Subject: Major changes to how SimObjects are created and initialized. Almost all creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed --- src/dev/ethertap.cc | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'src/dev/ethertap.cc') diff --git a/src/dev/ethertap.cc b/src/dev/ethertap.cc index 65089a8b2..0b6ab97fc 100644 --- a/src/dev/ethertap.cc +++ b/src/dev/ethertap.cc @@ -50,7 +50,7 @@ #include "dev/etherint.hh" #include "dev/etherpkt.hh" #include "dev/ethertap.hh" -#include "sim/builder.hh" +#include "params/EtherTap.hh" using namespace std; @@ -313,28 +313,10 @@ EtherTap::unserialize(Checkpoint *cp, const std::string §ion) //===================================================================== -BEGIN_DECLARE_SIM_OBJECT_PARAMS(EtherTap) - - SimObjectParam peer; - SimObjectParam dump; - Param port; - Param bufsz; - -END_DECLARE_SIM_OBJECT_PARAMS(EtherTap) - -BEGIN_INIT_SIM_OBJECT_PARAMS(EtherTap) - - INIT_PARAM_DFLT(peer, "peer interface", NULL), - INIT_PARAM_DFLT(dump, "object to dump network packets to", NULL), - INIT_PARAM_DFLT(port, "tap port", 3500), - INIT_PARAM_DFLT(bufsz, "tap buffer size", 10000) - -END_INIT_SIM_OBJECT_PARAMS(EtherTap) - - -CREATE_SIM_OBJECT(EtherTap) +EtherTap * +EtherTapParams::create() { - EtherTap *tap = new EtherTap(getInstanceName(), dump, port, bufsz); + EtherTap *tap = new EtherTap(name, dump, port, bufsz); if (peer) { tap->setPeer(peer); @@ -343,5 +325,3 @@ CREATE_SIM_OBJECT(EtherTap) return tap; } - -REGISTER_SIM_OBJECT("EtherTap", EtherTap) -- cgit v1.2.3